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

SRC = \
	malloc.c \
	misc.c \
	qstr.c \
	lexer.c \
	lexerfile.c \
	parse.c \
	scope.c \
	compile.c \
	emitcommon.c \
15
	emitpass1.c \
Damien's avatar
Damien committed
16
17
18
19
	emitcpy.c \
	emitbc.c \
	asmx64.c \
	asmthumb.c \
20
	emitinlinethumb.c \
Damien's avatar
Damien committed
21
	runtime.c \
22
	vm.c \
Damien's avatar
Damien committed
23
24
25
26
	main.c \

SRC_ASM = \

27
OBJ = $(SRC:.c=.o) $(SRC_ASM:.s=.o) emitnx64.o emitnthumb.o
Damien's avatar
Damien committed
28
29
30
31
32
33
34
35
36
LIB =
PROG = py

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

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

37
vm.o: vm.c
Damien's avatar
Damien committed
38
39
40
41
42
43
	$(CC) $(CFLAGS) -O3 -c -o $@ $<

parse.o: grammar.h
compile.o: grammar.h
emitcpy.o: emit.h
emitbc.o: emit.h
44
45
46
47
48
49

emitnx64.o: emitnative.c emit.h
	$(CC) $(CFLAGS) -DN_X64 -c -o $@ $<

emitnthumb.o: emitnative.c emit.h
	$(CC) $(CFLAGS) -DN_THUMB -c -o $@ $<
Damien's avatar
Damien committed
50
51
52

clean:
	/bin/rm $(OBJ)