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
Show 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 @@
...
@@ -5,10 +5,5 @@
README.md
README.md
LICENSE
LICENSE
*.a
bin/
*.so
obj/
*.o
*.ll
*.s
test_*
.gitignore
View file @
924d87de
*.a
bin/
*.so
obj/
*.o
*.ll
*.s
test_*
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
:=
\
test
:
-std
=
c++17
\
${
MAKE
}
-C
src
test
-Wall
\
${
MAKE
}
-C
test test
-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
${
MAKE
}
-C
example
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
:
clean
:
${
MAKE
}
-C
test
clean
${
RM
}
-r
bin obj
${
MAKE
}
-C
example clean
${
RM
}
*
.so src/
*
/
*
.o src/
*
/
*
/
*
.o
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
.PHONY
:
all test clean
all
:
all
:
${
MAKE
}
-C
fizzbuzz
${
MAKE
}
-C
fizzbuzz
all
${
MAKE
}
-C
8cc
# ${MAKE} -C 8cc all
test
:
test
:
${
MAKE
}
-C
fizzbuzz
test
${
MAKE
}
-C
fizzbuzz
test
${
MAKE
}
-C
8cc
test
# ${MAKE} -C 8cc test
clean
:
${
MAKE
}
-C
fizzbuzz clean
${
MAKE
}
-C
8cc clean
example/fizzbuzz/.gitignore
deleted
100644 → 0
View file @
ec7ff7bf
*.txt
example/fizzbuzz/Makefile
View file @
924d87de
include
../../common.mk
SRCS
:=
\
SRCS
:=
\
fizzbuzz.c
fizzbuzz.c
LLS
:=
${
SRCS
:.c
=.ll
}
LLS
:=
${
SRCS
:%.c
=
${
OBJ_DIR
}
/%.ll
}
LLS_0
:=
${
SRCS
:%.c
=%-0.ll
}
LLS_0
:=
${
LLS
:%.ll
=%-0.ll
}
LLS_1
:=
${
SRCS
:%.c
=%-1.ll
}
LLS_1
:=
${
LLS
:%.ll
=%-1.ll
}
LLS_2
:=
${
SRCS
:%.c
=%-2.ll
}
LLS_2
:=
${
LLS
:%.ll
=%-2.ll
}
BINS
:=
${
LLS
:.ll
=
}
${
LLS_0
:.ll
=
}
${
LLS_1
:.ll
=
}
${
LLS_2
:.ll
=
}
BINS
:=
\
${
LLS
:
${
OBJ_DIR
}
/%.ll=
${
BIN_DIR
}
/%.out
}
\
.PHONY
:
all test clean
${
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}
all
:
${BINS}
test
:
${BINS}
test
:
${BINS}
./fizzbuzz
>
fizzbuzz.txt
for
i
in
${
BINS
}
;
\
./fizzbuzz-0
>
fizzbuzz-0.txt
do
$$
i
>
$$
i.txt
;
\
./fizzbuzz-1
>
fizzbuzz-1.txt
done
./fizzbuzz-2
>
fizzbuzz-2.txt
${BINS}
:
${LLS} ${LLS_0} ${LLS_1} ${LLS_2}
${BINS}
:
${LLS} ${LLS_0} ${LLS_1} ${LLS_2}
%.ll
:
%.c
${OBJ_DIR}/%.ll
:
%.c
@
mkdir
-p
${
@D
}
clang
-emit-llvm
-S
-O2
-o
$@
$<
clang
-emit-llvm
-S
-O2
-o
$@
$<
%-0.ll
:
%.ll
%-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
%-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
%-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
$@
$<
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
:=
\
TARGET
:=
test_pass.out
-std
=
c++17
\
SRCS
:=
\
-Wall
\
Test.cpp
-Wextra
\
-pedantic
\
-Werror
\
-fPIC
LDFLAGS
:=
include
../cxx.mk
.PHONY
:
all run clean
test
:
${BIN_DIR}/${TARGET}
$<
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
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