Tmp = $(HOME)/tmp DESTDIR = $(HOME)/ Bin = $(DESTDIR)bin/wisp model = 1 all: target copy prepare model tool cleanup target: @mkdir -p $(Bin) copy: tool.c tool.h model$(model).c model.h @cp tool.c $(Tmp) @cp tool.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)/tool.h endif ifeq ($(model),2) @sed 's/MITIGATION/31/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),3) @sed 's/MITIGATION/3/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),4) @sed 's/MITIGATION/58/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),5) @sed 's/MITIGATION/99/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),21) @sed 's/MITIGATION/31/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),22) @sed 's/MITIGATION/62/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),24) @sed 's/MITIGATION/124/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),28) @sed 's/MITIGATION/248/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),216) @sed 's/MITIGATION/496/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),41) @sed 's/MITIGATION/58/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),42) @sed 's/MITIGATION/116/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),44) @sed 's/MITIGATION/232/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),48) @sed 's/MITIGATION/464/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),416) @sed 's/MITIGATION/928/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),51) @sed 's/MITIGATION/99/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),52) @sed 's/MITIGATION/198/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),54) @sed 's/MITIGATION/396/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),58) @sed 's/MITIGATION/792/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),516) @sed 's/MITIGATION/1584/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),532) @sed 's/MITIGATION/3168/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),564) @sed 's/MITIGATION/6336/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif ifeq ($(model),5128) @sed 's/MITIGATION/12672/' $(Tmp)/rawHeader > $(Tmp)/tool.h endif model: $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/tool.h @g++ -c $(Tmp)/model.c -o $(Tmp)/model.o ifeq ($(model),21) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool21 @echo "You can run the tool21 from folder $(Bin)." endif ifeq ($(model),22) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool22 @echo "You can run the tool22 from folder $(Bin)." endif ifeq ($(model),24) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool24 @echo "You can run the tool24 from folder $(Bin)." endif ifeq ($(model),28) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool28 @echo "You can run the tool28 from folder $(Bin)." endif ifeq ($(model),216) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool216 @echo "You can run the tool216 from folder $(Bin)." endif ifeq ($(model),41) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool41 @echo "You can run the tool41 from folder $(Bin)." endif ifeq ($(model),42) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool42 @echo "You can run the tool42 from folder $(Bin)." endif ifeq ($(model),44) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool44 @echo "You can run the tool44 from folder $(Bin)." endif ifeq ($(model),48) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool48 @echo "You can run the tool48 from folder $(Bin)." endif ifeq ($(model),416) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool416 @echo "You can run the tool416 from folder $(Bin)." endif ifeq ($(model),51) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool51 @echo "You can run the tool51 from folder $(Bin)." endif ifeq ($(model),52) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool52 @echo "You can run the tool52 from folder $(Bin)." endif ifeq ($(model),54) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool54 @echo "You can run the tool54 from folder $(Bin)." endif ifeq ($(model),58) tool: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/tool.c $(Tmp)/model.o -o $(Bin)/tool58 @echo "You can run the tool58 from folder $(Bin)." endif cleanup: $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/rawHeader @rm -rf $(Tmp)/tool.c $(Tmp)/tool.h $(Tmp)/model.o $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/rawHeader