-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (22 loc) · 755 Bytes
/
Makefile
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
SUPPORTDIR= ../cool-support
LIB =
SRC= cgen.cc cgen.h cgen_supp.cc cool-tree.h cool-tree.handcode.h emit.h
CSRC= cgen-phase.cc utilities.cc stringtab.cc dumptype.cc tree.cc cool-tree.cc ast-lex.cc ast-parse.cc handle_flags.cc
CGEN=
CFILES= cgen.cc cgen_supp.cc $(CGEN) ${CSRC}
OBJS= ${CFILES:.cc=.o}
CFLAGS=-g -Wall -Wno-unused ${CPPINCLUDE} -DDEBUG -std=c++11
CPPINCLUDE= -I. -I${SUPPORTDIR}/include -I${SUPPORTDIR}/src
CC= g++
all: cgen
cgen: ${OBJS}
${CC} ${CFLAGS} ${OBJS} ${LIB} -o cgen
.cc.o:
${CC} ${CFLAGS} -c $<
${CSRC}:
-ln -s ${SUPPORTDIR}/src/$@ $@
clean :
-rm -f core *.s ${CSRC} cgen *.o *.a
%.d: %.cc ${SRC}
${SHELL} -ec '${DEPEND} $< | sed '\''s/\($*\.o\)[ :]*/\1 $@ : /g'\'' > $@'
-include ${CFIL:.cc=.d}