Tmp = $(HOME)/tmp DESTDIR = $(HOME)/ Bin = $(DESTDIR)bin/wisp model = 1 all: target copy prepare model maxfunwalk cleanup target: @mkdir -p $(Bin) copy: maxfunwalk.c maxfunwalk.h model$(model).c model.h @cp maxfunwalk.c $(Tmp) @cp maxfunwalk.h $(Tmp)/rawHeader @cp model$(model).c $(Tmp)/model.c @cp model.h $(Tmp) prepare: $(Tmp)/rawHeader ifeq ($(model),1) @sed 's/MITIGATION/2/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),2) @sed 's/MITIGATION/31/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),3) @sed 's/MITIGATION/3/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),4) @sed 's/MITIGATION/58/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),5) @sed 's/MITIGATION/99/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),21) @sed 's/MITIGATION/31/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),22) @sed 's/MITIGATION/62/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),24) @sed 's/MITIGATION/124/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),28) @sed 's/MITIGATION/248/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),216) @sed 's/MITIGATION/496/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),41) @sed 's/MITIGATION/58/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),42) @sed 's/MITIGATION/116/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),44) @sed 's/MITIGATION/232/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),48) @sed 's/MITIGATION/464/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),416) @sed 's/MITIGATION/928/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),51) @sed 's/MITIGATION/99/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),52) @sed 's/MITIGATION/198/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),54) @sed 's/MITIGATION/396/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),58) @sed 's/MITIGATION/792/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif ifeq ($(model),516) @sed 's/MITIGATION/1584/' $(Tmp)/rawHeader > $(Tmp)/maxfunwalk.h endif model: $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/maxfunwalk.h @g++ -c $(Tmp)/model.c -o $(Tmp)/model.o ifeq ($(model),21) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk21 @echo "You can run the maxfunwalk21 from folder $(Bin)." endif ifeq ($(model),22) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk22 @echo "You can run the maxfunwalk22 from folder $(Bin)." endif ifeq ($(model),24) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk24 @echo "You can run the maxfunwalk24 from folder $(Bin)." endif ifeq ($(model),28) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk28 @echo "You can run the maxfunwalk28 from folder $(Bin)." endif ifeq ($(model),216) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk216 @echo "You can run the maxfunwalk216 from folder $(Bin)." endif ifeq ($(model),41) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk41 @echo "You can run the maxfunwalk41 from folder $(Bin)." endif ifeq ($(model),42) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk42 @echo "You can run the maxfunwalk42 from folder $(Bin)." endif ifeq ($(model),44) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk44 @echo "You can run the maxfunwalk44 from folder $(Bin)." endif ifeq ($(model),48) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk48 @echo "You can run the maxfunwalk48 from folder $(Bin)." endif ifeq ($(model),416) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk416 @echo "You can run the maxfunwalk416 from folder $(Bin)." endif ifeq ($(model),51) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk51 @echo "You can run the maxfunwalk51 from folder $(Bin)." endif ifeq ($(model),52) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk52 @echo "You can run the maxfunwalk52 from folder $(Bin)." endif ifeq ($(model),54) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk54 @echo "You can run the maxfunwalk54 from folder $(Bin)." endif ifeq ($(model),58) maxfunwalk: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/maxfunwalk.c $(Tmp)/model.o -o $(Bin)/maxfunwalk58 @echo "You can run the maxfunwalk58 from folder $(Bin)." endif cleanup: $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/rawHeader @rm -rf $(Tmp)/maxfunwalk.c $(Tmp)/maxfunwalk.h $(Tmp)/model.o $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/rawHeader