2014-01-24 04:05:30 -05:00
|
|
|
include ../py/mkenv.mk
|
2014-02-01 13:06:55 -05:00
|
|
|
-include mpconfigport.mk
|
2014-01-24 04:05:30 -05:00
|
|
|
|
2014-01-07 09:54:15 -05:00
|
|
|
# define main target
|
2014-01-19 19:02:39 -05:00
|
|
|
PROG = micropython
|
2014-01-07 09:54:15 -05:00
|
|
|
|
2014-01-21 16:40:13 -05:00
|
|
|
# qstr definitions (must come before including py.mk)
|
|
|
|
QSTR_DEFS = qstrdefsport.h
|
|
|
|
|
2014-01-07 09:54:15 -05:00
|
|
|
# include py core make definitions
|
|
|
|
include ../py/py.mk
|
2013-10-12 09:30:21 -04:00
|
|
|
|
2014-01-07 09:54:15 -05:00
|
|
|
# compiler settings
|
2014-02-01 13:06:55 -05:00
|
|
|
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD)
|
|
|
|
LDFLAGS = $(LDFLAGS_MOD) -lm
|
|
|
|
|
2014-02-01 17:57:06 -05:00
|
|
|
ifeq ($(MICROPY_MOD_TIME),1)
|
|
|
|
CFLAGS_MOD += -DMICROPY_MOD_TIME=1
|
|
|
|
SRC_MOD += time.c
|
|
|
|
endif
|
2014-02-01 13:06:55 -05:00
|
|
|
ifeq ($(MICROPY_MOD_FFI),1)
|
2014-02-01 13:48:19 -05:00
|
|
|
CFLAGS_MOD += `pkg-config --cflags libffi` -DMICROPY_MOD_FFI=1
|
2014-02-01 13:06:55 -05:00
|
|
|
LDFLAGS_MOD += -ldl -lffi
|
|
|
|
SRC_MOD += ffi.c
|
|
|
|
endif
|
|
|
|
|
2013-10-12 09:30:21 -04:00
|
|
|
|
2014-01-26 12:52:23 -05:00
|
|
|
# Debugging/Optimization
|
2014-01-13 08:25:10 -05:00
|
|
|
ifdef DEBUG
|
2014-01-25 12:47:05 -05:00
|
|
|
CFLAGS += -O0 -g
|
2014-01-13 08:25:10 -05:00
|
|
|
else
|
|
|
|
CFLAGS += -Os #-DNDEBUG
|
|
|
|
endif
|
|
|
|
|
2014-01-07 09:54:15 -05:00
|
|
|
# source files
|
2013-10-12 09:30:21 -04:00
|
|
|
SRC_C = \
|
|
|
|
main.c \
|
2014-01-07 19:52:20 -05:00
|
|
|
file.c \
|
2014-01-18 16:47:44 -05:00
|
|
|
socket.c \
|
2014-02-01 13:06:55 -05:00
|
|
|
$(SRC_MOD)
|
2013-10-12 09:30:21 -04:00
|
|
|
|
2014-01-21 16:40:13 -05:00
|
|
|
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
2013-10-18 14:58:12 -04:00
|
|
|
LIB = -lreadline
|
2014-01-02 10:50:33 -05:00
|
|
|
# the following is needed for BSD
|
|
|
|
#LIB += -ltermcap
|
2013-10-12 09:30:21 -04:00
|
|
|
|
2014-01-24 04:05:30 -05:00
|
|
|
include ../py/mkrules.mk
|
2013-12-29 13:01:01 -05:00
|
|
|
|