Makefile 806 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
15
16
17
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD)
LDFLAGS = $(LDFLAGS_MOD) -lm

ifeq ($(MICROPY_MOD_FFI),1)
18
CFLAGS_MOD += `pkg-config --cflags libffi` -DMICROPY_MOD_FFI=1
19
20
21
22
LDFLAGS_MOD += -ldl -lffi
SRC_MOD += ffi.c
endif

23

24
# Debugging/Optimization
25
ifdef DEBUG
26
CFLAGS += -O0 -g
27
28
29
30
else
CFLAGS += -Os #-DNDEBUG
endif

31
# source files
32
33
SRC_C = \
	main.c \
34
	file.c \
35
	socket.c \
36
	$(SRC_MOD)
37

38
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
Damien's avatar
Damien committed
39
LIB = -lreadline
40
41
# the following is needed for BSD
#LIB += -ltermcap
42

43
include ../py/mkrules.mk
44