SOURCES = \ src/preamble.bash \ lib/detectNumCPUs.bash \ lib/run.bash \ lib/setPath.bash \ src/functions.bash \ src/resource.bash \ src/main.bash \ $(NULL) all: Build clean: rm -f Build Build.tmp Build: $(SOURCES) # Concatenate the source files to $@.tmp. rm -f $@ $@.tmp for i in $(SOURCES); do \ cat $$i >> $@.tmp; \ echo >> $@.tmp; \ done # 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