-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (60 loc) · 1.23 KB
/
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
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
HCC_DIR = $(shell pwd)
CC = gcc
CFLAGS = -DHCC_DIR=\"$(HCC_DIR)\" -g -D_DEBUG_ERRORS
YACC = bison
LEX = flex
LDFLAGS =
OBJS= compiler.o \
ast.o \
ast_xml.o \
cerror.o \
debug.o \
symtable.o \
scope.o \
utype.o \
strings.o \
typechk.o \
cfg.o \
mir_cfg.o \
tempreg.o \
icg.o \
mir.o \
inline.o \
peephole.o \
astparse.o \
history.o \
regalloc.o \
stabs.o \
sparcgen.o \
parser.tab.o
compiler: $(OBJS)
@echo " LD\t$@"
@$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o compiler
lex.yy.c: lex.l
@echo " LEX\t$<"
@$(LEX) $<
parser.tab.c: parser.y lex.l
@echo " YACC\t$<"
@$(YACC) -v -d $<
parser.tab.o: parser.tab.c lex.yy.c
@echo " CC\t$<"
@$(CC) $(CFLAGS) -c $< -o $@
%.o: %.c
@echo " CC\t$<"
@$(CC) $(CFLAGS) -c -o $@ $<
.PHONY: tests perform clean clean_tests
tests:
cd tests && make
perform:
cd perform && make
clean:
@echo " CLEAN"
@rm -f core* compiler *.o *~* lex.yy.c parser.tab.c \
parser.tab.h 2>/dev/null
clean_tests:
rm -f tests/*.lir* tests/*.cfg* tests/*.ig* tests/*.mir* tests/*.s \
tests/*.ic tests/*~* tests/*.xml tests/core*
clean_perform:
rm -f perform/*.lir* perform/*.cfg* perform/*.ig* perform/*.mir* \
perform/*.s perform/*.ic perform/*~* perform/*.xml \
perform/core*