Makefile 688 Bytes
Newer Older
Damien's avatar
Damien committed
1
CC = gcc
2
CFLAGS = -Wall -ansi -std=gnu99 -Os -DEMIT_ENABLE_CPY -DEMIT_ENABLE_X64 #-DNDEBUG
Damien's avatar
Damien committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
LDFLAGS =

SRC = \
	malloc.c \
	misc.c \
	qstr.c \
	lexer.c \
	lexerfile.c \
	parse.c \
	scope.c \
	compile.c \
	emitcommon.c \
	emitcpy.c \
	emitbc.c \
	asmx64.c \
Damien's avatar
Damien committed
18
	emitx64.c \
Damien's avatar
Damien committed
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
	emitthumb.c \
	asmthumb.c \
	runtime.c \
	bc.c \
	main.c \

SRC_ASM = \

OBJ = $(SRC:.c=.o) $(SRC_ASM:.s=.o)
LIB =
PROG = py

$(PROG): $(OBJ)
	$(CC) -o $@ $(OBJ) $(LIB) $(LDFLAGS)

runtime.o: runtime.c
	$(CC) $(CFLAGS) -O3 -c -o $@ $<

bc.o: bc.c
	$(CC) $(CFLAGS) -O3 -c -o $@ $<

parse.o: grammar.h
compile.o: grammar.h
emitcpy.o: emit.h
emitbc.o: emit.h
emitx64.o: emit.h
emitthumb.o: emit.h

clean:
	/bin/rm $(OBJ)