#awk source files, colon separated Sources=arraytools.awk:classify.awk Here=$(PWD) Tmp:=$(Here)/tmp #What data to use Dataset:=servo.txt#default dataset (no spaces here, please) Datadir:=$(Here)/data/ Data:=$(Datadir)$(Dataset) #profiling output options Timestamp=$(shell date '+%m.%d.%y-%H:%M:%S.%N') Profout=$(Tmp)/profile-$(Dataset)-$(Timestamp).out Vardump=$(Tmp)/vars-$(Dataset)-$(Timestamp).out #What to run Src= -f $(subst :, -f ,$(Sources)) Run= gawk $(Src) $(Data) Debug= pgawk --dump-variables=$(Vardump) --profile=$(Profout) $(Src) $(Data) Profile= pgawk --profile=$(Profout) $(Src) $(Data) Test= gawk -f testit.awk $(Testdir)/$(T) testfile=$(T) tmpdir=$(Tmp) #How to test what you run Testdir=$(Here)/eg Alltests:=$(shell cd $(Testdir); ls | egrep '^.*eg$$' | sort -n ) T=pipe.eg#default test to run (no spaces please) main : all all : $(Run) run : $(Run) debug : echo Debuggin\' $(Debug) profile : echo Profilin\' $(Profile) test : $(Test) tests:; @$(foreach x, $(Alltests), $(MAKE) -s T=$x test;) clean : rm -f $(Tmp)/*.out rm -f $(Tmp)/*.got