37 lines
1.2 KiB
Makefile
37 lines
1.2 KiB
Makefile
TEE :=
|
|
|
|
GCC_FLAGS := -g -O0 -Wall
|
|
|
|
run: it1 it2
|
|
|
|
it0:
|
|
echo "Hand made"
|
|
|
|
it1:
|
|
cat it1-in.lang0 | python3 it0-out.py $(if $(TEE),| tee,> ) it1-out0.py
|
|
|
|
cat it1-in.lang0 | python3 it1-out0.py $(if $(TEE),| tee,> ) it1-out1.py
|
|
diff it1-out0.py it1-out1.py > it1-out1.diff
|
|
cat it1-in.lang0 | python3 it1-out1.py $(if $(TEE),| tee,> ) it1-out2.py
|
|
diff it1-out1.py it1-out2.py > it1-out2.diff
|
|
cat it1-in.lang0 | python3 it1-out2.py $(if $(TEE),| tee,> ) it1-out.py
|
|
diff it1-out2.py it1-out.py > it1-out.diff
|
|
|
|
# See how much our hand written code differs from resulting code
|
|
-diff it0-out.py it1-out0.py > it0-out0.diff
|
|
|
|
it2: it1
|
|
cat it2-in.lang0 | python3 it1-out.py $(if $(TEE),| tee,> ) it2-out0.py
|
|
|
|
cat it2-in.lang0 | python3 it2-out0.py $(if $(TEE),| tee,> ) it2-out1.c && gcc it2-out1.c -o it2-out1 $(GCC_FLAGS)
|
|
# diff it2-out0.c it2-out1.c > it2-out1.diff
|
|
cat it2-in.lang0 | ./it2-out1 $(if $(TEE),| tee,> ) it2-out2.c && gcc it2-out2.c -o it2-out2 $(GCC_FLAGS)
|
|
diff it2-out1.c it2-out2.c > it2-out2.diff
|
|
cat it2-in.lang0 | ./it2-out2 $(if $(TEE),| tee,> ) it2-out.c && gcc it2-out.c -o it2-out $(GCC_FLAGS)
|
|
diff it2-out2.c it2-out.c > it2-out.diff
|
|
|
|
clean:
|
|
-rm it1-out* it2-out*
|
|
|
|
.PHONY: it2
|