Tmp = $(HOME)/tmp DESTDIR = $(HOME)/ Bin = $(DESTDIR)bin/wisp model = 21 all: target copy prepare model astar cleanup target: @mkdir -p $(Bin) copy: astar.c astar.h model$(model).c model.h @cp astar.c $(Tmp) @cp astar.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)/astar.h endif ifeq ($(model),2) @sed 's/MITIGATION/31/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),3) @sed 's/MITIGATION/3/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),4) @sed 's/MITIGATION/58/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),5) @sed 's/MITIGATION/99/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),21) @sed 's/MITIGATION/31/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),22) @sed 's/MITIGATION/62/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),24) @sed 's/MITIGATION/124/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),28) @sed 's/MITIGATION/248/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),216) @sed 's/MITIGATION/496/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),41) @sed 's/MITIGATION/58/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),42) @sed 's/MITIGATION/116/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),44) @sed 's/MITIGATION/232/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),48) @sed 's/MITIGATION/464/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),416) @sed 's/MITIGATION/928/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),51) @sed 's/MITIGATION/99/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),52) @sed 's/MITIGATION/198/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),54) @sed 's/MITIGATION/396/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),58) @sed 's/MITIGATION/792/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),516) @sed 's/MITIGATION/1584/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif ifeq ($(model),532) @sed 's/MITIGATION/3168/' $(Tmp)/rawHeader > $(Tmp)/astar.h endif model: $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/astar.h @g++ -c $(Tmp)/model.c -o $(Tmp)/model.o ifeq ($(model),21) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar21 @echo "You can run the astar21 from folder $(Bin)." endif ifeq ($(model),22) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar22 @echo "You can run the astar22 from folder $(Bin)." endif ifeq ($(model),24) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar24 @echo "You can run the astar24 from folder $(Bin)." endif ifeq ($(model),28) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar28 @echo "You can run the astar28 from folder $(Bin)." endif ifeq ($(model),216) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar216 @echo "You can run the astar216 from folder $(Bin)." endif ifeq ($(model),41) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar41 @echo "You can run the astar41 from folder $(Bin)." endif ifeq ($(model),42) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar42 @echo "You can run the astar42 from folder $(Bin)." endif ifeq ($(model),44) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar44 @echo "You can run the astar44 from folder $(Bin)." endif ifeq ($(model),48) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar48 @echo "You can run the astar48 from folder $(Bin)." endif ifeq ($(model),416) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar416 @echo "You can run the astar416 from folder $(Bin)." endif ifeq ($(model),51) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar51 @echo "You can run the astar51 from folder $(Bin)." endif ifeq ($(model),52) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar52 @echo "You can run the astar52 from folder $(Bin)." endif ifeq ($(model),54) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar54 @echo "You can run the astar54 from folder $(Bin)." endif ifeq ($(model),58) astar: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Bin) @g++ $(Tmp)/astar.c $(Tmp)/model.o -o $(Bin)/astar58 @echo "You can run the astar58 from folder $(Bin)." endif cleanup: $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/rawHeader @rm -rf $(Tmp)/astar.c $(Tmp)/astar.h $(Tmp)/model.o $(Tmp)/model.c $(Tmp)/model.h $(Tmp)/rawHeader