forked from pointless-lang/pointless
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
129 lines (95 loc) · 3.16 KB
/
makefile
File metadata and controls
129 lines (95 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# development: make -j12 dev
CC = gcc
CFLAGS = -I. -Wall -Wextra -O0 -std=gnu11 -g -Wstrict-prototypes
LIBDIR = "/usr/share/pointless"
SRC = $(wildcard tokenizer/*.c) \
$(wildcard parser/*.c) \
$(wildcard compiler/*.c) \
$(wildcard vm/*.c) \
$(wildcard files/*.c) \
$(wildcard error/*.c) \
DEPS = makefile
VM = vm/*
COMPILER = compiler/*
PARSER = parser/*
TOKENIZER = tokenizer/*
ERROR = error/*
FILES = files/*
.PHONY: all
all:
$(MAKE) clean
$(MAKE) dev
$(MAKE) test
.PHONY: dev
dev: debug/tokenize \
debug/highlight \
debug/parse \
debug/annotate \
debug/compile \
debug/run
.PHONY: opt
opt: CFLAGS += -O3
opt: pointless
.PHONY: clean
clean:
rm bin/*.o
.PHONY: test
test: SHELL:=/bin/bash
test:
-tests/runTests.sh --test debug/tokenize tests/tokenizer/*.test
-tests/runTests.sh --test debug/parse tests/parser/*.test
-tests/runTests.sh --test debug/annotate tests/annotator/*.test
-tests/runTests.sh --test debug/compile tests/compiler/*.test
-tests/runTests.sh --test debug/run tests/vm/*.test
.PHONY: install
install:
mkdir -p $(LIBDIR)
cp -r lib $(LIBDIR)
cp pointless /usr/bin
bin/files.o: files/files.c $(FILES) $(PARSER) $(TOKENIZER) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS) -DLIBDIR='$(LIBDIR)'
bin/error.o: error/error.c $(ERROR) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/token.o: tokenizer/*.c $(TOKENIZER) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/tokenizer.o: tokenizer/tokenizer.c $(TOKENIZER) $(ERROR) $(FILES) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/ASTNode.o: parser/ASTNode.c $(PARSER) $(TOKENIZER) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/convertNum.o: parser/convertNum.c $(PARSER) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/showNode.o: parser/showNode.c $(PARSER) $(TOKENIZER) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/parserFuncs.o: parser/parserFuncs.c $(PARSER) $(TOKENIZER) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/parser.o: parser/parser.c $(PARSER) $(TOKENIZER) $(ERROR) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/lexScope.o: compiler/lexScope.c $(COMPILER) $(PARSER) $(ERROR) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/annotate.o: compiler/annotate.c $(COMPILER) $(PARSER) $(ERROR) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/text.o: compiler/text.c $(PARSER) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/showInstructions.o: compiler/showInstructions.c $(COMPILER) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/compiler.o: compiler/compiler.c $(COMPILER) $(PARSER) $(TOKENIZER) $(ERROR) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
bin/map.o: vm/map.c
$(CC) -c $< -o $@ $(CFLAGS)
bin/vm.o: vm/vm.c $(VM) $(COMPILER) $(PARSER) $(ERROR) $(DEPS)
$(CC) -c $< -o $@ $(CFLAGS)
OBJS = $(addprefix bin/,$(notdir $(SRC:.c=.o)))
pointless: pointless.c $(OBJS)
$(CC) -o $@ $< $(OBJS) $(CFLAGS) -lm
debug/run: debug/run.c pointless
$(CC) -o $@ $< $(OBJS) $(CFLAGS) -lm
debug/compile: debug/compile.c pointless
$(CC) -o $@ $< $(OBJS) $(CFLAGS) -lm
debug/annotate: debug/annotate.c pointless
$(CC) -o $@ $< $(OBJS) $(CFLAGS) -lm
debug/parse: debug/parse.c pointless
$(CC) -o $@ $< $(OBJS) $(CFLAGS) -lm
debug/highlight: debug/highlight.c pointless
$(CC) -o $@ $< $(OBJS) $(CFLAGS) -lm
debug/tokenize: debug/tokenize.c pointless
$(CC) -o $@ $< $(OBJS) $(CFLAGS) -lm