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
924d87de
Commit
924d87de
authored
Nov 21, 2018
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makefileの出力ディレクトリ構造を変更
parent
ec7ff7bf
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
94 additions
and
105 deletions
+94
-105
.dockerignore
.dockerignore
+2
-7
.gitignore
.gitignore
+2
-7
Makefile
Makefile
+9
-39
common.mk
common.mk
+7
-0
cxx.mk
cxx.mk
+37
-0
Makefile
example/Makefile
+3
-7
.gitignore
example/fizzbuzz/.gitignore
+0
-1
Makefile
example/fizzbuzz/Makefile
+21
-19
Makefile
src/Makefile
+7
-0
Makefile
test/Makefile
+6
-25
No files found.
.dockerignore
View file @
924d87de
...
...
@@ -5,10 +5,5 @@
README.md
LICENSE
*.a
*.so
*.o
*.ll
*.s
test_*
bin/
obj/
.gitignore
View file @
924d87de
*.a
*.so
*.o
*.ll
*.s
test_*
bin/
obj/
Makefile
View file @
924d87de
LLVM_INCLUDE_DIRS
:=
$(
shell
llvm-config
--includedir
)
.PHONY
:
all test clean
CXX
:=
g++
all
:
${
MAKE
}
-C
src all
${
MAKE
}
-C
test
all
${
MAKE
}
-C
example all
CXXFLAGS
:=
\
-std
=
c++17
\
-Wall
\
-Wextra
\
-pedantic
\
-Werror
\
${
LLVM_INCLUDE_DIRS
:%
=-I%
}
\
-fPIC
\
-fno-rtti
LDFLAGS
:=
\
$(
shell
llvm-config
--ldflags
)
.PHONY
:
all test example clean
all
:
nykk.so example
test
:
nykk.so
${
MAKE
}
-C
test
run
test
:
${
MAKE
}
-C
src
test
${
MAKE
}
-C
test test
${
MAKE
}
-C
example
test
example
:
nykk.so
${
MAKE
}
-C
example
nykk.so
:
\
src/nykk/pass/TestPass.o
\
src/nykk/pass/BlockCounterPass.o
\
src/nykk/pass/BlockWatermarkPass.o
src/nykk/pass/BlockWatermarkPass.o
:
\
src/nykk/pass/BlockWatermarkPass.cpp
\
src/nykk/PermutationTable.hpp
%.so
:
${
CXX
}
${
CXXFLAGS
}
-shared
-o
$@
$^
${
LDFLAGS
}
clean
:
${
MAKE
}
-C
test
clean
${
MAKE
}
-C
example clean
${
RM
}
*
.so src/
*
/
*
.o src/
*
/
*
/
*
.o
${
RM
}
-r
bin obj
common.mk
0 → 100644
View file @
924d87de
ROOT := $(realpath ${PWD})
CD := $(realpath ${CURDIR})
BIN_DIR := ${ROOT}/bin/${CD:${ROOT}/%=%}
OBJ_DIR := ${ROOT}/obj/${CD:${ROOT}/%=%}
.PHONY: all test clean
cxx.mk
0 → 100644
View file @
924d87de
include ${PWD}/common.mk
LLVM_INCLUDE_DIRS := $(shell llvm-config --includedir)
CXXFLAGS := \
-std=c++17 \
-Wall \
-Wextra \
-pedantic \
-Werror \
$(addprefix -I, $(shell llvm-config --includedir)) \
-fPIC \
-fno-rtti
LDFLAGS := \
$(shell llvm-config --ldflags)
OBJS := ${SRCS:%.cpp=${OBJ_DIR}/%.o}
DEPS := ${OBJS:.o=.d}
all: ${BIN_DIR}/${TARGET}
test: ${BIN_DIR}/${TARGET}
${BIN_DIR}/${TARGET}: ${OBJS}
%.so:
@mkdir -p ${@D}
${CXX} ${CXXFLAGS} -shared -o $@ $^ ${LDFLAGS}
%.out:
@mkdir -p ${@D}
${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS}
${OBJ_DIR}/%.o: %.cpp
@mkdir -p ${@D}
${CXX} ${CXXFLAGS} -o $@ -c $^
example/Makefile
View file @
924d87de
.PHONY
:
all test clean
all
:
${
MAKE
}
-C
fizzbuzz
${
MAKE
}
-C
8cc
${
MAKE
}
-C
fizzbuzz
all
# ${MAKE} -C 8cc all
test
:
${
MAKE
}
-C
fizzbuzz
test
${
MAKE
}
-C
8cc
test
clean
:
${
MAKE
}
-C
fizzbuzz clean
${
MAKE
}
-C
8cc clean
# ${MAKE} -C 8cc test
example/fizzbuzz/.gitignore
deleted
100644 → 0
View file @
ec7ff7bf
*.txt
example/fizzbuzz/Makefile
View file @
924d87de
include
../../common.mk
SRCS
:=
\
fizzbuzz.c
LLS
:=
${
SRCS
:.c
=.ll
}
LLS_0
:=
${
SRCS
:%.c
=%-0.ll
}
LLS_1
:=
${
SRCS
:%.c
=%-1.ll
}
LLS_2
:=
${
SRCS
:%.c
=%-2.ll
}
BINS
:=
${
LLS
:.ll
=
}
${
LLS_0
:.ll
=
}
${
LLS_1
:.ll
=
}
${
LLS_2
:.ll
=
}
.PHONY
:
all test clean
LLS
:=
${
SRCS
:%.c
=
${
OBJ_DIR
}
/%.ll
}
LLS_0
:=
${
LLS
:%.ll
=%-0.ll
}
LLS_1
:=
${
LLS
:%.ll
=%-1.ll
}
LLS_2
:=
${
LLS
:%.ll
=%-2.ll
}
BINS
:=
\
${
LLS
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
${
LLS_0
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
${
LLS_1
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
${
LLS_2
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
all
:
${BINS}
test
:
${BINS}
./fizzbuzz
>
fizzbuzz.txt
./fizzbuzz-0
>
fizzbuzz-0.txt
./fizzbuzz-1
>
fizzbuzz-1.txt
./fizzbuzz-2
>
fizzbuzz-2.txt
for
i
in
${
BINS
}
;
\
do
$$
i
>
$$
i.txt
;
\
done
${BINS}
:
${LLS} ${LLS_0} ${LLS_1} ${LLS_2}
%.ll
:
%.c
${OBJ_DIR}/%.ll
:
%.c
@
mkdir
-p
${
@D
}
clang
-emit-llvm
-S
-O2
-o
$@
$<
%-0.ll
:
%.ll
opt
-load
=
../..
/nykk.so
-block-wm
-watermark
=
0
-S
-o
$@
$<
opt
-load
=
${
ROOT
}
/bin/src
/nykk.so
-block-wm
-watermark
=
0
-S
-o
$@
$<
%-1.ll
:
%.ll
opt
-load
=
../..
/nykk.so
-block-wm
-watermark
=
1
-S
-o
$@
$<
opt
-load
=
${
ROOT
}
/bin/src
/nykk.so
-block-wm
-watermark
=
1
-S
-o
$@
$<
%-2.ll
:
%.ll
opt
-load
=
../..
/nykk.so
-block-wm
-watermark
=
2
-S
-o
$@
$<
opt
-load
=
${
ROOT
}
/bin/src
/nykk.so
-block-wm
-watermark
=
2
-S
-o
$@
$<
%
:
%.ll
${BIN_DIR}/%.out
:
${OBJ_DIR}/%.ll
@
mkdir
-p
${
@D
}
clang
-o
$@
$<
clean
:
${
RM
}
${
BINS
}
*
.ll
*
.txt
src/Makefile
0 → 100644
View file @
924d87de
TARGET
:=
nykk.so
SRCS
:=
\
nykk/pass/BlockCounterPass.cpp
\
nykk/pass/BlockWatermarkPass.cpp
\
nykk/pass/TestPass.cpp
include
../cxx.mk
test/Makefile
View file @
924d87de
CXXFLAGS
:=
\
-std
=
c++17
\
-Wall
\
-Wextra
\
-pedantic
\
-Werror
\
-fPIC
TARGET
:=
test_pass.out
SRCS
:=
\
Test.cpp
LDFLAGS
:=
include
../cxx.mk
.PHONY
:
all run clean
all
:
test_pass
run
:
test_pass
./test_pass
test_pass
:
Test.o
${
CXX
}
${
CXXFLAGS
}
-o
$@
$^
${
LDFLAGS
}
Test.o
:
\
Test.cpp
\
TestPermutationTable.hpp
\
../src/nykk/PermutationTable.hpp
clean
:
${
RM
}
test_pass
*
.o
test
:
${BIN_DIR}/${TARGET}
$<
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