X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=autobuild.git;a=blobdiff_plain;f=Makefile;h=0e487ffb8c1ebf803917f55c8be5a37b52571c6f;hp=a85cff82c3145f82bea548df573d33ccb2d44bbf;hb=HEAD;hpb=46be632798ce01a88e99099a3eb8789bad087b18 diff --git a/Makefile b/Makefile index a85cff8..0e487ff 100644 --- a/Makefile +++ b/Makefile @@ -14,12 +14,18 @@ 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 $@ -.PHONY: all clean \ No newline at end of file +.PHONY: all clean