|
@ -1,5 +1,11 @@ |
|
|
|
|
|
UNAME_S := $(shell uname -s) |
|
|
|
|
|
ifeq ($(UNAME_S),Darwin) |
|
|
|
|
|
# LLVM stupidity: PGO flags, filenames, and process are all incompatible with GCC |
|
|
|
|
|
CC := /opt/local/bin/gcc-mp-12 |
|
|
|
|
|
endif |
|
|
|
|
|
|
|
|
GFLAGS += -Wall -Wno-unused -g |
|
|
GFLAGS += -Wall -Wno-unused -g |
|
|
OFLAGS += $(GFLAGS) -O3 -DNDEBUG |
|
|
|
|
|
|
|
|
OFLAGS += $(GFLAGS) -O3 -DNDEBUG -DTYPECODES=1 -DDELOPT=1 |
|
|
PFLAGS += $(OFLAGS) -pg |
|
|
PFLAGS += $(OFLAGS) -pg |
|
|
CFLAGS += -D_GNU_SOURCE -I/opt/local/include |
|
|
CFLAGS += -D_GNU_SOURCE -I/opt/local/include |
|
|
LDLIBS += -L/opt/local/lib |
|
|
LDLIBS += -L/opt/local/lib |
|
@ -21,6 +27,14 @@ all : $(MAIN) |
|
|
%.c : %.leg |
|
|
%.c : %.leg |
|
|
leg -o $@ $< |
|
|
leg -o $@ $< |
|
|
|
|
|
|
|
|
|
|
|
tests : .FORCE |
|
|
|
|
|
$(MAKE) clean all GFLAGS="-Wno-unused -g -DTYPECODES=1 -DELOPT=1" |
|
|
|
|
|
-./$(MAIN) test.txt > test.out 2>&1 |
|
|
|
|
|
@diff test.ref test.out && echo '\012--- PASSED ---' |
|
|
|
|
|
$(MAKE) clean all GFLAGS="-Wno-unused -g -DTYPECODES=0 -DELOPT=0" |
|
|
|
|
|
-./$(MAIN) test.txt > test.out 2>&1 |
|
|
|
|
|
@diff test.ref test.out && echo '\012--- PASSED ---' |
|
|
|
|
|
|
|
|
test : $(MAIN) |
|
|
test : $(MAIN) |
|
|
./$(MAIN) test.txt 2>&1 | tee test.out |
|
|
./$(MAIN) test.txt 2>&1 | tee test.out |
|
|
@diff test.ref test.out && echo '\012--- PASSED ---' |
|
|
@diff test.ref test.out && echo '\012--- PASSED ---' |
|
@ -45,9 +59,9 @@ profile : $(MAIN)-prof |
|
|
release : .FORCE |
|
|
release : .FORCE |
|
|
rm -f *.gcda |
|
|
rm -f *.gcda |
|
|
$(MAKE) clean all GFLAGS="-DNDEBUG -DTYPECODES=1 -DDELOPT=1 -O3 -fprofile-correction -fprofile-generate" |
|
|
$(MAKE) clean all GFLAGS="-DNDEBUG -DTYPECODES=1 -DDELOPT=1 -O3 -fprofile-correction -fprofile-generate" |
|
|
./$(MAIN) profile-generate.txt profile-generate.txt profile-generate.txt profile-generate.txt |
|
|
|
|
|
|
|
|
./$(MAIN) -O profile-generate.txt profile-generate.txt profile-generate.txt profile-generate.txt |
|
|
$(MAKE) clean all GFLAGS="-DNDEBUG -DTYPECODES=1 -DDELOPT=1 -O3 -fprofile-correction -fprofile-use" |
|
|
$(MAKE) clean all GFLAGS="-DNDEBUG -DTYPECODES=1 -DDELOPT=1 -O3 -fprofile-correction -fprofile-use" |
|
|
./$(MAIN) profile-generate.txt |
|
|
|
|
|
|
|
|
./$(MAIN) -O profile-generate.txt |
|
|
|
|
|
|
|
|
FILES = Makefile $(MAIN).leg bench.txt test.txt test2.txt |
|
|
FILES = Makefile $(MAIN).leg bench.txt test.txt test2.txt |
|
|
|
|
|
|
|
|