-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (36 loc) · 770 Bytes
/
Copy pathMakefile
File metadata and controls
46 lines (36 loc) · 770 Bytes
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
##### global settings #####
.PHONY: clean
CC := gcc
LD := ld
BIN := test
TESTFILE := hehe.decaf
CFLAGS := -m32 -O0 -Wall -c -Iinclude
ifdef DEBUG
CFLAGS +=-g -DYYDEBUG -DDEBUG
endif
ifdef SYMDEBUG
CFLAGS += -DSYMDEBUG
endif
ifdef IRDEBUG
CFLAGS += -DIRDEBUG
endif
LEXICAL := decaf.l
GRAMMAR := decaf.y
LEXICAL_C := lexical.c
GRAMMAR_C := decaf.c
OBJS += lexical.o
OBJS += decaf.o
OBJS += symtable.o ir.o
SOURCE += source/symtable.c source/ir.c
all: bin
test: bin
./$(BIN) $(TESTFILE)
src : $(LEXICAL) $(GRAMMAR)
flex -F -o $(LEXICAL_C) $(LEXICAL)
bison -v -g -d -o $(GRAMMAR_C) $(GRAMMAR)
$(OBJS): src $(SOURCE)
$(CC) $(CFLAGS) $(LEXICAL_C) $(GRAMMAR_C) $(SOURCE)
bin: $(OBJS)
gcc -m32 -o $(BIN) $(OBJS)
clean:
rm -rf *.h *.c *.o *.output *.dot $(BIN)