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
4738cf65
Commit
4738cf65
authored
Nov 18, 2018
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8ccの3ステージブートストラップテストを実装
parent
bed7989b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
0 deletions
+93
-0
.gitignore
example/8cc/.gitignore
+2
-0
Makefile
example/8cc/Makefile
+91
-0
No files found.
example/8cc/.gitignore
0 → 100644
View file @
4738cf65
8cc-*
test/
example/8cc/Makefile
0 → 100644
View file @
4738cf65
WATERMARK
:=
0
CC
:=
clang
SRCS
:=
\
8cc/buffer.c
\
8cc/cpp.c
\
8cc/debug.c
\
8cc/dict.c
\
8cc/encoding.c
\
8cc/error.c
\
8cc/file.c
\
8cc/gen.c
\
8cc/lex.c
\
8cc/main.c
\
8cc/map.c
\
8cc/parse.c
\
8cc/path.c
\
8cc/set.c
\
8cc/vector.c
.PHONY
:
all test clean
all
:
stage3 stage3-wm
stage3
:
stage2 8cc-stage3
stage2
:
stage1 8cc-stage2
stage1
:
8cc-stage1
stage3-wm
:
stage2-wm 8cc-stage3-wm
stage2-wm
:
stage1-wm 8cc-stage2-wm
stage1-wm
:
8cc-stage1-wm
# Normal 8cc
8cc-stage1
:
${SRCS:8cc/%.c=test/stage1/%.o}
${
CC
}
-o
$@
$^
-no-pie
8cc-stage2
:
${SRCS:8cc/%.c=test/stage2/%.o}
${
CC
}
-o
$@
$^
-no-pie
8cc-stage3
:
${SRCS:8cc/%.c=test/stage3/%.o}
${
CC
}
-o
$@
$^
-no-pie
test/stage1/%.o
:
8cc/%.c
@
mkdir
-p
${
@D
}
${
CC
}
-DBUILD_DIR
=
'"${PWD}/8cc"'
-o
$@
-c
$<
test/stage2/%.o
:
8cc/%.c 8cc-stage1
@
mkdir
-p
${
@D
}
./8cc-stage1
-DBUILD_DIR
=
'"${PWD}/8cc"'
-w
-o
$@
-c
$<
test/stage3/%.o
:
8cc/%.c 8cc-stage2
@
mkdir
-p
${
@D
}
./8cc-stage2
-DBUILD_DIR
=
'"${PWD}/8cc"'
-w
-o
$@
-c
$<
# Watermarked 8cc
8cc-stage1-wm
:
${SRCS:8cc/%.c=test/stage1-wm/%.o}
${
CC
}
-o
$@
$^
-no-pie
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
opt-6.0
-load
../../nykk.so
-block-wm
-watermark
=
${
WATERMARK
}
-o
$@
$<
2>
${
@
:%.ll
=%-stderr.txt
}
test/stage1-wm/%.ll
:
8cc/%.c
@
mkdir
-p
${
@D
}
clang
-DBUILD_DIR
=
'"${PWD}/8cc"'
-o
$@
-emit-llvm
-S
$<
test/stage2-wm/%.o
:
8cc/%.c 8cc-stage1-wm
@
mkdir
-p
${
@D
}
./8cc-stage1-wm
-DBUILD_DIR
=
'"${PWD}/8cc"'
-w
-o
$@
-c
$<
test/stage3-wm/%.o
:
8cc/%.c 8cc-stage2-wm
@
mkdir
-p
${
@D
}
./8cc-stage2-wm
-DBUILD_DIR
=
'"${PWD}/8cc"'
-w
-o
$@
-c
$<
test
:
stage3 stage3-wm
objdump
-D
8cc-stage2
>
stage2.s
objdump
-D
8cc-stage3
>
stage3.s
objdump
-D
8cc-stage2-wm
>
stage2-wm.s
objdump
-D
8cc-stage3-wm
>
stage3-wm.s
clean
:
${
RM
}
-r
8cc-
*
test
*
.s
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