]> gitweb @ CieloNegro.org - autobuild.git/blobdiff - Makefile
The 'source' built-in command tries to search for the given filename in PATH when...
[autobuild.git] / Makefile
index dce93f9970bb17db8868ecd3c64674a19871418a..0e487ffb8c1ebf803917f55c8be5a37b52571c6f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,12 +14,17 @@ clean:
        rm -f Build Build.tmp
 
 Build: $(SOURCES)
-       rm -f $@.tmp
+# Concatenate the source files to $@.tmp.
+       rm -f $@ $@.tmp
        for i in $(SOURCES); do \
                cat $$i >> $@.tmp; \
                echo >> $@.tmp; \
        done
-       head -q -n -1 $@.tmp > $@
+# Copy the content of $@.tmp to $@ except for the last line.
+       lines=`wc -l $@.tmp | awk '{print $$1}'` && \
+               lines=`expr $$lines - 1` && \
+               head -n $$lines $@.tmp > $@
+# Clean up.
        rm -f $@.tmp
        chmod a=rx $@