Makefile 1.04 KB
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
16
17
18
19
20
21

UNAME_S := $(shell uname -s)
 ifeq ($(UNAME_S),Darwin)
    LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-map,$@.map
else
    LDFLAGS = $(LDFLAGS_MOD) -lm -Wl,-Map=$@.map,--cref
 endif
22

23
24
25
26
ifeq ($(MICROPY_MOD_TIME),1)
CFLAGS_MOD += -DMICROPY_MOD_TIME=1
SRC_MOD += time.c
endif
27
ifeq ($(MICROPY_MOD_FFI),1)
28
CFLAGS_MOD += `pkg-config --cflags libffi` -DMICROPY_MOD_FFI=1
29
30
31
32
LDFLAGS_MOD += -ldl -lffi
SRC_MOD += ffi.c
endif

33

34
# Debugging/Optimization
35
ifdef DEBUG
36
37
CFLAGS += -g
COPT = -O0
38
else
39
COPT = -Os #-DNDEBUG
40
41
endif

42
# source files
43
44
SRC_C = \
	main.c \
45
	gccollect.c \
46
	file.c \
47
	socket.c \
48
	$(SRC_MOD)
49

50
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
Damien's avatar
Damien committed
51
LIB = -lreadline
52
53
# the following is needed for BSD
#LIB += -ltermcap
54

55
include ../py/mkrules.mk
56