-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.in
99 lines (77 loc) · 2.87 KB
/
Makefile.in
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
CORE_SOURCES=$(wildcard src/core/*.c)
COMPILER_SOURCES=$(wildcard src/compiler/*.c)
GRAMMAR_SOURCES=$(wildcard src/grammar/*.c)
ENVIRONMENT_SOURCES=$(wildcard src/environment/*.c)
HTOEGL_SOURCES=$(wildcard src/htoegl/*.c)
EXAMPLE_SOURCES=$(wildcard examples/*.egl)
CPP_SOURCES=$(wildcard src/cpp/*.cpp)
CORE_OBJ_FILES=$(addprefix obj/core/,$(notdir $(CORE_SOURCES:.c=.o)))
COMPILER_OBJ_FILES=$(addprefix obj/compiler/,$(notdir $(COMPILER_SOURCES:.c=.o)))
GRAMMAR_OBJ_FILES=$(addprefix obj/grammar/,$(notdir $(GRAMMAR_SOURCES:.c=.o)))
ENVIRONMENT_OBJ_FILES=$(addprefix obj/environment/,$(notdir $(ENVIRONMENT_SOURCES:.c=.o)))
HTOEGL_OBJ_FILES=$(addprefix obj/htoegl/,$(notdir $(HTOEGL_SOURCES:.c=.o)))
EXAMPLE_EXECUTABLES=$(addprefix builtex/,$(notdir $(EXAMPLE_SOURCES:.egl=.e)))
CPP_OBJ_FILES=$(addprefix obj/cpp/,$(notdir $(CPP_SOURCES:.cpp=.o)))
CFLAGS=-Isrc -std=c99 -Wall -Wextra -pedantic -Wno-unused-parameter -fno-strict-aliasing `@llvmconfig@ --cflags` @targ@
CXXFLAGS=-Isrc -std=c++11 -fno-rtti -Wall -Wextra -pedantic -Wno-unused-parameter `@llvmconfig@ --cxxflags` @targ@
LDFLAGS=`@llvmconfig@ --ldflags --libs --libs core support analysis native transformutils bitwriter asmprinter asmparser target all-targets` -ldl -lpthread -lm -lcurses -lz
HTOEGL_CFLAGS=-Isrc -std=c99 -Wall -Wextra -pedantic -Wno-unused-parameter
HTOEGL_LDFLAGS=-lclang
CC=@CC@
CXX=@CXX@
MKDIR=mkdir -p
LD=@CXX@
LEX=@LEX@
YACC=@YACC@
eagle: guts
touch src/core/versioning.c
@$(MAKE) glory
htoegl: $(HTOEGL_OBJ_FILES)
$(LD) -o htoegl $^ $(HTOEGL_LDFLAGS)
all: eagle htoegl
guts: src/grammar/eagle.l src/grammar/eagle.y
$(YACC) -d -o src/grammar/eagle.tab.c src/grammar/eagle.y -v
$(LEX) -o src/grammar/tokens.c src/grammar/eagle.l
glory: $(COMPILER_OBJ_FILES) $(CORE_OBJ_FILES) $(GRAMMAR_OBJ_FILES) $(ENVIRONMENT_OBJ_FILES) $(CPP_OBJ_FILES)
$(LD) -o eagle $^ $(LDFLAGS)
clean:
rm -f eagle
rm -rf obj
rm -f src/grammar/eagle.tab.* src/grammar/tokens.c
deep_clean: clean
rm -f *.s
rm -f *.ll
rm -rf builtex
clean-examples:
rm -f *.e
rm -rf builtex
htest: src/core/c-headers.c
$(CC) $(CFLAGS) $(LDFLAGS) src/core/c-headers.c src/core/hashtable.c src/core/arraylist.c -o htest -DHTEST
obj/compiler/%.o: src/compiler/%.c
$(MKDIR) obj/compiler/
$(CC) $(CFLAGS) -c -o $@ $<
obj/core/%.o: src/core/%.c
$(MKDIR) obj/core/
$(CC) $(CFLAGS) -c -o $@ $<
obj/grammar/%.o: src/grammar/%.c
$(MKDIR) obj/grammar/
$(CC) $(CFLAGS) -c -o $@ $<
obj/environment/%.o: src/environment/%.c
$(MKDIR) obj/environment/
$(CC) $(CFLAGS) -c -o $@ $<
obj/htoegl/%.o: src/htoegl/%.c
$(MKDIR) obj/htoegl/
$(CC) $(HTOEGL_CFLAGS) -c -o $@ $<
obj/cpp/%.o: src/cpp/%.cpp
$(MKDIR) obj/cpp/
$(CXX) $(CXXFLAGS) -c -o $@ $<
rc.o: rc.egl
./eagle rc.egl -c -o rc.o --no-rc
#rc.o: rc.c
# $(CC) rc.c -c -o rc.o -g
%: examples/%.egl
./eagle $< -o $@
builtex/%.e: examples/%.egl
$(MKDIR) builtex/
./eagle $< -o $@
all-examples: $(EXAMPLE_EXECUTABLES)