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
b83b9697
Commit
b83b9697
authored
Jan 12, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ビルドタイプごとに最適化の有無を切り替えるように変更
parent
8b51dbaf
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
15 deletions
+38
-15
common.mk
common.mk
+1
-1
Makefile
example/8cc/Makefile
+10
-5
Makefile
example/fizzbuzz-rs/Makefile
+6
-1
Makefile
example/fizzbuzz/Makefile
+6
-1
Makefile
example/lua/Makefile
+5
-2
Makefile
example/zlib/Makefile
+10
-5
No files found.
common.mk
View file @
b83b9697
.DEFAULT_GOAL := all
.DEFAULT_GOAL := all
BUILD_TYPE :=
debug
BUILD_TYPE :=
release
ROOT := $(realpath ${PWD})
ROOT := $(realpath ${PWD})
CD := $(realpath ${CURDIR})
CD := $(realpath ${CURDIR})
...
...
example/8cc/Makefile
View file @
b83b9697
...
@@ -5,13 +5,18 @@ WATERMARK := 77
...
@@ -5,13 +5,18 @@ WATERMARK := 77
CC
:=
clang
CC
:=
clang
CFLAGS
:=
\
CFLAGS
:=
\
-O2
\
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
\
-DNDEBUG
CFLAGS_debug
:=
-O0
CFLAGS_release
:=
-O2
-DNDEBUG
CFLAGS
+=
${
CFLAGS_
${
BUILD_TYPE
}}
8CCFLAGS
:=
\
8CCFLAGS
:=
\
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
\
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
-DNDEBUG
8CCFLAGS_debug
:=
8CCFLAGS_release
:=
-DNDEBUG
8CCFLAGS
+=
${
8CCFLAGS_
${
BUILD_TYPE
}}
LDFLAGS
:=
\
LDFLAGS
:=
\
-no-pie
-no-pie
...
...
example/fizzbuzz-rs/Makefile
View file @
b83b9697
include
../../common.mk
include
../../common.mk
RUSTFLAGS
:=
RUSTFLAGS_debug
:=
RUSTFLAGS_release
:=
-O
RUSTFLAGS
+=
${
RUSTFLAGS_
${
BUILD_TYPE
}}
LDFLAGS
:=
\
LDFLAGS
:=
\
-pthread
\
-pthread
\
-lbacktrace
\
-lbacktrace
\
...
@@ -16,7 +21,7 @@ ${BIN_DIR}/%.out: ${OBJ_DIR}/%.ll ${OBJ_DIR}/probestack.o
...
@@ -16,7 +21,7 @@ ${BIN_DIR}/%.out: ${OBJ_DIR}/%.ll ${OBJ_DIR}/probestack.o
${OBJ_DIR}/fizzbuzz.ll
:
fizzbuzz.rs
${OBJ_DIR}/fizzbuzz.ll
:
fizzbuzz.rs
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
rustc
-O
-Clto
--emit
=
llvm-ir
-o
$@
$<
rustc
${
RUSTFLAGS
}
-Clto
--emit
=
llvm-ir
-o
$@
$<
${OBJ_DIR}/fizzbuzz-wm.ll
:
${OBJ_DIR}/fizzbuzz.ll
${OBJ_DIR}/fizzbuzz-wm.ll
:
${OBJ_DIR}/fizzbuzz.ll
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
...
...
example/fizzbuzz/Makefile
View file @
b83b9697
include
../../common.mk
include
../../common.mk
CFLAGS
:=
CFLAGS_debug
:=
-O0
CFLAGS_release
:=
-O2
-DNDEBUG
CFLAGS
+=
${
CFLAGS_
${
BUILD_TYPE
}}
SRCS
:=
\
SRCS
:=
\
fizzbuzz.c
fizzbuzz.c
...
@@ -26,7 +31,7 @@ ${BINS}: ${LLS} ${LLS_0} ${LLS_1} ${LLS_2} ${LLS_3}
...
@@ -26,7 +31,7 @@ ${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
-DNDEBUG
-O2
-o
$@
$<
clang
-emit-llvm
-S
${
CFLAGS
}
-o
$@
$<
%-0.ll
:
%.ll
%-0.ll
:
%.ll
opt
-load
=
${
ROOT
}
/bin/
${
BUILD_TYPE
}
/src/nykk.so
-block-wm
-watermark
=
0
-S
-o
$@
$<
2>
${
@
:.ll
=.txt
}
opt
-load
=
${
ROOT
}
/bin/
${
BUILD_TYPE
}
/src/nykk.so
-block-wm
-watermark
=
0
-S
-o
$@
$<
2>
${
@
:.ll
=.txt
}
...
...
example/lua/Makefile
View file @
b83b9697
...
@@ -2,7 +2,10 @@ include ../../common.mk
...
@@ -2,7 +2,10 @@ include ../../common.mk
WATERMARK
:=
lua-watermarking
WATERMARK
:=
lua-watermarking
CFLAGS
:=
-O2
-DNDEBUG
-DLUA_USE_LINUX
CFLAGS
:=
-DLUA_USE_LINUX
CFLAGS_debug
:=
-O0
CFLAGS_release
:=
-O2
-DNDEBUG
CFLAGS
+=
${
CFLAGS_
${
BUILD_TYPE
}}
LDFLAGS
:=
-lm
-ldl
LDFLAGS
:=
-lm
-ldl
SRCS
:=
\
SRCS
:=
\
...
...
example/zlib/Makefile
View file @
b83b9697
...
@@ -6,10 +6,12 @@ CC := clang
...
@@ -6,10 +6,12 @@ CC := clang
CXX
:=
clang++
CXX
:=
clang++
CFLAGS
:=
\
CFLAGS
:=
\
-DNDEBUG
\
-D_LARGEFILE64_SOURCE
=
1
\
-D_LARGEFILE64_SOURCE
=
1
\
-DHAVE_HIDDEN
\
-DHAVE_HIDDEN
-O2
CFLAGS_debug
:=
-O0
CFLAGS_release
:=
-O2
-DNDEBUG
CFLAGS
+=
${
CFLAGS_
${
BUILD_TYPE
}}
CXXFLAGS
:=
\
CXXFLAGS
:=
\
-std
=
c++17
\
-std
=
c++17
\
...
@@ -17,8 +19,11 @@ CXXFLAGS := \
...
@@ -17,8 +19,11 @@ CXXFLAGS := \
-Wextra
\
-Wextra
\
-pedantic
\
-pedantic
\
-Werror
\
-Werror
\
-Izlib
\
-Izlib
-O2
CXXFLAGS_debug
:=
-O0
CXXFLAGS_release
:=
-O2
-DNDEBUG
CXXFLAGS
+=
${
CXXFLAGS_
${
BUILD_TYPE
}}
SRCS
:=
\
SRCS
:=
\
zlib/adler32.c
\
zlib/adler32.c
\
...
...
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