Makefile 944 Bytes
Newer Older
1
include ../py/mkenv.mk
2
-include mpconfigport.mk
3

4
# define main target
5
PROG = micropython
6

7
8
9
# qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h

10
11
# include py core make definitions
include ../py/py.mk
12

13
# compiler settings
14
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT)
15
LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-Map=$@.map,--cref
16

17
18
19
20
ifeq ($(MICROPY_MOD_TIME),1)
CFLAGS_MOD += -DMICROPY_MOD_TIME=1
SRC_MOD += time.c
endif
21
ifeq ($(MICROPY_MOD_FFI),1)
22
CFLAGS_MOD += `pkg-config --cflags libffi` -DMICROPY_MOD_FFI=1
23
24
25
26
LDFLAGS_MOD += -ldl -lffi
SRC_MOD += ffi.c
endif

27

28
# Debugging/Optimization
29
ifdef DEBUG
30
31
CFLAGS += -g
COPT = -O0
32
else
33
COPT = -Os #-DNDEBUG
34
35
endif

36
# source files
37
38
SRC_C = \
	main.c \
39
	gccollect.c \
40
	file.c \
41
	socket.c \
42
	$(SRC_MOD)
43

44
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
Damien's avatar
Damien committed
45
LIB = -lreadline
46
47
# the following is needed for BSD
#LIB += -ltermcap
48

49
include ../py/mkrules.mk
50