Commit f91af3cd authored by nagayama15's avatar nagayama15

Rustで書かれたFizzBuzzへの透かし埋め込みと結果の集計スクリプトを追加

parent 7a62cba8
......@@ -6,9 +6,11 @@ LDFLAGS := \
-ldl \
-ljemalloc
all: ${BIN_DIR}/fizzbuzz.out #${BIN_DIR}/fizzbuzz-wm.out
all: ${BIN_DIR}/fizzbuzz.out ${BIN_DIR}/fizzbuzz-wm.out
${BIN_DIR}/fizzbuzz.out: ${OBJ_DIR}/fizzbuzz.ll ${OBJ_DIR}/probestack.o
test: ${BIN_DIR}/fizzbuzz.out ${BIN_DIR}/fizzbuzz-wm.out
${BIN_DIR}/%.out: ${OBJ_DIR}/%.ll ${OBJ_DIR}/probestack.o
@mkdir -p ${@D}
clang -o $@ $^ ${LDFLAGS}
......@@ -16,6 +18,11 @@ ${OBJ_DIR}/fizzbuzz.ll: fizzbuzz.rs
@mkdir -p ${@D}
rustc -O -Clto --emit=llvm-ir -o $@ $<
${OBJ_DIR}/fizzbuzz-wm.ll: ${OBJ_DIR}/fizzbuzz.ll
@mkdir -p ${@D}
opt -load=${ROOT}/bin/src/nykk.so -block-wm -watermark=rust-project -S -o ${@:%-wm.ll=%-block.ll} $< 2> ${@:%-wm.ll=%-block-wm.txt}
opt -load=${ROOT}/bin/src/nykk.so -inst-wm -watermark=rust-project -S -o $@ ${@:%-wm.ll=%-block.ll} 2> ${@:%-wm.ll=%-inst-wm.txt}
${OBJ_DIR}/probestack.o: probestack.s
@mkdir -p ${@D}
clang -o $@ -c $<
......@@ -48,8 +48,12 @@ echo "==== 8cc block-wm ===="
h1 obj/example/8cc/stage1-wm/*-block-wm.txt
echo "==== zlib block-wm ===="
h1 obj/example/zlib/zlib-block-wm/*-block-wm.txt
echo "==== fizzbuzz-rs block-wm ===="
h1 obj/example/fizzbuzz-rs/*-block-wm.txt
echo "==== 8cc inst-wm ===="
h2 obj/example/8cc/stage1-wm/*-inst-wm.txt
echo "==== zlib inst-wm ===="
h2 obj/example/zlib/zlib-inst-wm/*-inst-wm.txt
echo "==== fizzbuzz-rs inst-wm ===="
h2 obj/example/fizzbuzz-rs/*-inst-wm.txt
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