Commit 0e179726 authored by nagayama15's avatar nagayama15

8ccのMakefileを修正

parent 743e6b62
WATERMARK := 3
WATERMARK := 77
CC := clang
......@@ -43,15 +43,15 @@ stage1-wm: 8cc-stage1-wm
test/stage1/%.o: 8cc/%.c
@mkdir -p ${@D}
${CC} -DBUILD_DIR='"${PWD}/8cc"' -O2 -o $@ -c $<
${CC} -DBUILD_DIR="\"$$PWD/8cc\"" -O2 -o $@ -c $<
test/stage2/%.o: 8cc/%.c 8cc-stage1
@mkdir -p ${@D}
./8cc-stage1 -DBUILD_DIR='"${PWD}/8cc"' -w -o $@ -c $<
./8cc-stage1 -DBUILD_DIR="\"$$PWD/8cc\"" -w -o $@ -c $<
test/stage3/%.o: 8cc/%.c 8cc-stage2
@mkdir -p ${@D}
./8cc-stage2 -DBUILD_DIR='"${PWD}/8cc"' -w -o $@ -c $<
./8cc-stage2 -DBUILD_DIR="\"$$PWD/8cc\"" -w -o $@ -c $<
# Watermarked 8cc
8cc-stage1-wm: ${SRCS:8cc/%.c=test/stage1-wm/%.o}
......@@ -67,19 +67,19 @@ test/stage1-wm/%.o: test/stage1-wm/%-wm.ll
clang -o $@ -c $<
test/stage1-wm/%-wm.ll: test/stage1-wm/%.ll
opt-6.0 -load ../../nykk.so -block-wm -watermark=${WATERMARK} -o $@ $< 2> ${@:%.ll=%-stderr.txt}
opt-6.0 -load ../../nykk.so -O2 -block-wm -watermark=${WATERMARK} -S -o $@ $< 2> ${@:%.ll=%-stderr.txt}
test/stage1-wm/%.ll: 8cc/%.c
@mkdir -p ${@D}
clang -DBUILD_DIR='"${PWD}/8cc"' -O2 -o $@ -emit-llvm -S $<
clang -DBUILD_DIR="\"$$PWD/8cc\"" -O2 -o $@ -emit-llvm -S $<
test/stage2-wm/%.o: 8cc/%.c 8cc-stage1-wm
@mkdir -p ${@D}
./8cc-stage1-wm -DBUILD_DIR='"${PWD}/8cc"' -w -o $@ -c $<
./8cc-stage1-wm -DBUILD_DIR="\"$$PWD/8cc\"" -w -o $@ -c $<
test/stage3-wm/%.o: 8cc/%.c 8cc-stage2-wm
@mkdir -p ${@D}
./8cc-stage2-wm -DBUILD_DIR='"${PWD}/8cc"' -w -o $@ -c $<
./8cc-stage2-wm -DBUILD_DIR="\"$$PWD/8cc\"" -w -o $@ -c $<
test: stage3 stage3-wm
objdump -D 8cc-stage1 > stage1.s
......@@ -89,5 +89,7 @@ test: stage3 stage3-wm
objdump -D 8cc-stage2-wm > stage2-wm.s
objdump -D 8cc-stage3-wm > stage3-wm.s
.PRECIOUS: test/stage1-wm/%.ll test/stage1-wm/%-wm.ll
clean:
${RM} -r 8cc-* test *.s
......@@ -2,9 +2,12 @@
all:
${MAKE} -C fizzbuzz
${MAKE} -C 8cc
test:
${MAKE} -C fizzbuzz test
${MAKE} -C 8cc test
clean:
${MAKE} -C fizzbuzz clean
${MAKE} -C 8cc clean
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment