Tmp = $(HOME)/tmp DESTDIR = $(HOME)/ Bin = $(DESTDIR)bin/wisp model = 1 all: target copy prepare model simplesa cleanup target: @mkdir -p $(Bin) copy: simplesa.c simplesa.h model$(model).c model.h @cp simplesa.c $(Tmp) @cp simplesa.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)/simplesa.h endif ifeq ($(model),2) @sed 's/MITIGATION/31/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),3) @sed 's/MITIGATION/3/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),4) @sed 's/MITIGATION/58/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),5) @sed 's/MITIGATION/99/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),21) @sed 's/MITIGATION/31/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),22) @sed 's/MITIGATION/62/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),24) @sed 's/MITIGATION/124/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),28) @sed 's/MITIGATION/248/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),216) @sed 's/MITIGATION/496/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),41) @sed 's/MITIGATION/58/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),42) @sed 's/MITIGATION/116/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),44) @sed 's/MITIGATION/232/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),48) @sed 's/MITIGATION/464/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),416) @sed 's/MITIGATION/928/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),51) @sed 's/MITIGATION/99/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),52) @sed 's/MITIGATION/198/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),54) @sed 's/MITIGATION/396/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),58) @sed 's/MITIGATION/792/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif ifeq ($(model),516) @sed 's/MITIGATION/1584/' $(Tmp)/rawHeader > $(Tmp)/simplesa.h endif model: $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/simplesa.h @g++ -c $(Tmp)/model.c -o $(Tmp)/model.o ifeq ($(model),21) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa21 @echo "You can run the simplesa21 from folder $(Bin)." endif ifeq ($(model),22) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa22 @echo "You can run the simplesa22 from folder $(Bin)." endif ifeq ($(model),24) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa24 @echo "You can run the simplesa24 from folder $(Bin)." endif ifeq ($(model),28) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa28 @echo "You can run the simplesa28 from folder $(Bin)." endif ifeq ($(model),216) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa216 @echo "You can run the simplesa216 from folder $(Bin)." endif ifeq ($(model),41) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa41 @echo "You can run the simplesa41 from folder $(Bin)." endif ifeq ($(model),42) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa42 @echo "You can run the simplesa42 from folder $(Bin)." endif ifeq ($(model),44) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa44 @echo "You can run the simplesa44 from folder $(Bin)." endif ifeq ($(model),48) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa48 @echo "You can run the simplesa48 from folder $(Bin)." endif ifeq ($(model),416) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa416 @echo "You can run the simplesa416 from folder $(Bin)." endif ifeq ($(model),51) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa51 @echo "You can run the simplesa51 from folder $(Bin)." endif ifeq ($(model),52) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa52 @echo "You can run the simplesa52 from folder $(Bin)." endif ifeq ($(model),54) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa54 @echo "You can run the simplesa54 from folder $(Bin)." endif ifeq ($(model),58) simplesa: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/simplesa.c $(Tmp)/model.o -o $(Bin)/simplesa58 @echo "You can run the simplesa58 from folder $(Bin)." endif cleanup: $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/rawHeader @rm -rf $(Tmp)/simplesa.c $(Tmp)/simplesa.h $(Tmp)/model.o $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/rawHeader