buildsystem,epj2make,ide,tarball; added cleantarget and adjusted realclean and distcl...
[sdk] / compiler / bootstrap / libec / Makefile
1 .PHONY: all objdir clean realclean distclean
2
3 # CORE VARIABLES
4
5 MODULE := ec
6 CONFIG := bootstrap
7 ifndef COMPILER
8 COMPILER := default
9 endif
10
11 TARGET_TYPE = staticlib
12
13 # FLAGS
14
15 ECFLAGS =
16 ifndef DEBIAN_PACKAGE
17 CFLAGS =
18 LDFLAGS =
19 endif
20 PRJ_CFLAGS =
21 CECFLAGS =
22 OFLAGS =
23 LIBS =
24
25 ifdef DEBUG
26 NOSTRIP := y
27 endif
28
29 CONSOLE = -mwindows
30
31 # INCLUDES
32
33 _CF_DIR = ../../../
34
35 include $(_CF_DIR)crossplatform.mk
36 include $(_CF_DIR)default.cf
37
38 # POST-INCLUDES VARIABLES
39
40 OBJ = obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/
41
42 RES = 
43
44 TARGET = obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)ecBootstrap$(A)
45
46 OBJECTS = \
47         $(OBJ)ast.o \
48         $(OBJ)copy.o \
49         $(OBJ)dbpass.o \
50         $(OBJ)ec.main.o \
51         $(OBJ)ecdefs.o \
52         $(OBJ)expression.o \
53         $(OBJ)firstPass.o \
54         $(OBJ)freeAst.o \
55         $(OBJ)grammar.o \
56         $(OBJ)lexer.o \
57         $(OBJ)loadSymbols.o \
58         $(OBJ)output.o \
59         $(OBJ)pass0.o \
60         $(OBJ)pass1.o \
61         $(OBJ)pass15.o \
62         $(OBJ)pass16.o \
63         $(OBJ)pass2.o \
64         $(OBJ)pass3.o \
65         $(OBJ)shortcuts.o \
66         $(OBJ)type.o \
67         $(OBJ)bsl.o
68
69 SOURCES = \
70         bootstrap/ast.c \
71         bootstrap/copy.c \
72         bootstrap/dbpass.c \
73         bootstrap/ec.main.c \
74         bootstrap/ecdefs.c \
75         bootstrap/expression.c \
76         bootstrap/firstPass.c \
77         bootstrap/freeAst.c \
78         bootstrap/grammar.c \
79         bootstrap/lexer.c \
80         bootstrap/loadSymbols.c \
81         bootstrap/output.c \
82         bootstrap/pass0.c \
83         bootstrap/pass1.c \
84         bootstrap/pass15.c \
85         bootstrap/pass16.c \
86         bootstrap/pass2.c \
87         bootstrap/pass3.c \
88         bootstrap/shortcuts.c \
89         bootstrap/type.c \
90         ../bsl.c
91
92 LIBS += $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
93
94 ifndef STATIC_LIBRARY_TARGET
95 LIBS +=
96 endif
97
98 PRJ_CFLAGS += \
99          $(if $(DEBUG), -g, -O2 -ffast-math) $(FORCE_32_BIT) $(FPIC) -w \
100                          -DECERE_STATIC
101 ECFLAGS += \
102          -nolinenumbers
103
104
105
106
107 CECFLAGS += -cpp $(_CPP)
108
109 ifndef STATIC_LIBRARY_TARGET
110 OFLAGS += $(FORCE_32_BIT)
111 endif
112
113 # TARGETS
114
115 all: objdir $(TARGET)
116
117 objdir:
118         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
119
120 $(TARGET): $(SOURCES) $(RESOURCES) | objdir $(SYMBOLS) $(OBJECTS)
121         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
122
123 # OBJECT RULES
124
125 $(OBJ)ast.o: bootstrap/ast.c
126         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/ast.c -o $(OBJ)ast.o
127
128 $(OBJ)copy.o: bootstrap/copy.c
129         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/copy.c -o $(OBJ)copy.o
130
131 $(OBJ)dbpass.o: bootstrap/dbpass.c
132         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/dbpass.c -o $(OBJ)dbpass.o
133
134 $(OBJ)ec.main.o: bootstrap/ec.main.c
135         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/ec.main.c -o $(OBJ)ec.main.o
136
137 $(OBJ)ecdefs.o: bootstrap/ecdefs.c
138         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/ecdefs.c -o $(OBJ)ecdefs.o
139
140 $(OBJ)expression.o: bootstrap/expression.c
141         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/expression.c -o $(OBJ)expression.o
142
143 $(OBJ)firstPass.o: bootstrap/firstPass.c
144         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/firstPass.c -o $(OBJ)firstPass.o
145
146 $(OBJ)freeAst.o: bootstrap/freeAst.c
147         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/freeAst.c -o $(OBJ)freeAst.o
148
149 $(OBJ)grammar.o: bootstrap/grammar.c
150         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/grammar.c -o $(OBJ)grammar.o
151
152 $(OBJ)lexer.o: bootstrap/lexer.c
153         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/lexer.c -o $(OBJ)lexer.o
154
155 $(OBJ)loadSymbols.o: bootstrap/loadSymbols.c
156         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/loadSymbols.c -o $(OBJ)loadSymbols.o
157
158 $(OBJ)output.o: bootstrap/output.c
159         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/output.c -o $(OBJ)output.o
160
161 $(OBJ)pass0.o: bootstrap/pass0.c
162         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/pass0.c -o $(OBJ)pass0.o
163
164 $(OBJ)pass1.o: bootstrap/pass1.c
165         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/pass1.c -o $(OBJ)pass1.o
166
167 $(OBJ)pass15.o: bootstrap/pass15.c
168         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/pass15.c -o $(OBJ)pass15.o
169
170 $(OBJ)pass16.o: bootstrap/pass16.c
171         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/pass16.c -o $(OBJ)pass16.o
172
173 $(OBJ)pass2.o: bootstrap/pass2.c
174         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/pass2.c -o $(OBJ)pass2.o
175
176 $(OBJ)pass3.o: bootstrap/pass3.c
177         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/pass3.c -o $(OBJ)pass3.o
178
179 $(OBJ)shortcuts.o: bootstrap/shortcuts.c
180         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/shortcuts.c -o $(OBJ)shortcuts.o
181
182 $(OBJ)type.o: bootstrap/type.c
183         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c bootstrap/type.c -o $(OBJ)type.o
184
185 $(OBJ)bsl.o: ../bsl.c
186         $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c ../bsl.c -o $(OBJ)bsl.o
187
188 clean: objdir
189         $(call rmq,$(TARGET))
190         $(call rmq,$(OBJECTS))
191
192 realclean: objdir
193         $(call rmrq,$(OBJ))
194
195 distclean: objdir
196         $(call rmrq,obj/)