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
3c3dfbf4
Commit
3c3dfbf4
authored
Nov 21, 2018
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8ccのMakefileを書き直し
parent
924d87de
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
54 deletions
+49
-54
.gitignore
example/8cc/.gitignore
+0
-2
Makefile
example/8cc/Makefile
+47
-50
Makefile
example/Makefile
+2
-2
No files found.
example/8cc/.gitignore
deleted
100644 → 0
View file @
924d87de
8cc-*
test/
example/8cc/Makefile
View file @
3c3dfbf4
include
../../common.mk
WATERMARK
:=
77
WATERMARK
:=
77
CC
:=
clang
CC
:=
clang
CFLAGS
:=
\
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
LDFLAGS
:=
\
-no-pie
SRCS
:=
\
SRCS
:=
\
8cc/buffer.c
\
8cc/buffer.c
\
8cc/cpp.c
\
8cc/cpp.c
\
...
@@ -20,76 +28,65 @@ SRCS := \
...
@@ -20,76 +28,65 @@ SRCS := \
8cc/vector.c
8cc/vector.c
.PHONY
:
all test clean
.PHONY
:
all test clean
.PRECIOUS
:
${OBJ_DIR}/stage1-wm/%-wm.ll
all
:
stage3 stage3-wm
all
:
stage3 stage3-wm
stage3
:
stage2 8cc-stage3
stage3
:
${BIN_DIR}/stage3/8cc.out
stage2
:
stage1 8cc-stage2
stage2
:
${BIN_DIR}/stage2/8cc.out
stage1
:
8cc-stage1
stage1
:
${BIN_DIR}/stage1/8cc.out
stage3-wm
:
stage2-wm 8cc-stage3-wm
stage3-wm
:
${BIN_DIR}/stage3-wm/8cc.out
stage2-wm
:
stage1-wm 8cc-stage2-wm
stage2-wm
:
${BIN_DIR}/stage2-wm/8cc.out
stage1-wm
:
8cc-stage1-wm
stage1-wm
:
${BIN_DIR}/stage1-wm/8cc.out
# Normal 8cc
${BIN_DIR}/stage1/8cc.out
:
${SRCS:8cc/%.c=${OBJ_DIR}/stage1/%.o}
8cc-stage1
:
${SRCS:8cc/%.c=test/stage1
/%.o}
${BIN_DIR}/stage2/8cc.out
:
${SRCS:8cc/%.c=${OBJ_DIR}/stage2
/%.o}
${
CC
}
-o
$@
$^
-no-pie
${BIN_DIR}/stage3/8cc.out
:
${SRCS:8cc/%.c=${OBJ_DIR}/stage3/%.o}
8cc-stage2
:
${SRCS:8cc/%.c=test/stage2/%.o}
${BIN_DIR}/stage1-wm/8cc.out
:
${SRCS:8cc/%.c=${OBJ_DIR}/stage1-wm/%.o}
${
CC
}
-o
$@
$^
-no-pie
${BIN_DIR}/stage2-wm/8cc.out
:
${SRCS:8cc/%.c=${OBJ_DIR}/stage2-wm/%.o}
${BIN_DIR}/stage3-wm/8cc.out
:
${SRCS:8cc/%.c=${OBJ_DIR}/stage3-wm/%.o}
8cc-stage3
:
${SRCS:8cc/%.c=test/stage3/%.o}
# Normal 8cc.
${
CC
}
-o
$@
$^
-no-pie
${OBJ_DIR}/stage1/%.o
:
8cc/%.c
test/stage1/%.o
:
8cc/%.c
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
${
CC
}
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
-O2
-o
$@
-c
$<
${
CC
}
${
CFLAGS
}
-O2
-o
$@
-c
$<
test/stage2/%.o
:
8cc/%.c 8cc-stage1
${OBJ_DIR}/stage2/%.o
:
8cc/%.c ${BIN_DIR}/stage1/8cc.out
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
./8cc-stage1
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
-w
-o
$@
-c
$<
${
BIN_DIR
}
/stage1/8cc.out
-w
${
CFLAGS
}
-o
$@
-c
$<
test/stage3/%.o
:
8cc/%.c 8cc-stage2
${OBJ_DIR}/stage3/%.o
:
8cc/%.c ${BIN_DIR}/stage2/8cc.out
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
./8cc-stage2
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
-w
-o
$@
-c
$<
${
BIN_DIR
}
/stage2/8cc.out
-w
${
CFLAGS
}
-o
$@
-c
$<
# Watermarked 8cc
# Watermarked 8cc
8cc-stage1-wm
:
${SRCS:8cc/%.c=test/stage1-wm/%.o}
${OBJ_DIR}/stage1-wm/%.o
:
${OBJ_DIR}/stage1-wm/%-wm.ll
${
CC
}
-o
$@
$^
-no-pie
@
mkdir
-p
${
@D
}
${
CC
}
${
CFLAGS
}
-o
$@
-c
$<
8cc-stage2-wm
:
${SRCS:8cc/%.c=test/stage2-wm/%.o}
${
CC
}
-o
$@
$^
-no-pie
8cc-stage3-wm
:
${SRCS:8cc/%.c=test/stage3-wm/%.o}
${
CC
}
-o
$@
$^
-no-pie
test/stage1-wm/%.o
:
test/stage1-wm/%-wm.ll
clang
-o
$@
-c
$<
test/stage1-wm/%-wm.ll
:
test/stage1-wm/%.ll
${OBJ_DIR}/stage1-wm/%-wm.ll
:
8cc/%.c
opt
-load
=
../../nykk.so
-O2
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
$@
$<
2>
${
@
:%.ll
=%-stderr.txt
}
@
mkdir
-p
${
@D
}
clang
${
CFLAGS
}
-O2
-S
-emit-llvm
-o
${
@
:%-wm.ll
=%.ll
}
$<
opt
-load
=
${
ROOT
}
/bin/src/nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-S
-o
$@
${
@
:%-wm.ll
=%.ll
}
2>
${
@
:%-wm.ll
=%-log.txt
}
test/stage1-wm/%.ll
:
8cc/%.c
${OBJ_DIR}/stage2-wm/%.o
:
8cc/%.c ${BIN_DIR}/stage1-wm/8cc.out
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
clang
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
-O2
-o
$@
-emit-llvm
-S
$<
${
BIN_DIR
}
/stage1-wm/8cc.out
-w
${
CFLAGS
}
-o
$@
-c
$<
test/stage2-wm/%.o
:
8cc/%.c 8cc-stage1-wm
${OBJ_DIR}/stage3-wm/%.o
:
8cc/%.c ${BIN_DIR}/stage2-wm/8cc.out
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
./8cc-stage1-wm
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
-w
-o
$@
-c
$<
${
BIN_DIR
}
/stage2-wm/8cc.out
-w
${
CFLAGS
}
-o
$@
-c
$<
test/stage3-wm/%.o
:
8cc/%.c 8cc-stage2-wm
%.out
:
@
mkdir
-p
${
@D
}
@
mkdir
-p
${
@D
}
./8cc-stage2-wm
-DBUILD_DIR
=
"
\"
$$
PWD/8cc
\"
"
-w
-o
$@
-c
$<
${
CC
}
${
CFLAGS
}
-o
$@
$^
${
LDFLAGS
}
test
:
stage3 stage3-wm
test
:
stage3 stage3-wm
objdump
-D
8cc-stage1
>
stage1-asm.s
objdump
-D
-M
intel
${
BIN_DIR
}
/stage1/8cc.out
>
${
BIN_DIR
}
/stage1/8cc.s
objdump
-D
8cc-stage2
>
stage2-asm.s
objdump
-D
-M
intel
${
BIN_DIR
}
/stage2/8cc.out
>
${
BIN_DIR
}
/stage2/8cc.s
objdump
-D
8cc-stage3
>
stage3-asm.s
objdump
-D
-M
intel
${
BIN_DIR
}
/stage3/8cc.out
>
${
BIN_DIR
}
/stage3/8cc.s
objdump
-D
8cc-stage1-wm
>
stage1-wm-asm.s
objdump
-D
-M
intel
${
BIN_DIR
}
/stage1-wm/8cc.out
>
${
BIN_DIR
}
/stage1-wm/8cc.s
objdump
-D
8cc-stage2-wm
>
stage2-wm-asm.s
objdump
-D
-M
intel
${
BIN_DIR
}
/stage2-wm/8cc.out
>
${
BIN_DIR
}
/stage2-wm/8cc.s
objdump
-D
8cc-stage3-wm
>
stage3-wm-asm.s
objdump
-D
-M
intel
${
BIN_DIR
}
/stage3-wm/8cc.out
>
${
BIN_DIR
}
/stage3-wm/8cc.s
.PRECIOUS
:
test/stage1-wm/%.ll test/stage1-wm/%-wm.ll
clean
:
${
RM
}
-r
8cc-
*
test
*
.s
example/Makefile
View file @
3c3dfbf4
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
all
:
all
:
${
MAKE
}
-C
fizzbuzz all
${
MAKE
}
-C
fizzbuzz all
#
${MAKE} -C 8cc all
${
MAKE
}
-C
8cc all
test
:
test
:
${
MAKE
}
-C
fizzbuzz
test
${
MAKE
}
-C
fizzbuzz
test
#
${MAKE} -C 8cc test
${
MAKE
}
-C
8cc
test
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