Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
llvm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
llvm-watermarker
Commits
9bc6505e
Commit
9bc6505e
authored
Dec 14, 2018
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update makefiles.
parent
17870007
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
21 deletions
+27
-21
Makefile
example/8cc/Makefile
+3
-2
Makefile
example/fizzbuzz/Makefile
+9
-5
Makefile
example/zlib/Makefile
+12
-11
aggregate.zsh
scripts/aggregate.zsh
+3
-3
No files found.
example/8cc/Makefile
View file @
9bc6505e
...
@@ -68,8 +68,9 @@ ${OBJ_DIR}/stage3/%.o: 8cc/%.c ${BIN_DIR}/stage2/8cc.out
...
@@ -68,8 +68,9 @@ ${OBJ_DIR}/stage3/%.o: 8cc/%.c ${BIN_DIR}/stage2/8cc.out
${OBJ_DIR}/stage1-wm/%.o
:
8cc/%.c
${OBJ_DIR}/stage1-wm/%.o
:
8cc/%.c
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
clang
${
CFLAGS
}
-S
-emit-llvm
-o
${
@
:%.o
=%.ll
}
$<
clang
${
CFLAGS
}
-S
-emit-llvm
-o
${
@
:%.o
=%.ll
}
$<
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-wm.ll
}
${
@
:%.o
=%.ll
}
2>
${
@
:%.o
=%-log.txt
}
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-block-wm.ll
}
${
@
:%.o
=%.ll
}
2>
${
@
:%.o
=%-block-wm.txt
}
clang
${
CFLAGS
}
-o
$@
-c
${
@
:%.o
=%-wm.ll
}
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-inst-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-inst-wm.ll
}
${
@
:%.o
=%-block-wm.ll
}
2>
${
@
:%.o
=%-inst-wm.txt
}
clang
${
CFLAGS
}
-o
$@
-c
${
@
:%.o
=%-inst-wm.ll
}
${OBJ_DIR}/stage2-wm/%.o
:
8cc/%.c ${BIN_DIR}/stage1-wm/8cc.out
${OBJ_DIR}/stage2-wm/%.o
:
8cc/%.c ${BIN_DIR}/stage1-wm/8cc.out
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
...
...
example/fizzbuzz/Makefile
View file @
9bc6505e
...
@@ -7,11 +7,13 @@ LLS := ${SRCS:%.c=${OBJ_DIR}/%.ll}
...
@@ -7,11 +7,13 @@ LLS := ${SRCS:%.c=${OBJ_DIR}/%.ll}
LLS_0
:=
${
LLS
:%.ll
=%-0.ll
}
LLS_0
:=
${
LLS
:%.ll
=%-0.ll
}
LLS_1
:=
${
LLS
:%.ll
=%-1.ll
}
LLS_1
:=
${
LLS
:%.ll
=%-1.ll
}
LLS_2
:=
${
LLS
:%.ll
=%-2.ll
}
LLS_2
:=
${
LLS
:%.ll
=%-2.ll
}
LLS_3
:=
${
LLS
:%.ll
=%-3.ll
}
BINS
:=
\
BINS
:=
\
${
LLS
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
${
LLS
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
${
LLS_0
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
${
LLS_0
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
${
LLS_1
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
${
LLS_1
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
${
LLS_2
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
${
LLS_2
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
${
LLS_3
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
all
:
${BINS}
all
:
${BINS}
...
@@ -20,18 +22,20 @@ test: ${BINS}
...
@@ -20,18 +22,20 @@ test: ${BINS}
do
$$
i
>
$$
i.txt
;
\
do
$$
i
>
$$
i.txt
;
\
done
done
${BINS}
:
${LLS} ${LLS_0} ${LLS_1} ${LLS_2}
${BINS}
:
${LLS} ${LLS_0} ${LLS_1} ${LLS_2}
${LLS_3}
${OBJ_DIR}/%.ll
:
%.c
${OBJ_DIR}/%.ll
:
%.c
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
clang
-emit-llvm
-S
-O2
-o
$@
$<
clang
-emit-llvm
-S
-O2
-o
$@
$<
%-0.ll
:
%.ll
%-0.ll
:
%.ll
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
0
-S
-o
$@
$<
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
0
-S
-o
$@
$<
2>
${
@
:.ll
=.txt
}
%-1.ll
:
%.ll
%-1.ll
:
%.ll
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
1
-S
-o
$@
$<
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
1
-S
-o
$@
$<
2>
${
@
:.ll
=.txt
}
%-2.ll
:
%.ll
%-2.ll
:
%.ll
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
2
-S
-o
$@
$<
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-inst-wm
-watermark
=
2
-S
-o
$@
$<
2>
${
@
:.ll
=.txt
}
%-3.ll
:
%.ll
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-inst-wm
-watermark
=
3
-S
-o
$@
$<
2>
${
@
:.ll
=.txt
}
${BIN_DIR}/%.out
:
${OBJ_DIR}/%.ll
${BIN_DIR}/%.out
:
${OBJ_DIR}/%.ll
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
...
...
example/zlib/Makefile
View file @
9bc6505e
...
@@ -37,36 +37,37 @@ SRCS := \
...
@@ -37,36 +37,37 @@ SRCS := \
zlib/zutil.c
zlib/zutil.c
OBJS
:=
${
SRCS
:zlib/%.c
=
${
OBJ_DIR
}
/zlib/%.o
}
OBJS
:=
${
SRCS
:zlib/%.c
=
${
OBJ_DIR
}
/zlib/%.o
}
OBJS_WM
:=
${
SRCS
:zlib/%.c
=
${
OBJ_DIR
}
/zlib-
${
WATERMARK
}
/%.o
}
OBJS_WM
:=
${
SRCS
:zlib/%.c
=
${
OBJ_DIR
}
/zlib-
wm
/%.o
}
.PHONY
:
all test
.PHONY
:
all test
all
:
\
all
:
\
${BIN_DIR}/libz.a
\
${BIN_DIR}/libz.a
\
${BIN_DIR}/libz-
${WATERMARK}
.a
\
${BIN_DIR}/libz-
wm
.a
\
${BIN_DIR}/test
\
${BIN_DIR}/test
\
${BIN_DIR}/test-
${WATERMARK}
${BIN_DIR}/test-
wm
test
:
\
test
:
\
${BIN_DIR}/libz.a
\
${BIN_DIR}/libz.a
\
${BIN_DIR}/libz-
${WATERMARK}
.a
\
${BIN_DIR}/libz-
wm
.a
\
${BIN_DIR}/test
\
${BIN_DIR}/test
\
${BIN_DIR}/test-
${WATERMARK}
${BIN_DIR}/test-
wm
${BIN_DIR}/libz.a
:
${OBJS}
${BIN_DIR}/libz.a
:
${OBJS}
${BIN_DIR}/libz-
${WATERMARK}
.a
:
${OBJS_WM}
${BIN_DIR}/libz-
wm
.a
:
${OBJS_WM}
${BIN_DIR}/test
:
${OBJ_DIR}/test.o ${BIN_DIR}/libz.a
${BIN_DIR}/test
:
${OBJ_DIR}/test.o ${BIN_DIR}/libz.a
${BIN_DIR}/test-
${WATERMARK}
:
${OBJ_DIR}/test.o ${BIN_DIR}/libz-${WATERMARK}
.a
${BIN_DIR}/test-
wm
:
${OBJ_DIR}/test.o ${BIN_DIR}/libz-wm
.a
${OBJ_DIR}/zlib/%.o
:
zlib/%.c
${OBJ_DIR}/zlib/%.o
:
zlib/%.c
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
${
CC
}
${
CFLAGS
}
-o
$@
-c
$<
${
CC
}
${
CFLAGS
}
-o
$@
-c
$<
${OBJ_DIR}/zlib-
${WATERMARK}
/%.o
:
zlib/%.c
${OBJ_DIR}/zlib-
wm
/%.o
:
zlib/%.c
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
clang
${
CFLAGS
}
-emit-llvm
-S
-o
${
@
:.o
=.ll
}
$<
clang
${
CFLAGS
}
-emit-llvm
-S
-o
${
@
:.o
=.ll
}
$<
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-
${
WATERMARK
}
.ll
}
${
@
:.o
=.ll
}
2>
${
@
:%.o
=%-log.txt
}
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-block-wm.ll
}
${
@
:.o
=.ll
}
2>
${
@
:%.o
=%-block-wm.txt
}
clang
${
CFLAGS
}
-o
$@
-c
${
@
:%.o
=%-
${
WATERMARK
}
.ll
}
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
${
@
:%.o
=%-inst-wm.ll
}
${
@
:.o
=-block-wm.ll
}
2>
${
@
:%.o
=%-inst-wm.txt
}
clang
${
CFLAGS
}
-o
$@
-c
${
@
:%.o
=%-inst-wm.ll
}
${OBJ_DIR}/test.o
:
test.cpp
${OBJ_DIR}/test.o
:
test.cpp
${
CXX
}
${
CXXFLAGS
}
-o
$@
-c
$<
${
CXX
}
${
CXXFLAGS
}
-o
$@
-c
$<
...
@@ -74,7 +75,7 @@ ${OBJ_DIR}/test.o: test.cpp
...
@@ -74,7 +75,7 @@ ${OBJ_DIR}/test.o: test.cpp
${BIN_DIR}/test
:
${BIN_DIR}/test
:
${
CXX
}
${
CXXFLAGS
}
-o
$@
$^
${
LDFLAGS
}
${
CXX
}
${
CXXFLAGS
}
-o
$@
$^
${
LDFLAGS
}
${BIN_DIR}/test-
${WATERMARK}
:
${BIN_DIR}/test-
wm
:
${
CXX
}
${
CXXFLAGS
}
-o
$@
$^
${
LDFLAGS
}
${
CXX
}
${
CXXFLAGS
}
-o
$@
$^
${
LDFLAGS
}
%.a
:
%.a
:
...
...
scripts/aggregate.zsh
View file @
9bc6505e
#!/bin/zsh
#!/bin/zsh
g
()
{
g
()
{
FILE
=
$(
basename
${
1
/-
log
.txt/.c
})
FILE
=
$(
basename
${
1
/-
block-wm
.txt/.c
})
FUNCS
=
$(
tail
-n
+2
$1
|
wc
-l
)
FUNCS
=
$(
tail
-n
+2
$1
|
wc
-l
)
BLOCKS
=
$(
tail
-n
+2
$1
|
awk
'{a+=$2} END {print a}'
)
BLOCKS
=
$(
tail
-n
+2
$1
|
awk
'{a+=$2} END {print a}'
)
BITS
=
$(
tail
-n
+2
$1
|
awk
'{a+=$3} END {print a}'
)
BITS
=
$(
tail
-n
+2
$1
|
awk
'{a+=$3} END {print a}'
)
...
@@ -22,5 +22,5 @@ h() {
...
@@ -22,5 +22,5 @@ h() {
echo
"
$R
"
|
awk
'{f++; a+=$2; b+=$3; c+=$4} END {print "files: " f ", funcs: " a ", blocks: " b ", bits: " c}'
echo
"
$R
"
|
awk
'{f++; a+=$2; b+=$3; c+=$4} END {print "files: " f ", funcs: " a ", blocks: " b ", bits: " c}'
}
}
h obj/example/8cc/stage1-wm/
*
-
log
.txt
h obj/example/8cc/stage1-wm/
*
-
block-wm
.txt
h obj/example/zlib/zlib-
77/
*
-log
.txt
h obj/example/zlib/zlib-
wm/
*
-block-wm
.txt
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment