Commit fd351396 authored by nagayama15's avatar nagayama15

Cargoプロジェクトへの電子透かしの埋め込みと埋め込み結果の集計スクリプトを追加

parent f91af3cd
...@@ -6,14 +6,29 @@ LDFLAGS := \ ...@@ -6,14 +6,29 @@ LDFLAGS := \
-ldl \ -ldl \
-ljemalloc -ljemalloc
all: ${BIN_DIR}/numguess.out all: ${BIN_DIR}/numguess.out ${BIN_DIR}/numguess-wm.out
test: ${BIN_DIR}/numguess.out test: ${BIN_DIR}/numguess.out ${BIN_DIR}/numguess-wm.out
clean:: clean::
cargo clean cargo clean
${BIN_DIR}/numguess.out: ${BIN_DIR}/%.out: ${OBJ_DIR}/%.ll ${OBJ_DIR}/probestack.o
@mkdir -p ${@D} @mkdir -p ${@D}
clang -o $@ $^ ${LDFLAGS}
${OBJ_DIR}/numguess.ll: target/release/deps/*.ll
@mkdir -p ${@D}
cp $< $@
target/release/deps/*.ll:
cargo rustc --release -v -- -Clto --emit=llvm-ir cargo rustc --release -v -- -Clto --emit=llvm-ir
clang -o $@ target/release/deps/*.ll probestack.s ${LDFLAGS}
${OBJ_DIR}/numguess-wm.ll: ${OBJ_DIR}/numguess.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 $<
...@@ -50,6 +50,8 @@ echo "==== zlib block-wm ====" ...@@ -50,6 +50,8 @@ echo "==== zlib block-wm ===="
h1 obj/example/zlib/zlib-block-wm/*-block-wm.txt h1 obj/example/zlib/zlib-block-wm/*-block-wm.txt
echo "==== fizzbuzz-rs block-wm ====" echo "==== fizzbuzz-rs block-wm ===="
h1 obj/example/fizzbuzz-rs/*-block-wm.txt h1 obj/example/fizzbuzz-rs/*-block-wm.txt
echo "==== numguess-rs block-wm ===="
h1 obj/example/numguess-rs/*-block-wm.txt
echo "==== 8cc inst-wm ====" echo "==== 8cc inst-wm ===="
h2 obj/example/8cc/stage1-wm/*-inst-wm.txt h2 obj/example/8cc/stage1-wm/*-inst-wm.txt
...@@ -57,3 +59,5 @@ echo "==== zlib inst-wm ====" ...@@ -57,3 +59,5 @@ echo "==== zlib inst-wm ===="
h2 obj/example/zlib/zlib-inst-wm/*-inst-wm.txt h2 obj/example/zlib/zlib-inst-wm/*-inst-wm.txt
echo "==== fizzbuzz-rs inst-wm ====" echo "==== fizzbuzz-rs inst-wm ===="
h2 obj/example/fizzbuzz-rs/*-inst-wm.txt h2 obj/example/fizzbuzz-rs/*-inst-wm.txt
echo "==== numguess-rs inst-wm ===="
h2 obj/example/numguess-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