Makefile 1011 Bytes
Newer Older
Markus Siemens's avatar
Markus Siemens committed
1
include ../py/mkenv.mk
2
-include mpconfigport.mk
Markus Siemens's avatar
Markus Siemens committed
3
4
5
6
7

# define main target
PROG = micropython.exe

# qstr definitions (must come before including py.mk)
8
QSTR_DEFS = ../unix/qstrdefsport.h
Markus Siemens's avatar
Markus Siemens committed
9
10
11
12

# include py core make definitions
include ../py/py.mk

13
INC =  -I.
14
INC += -I..
15
INC += -I$(PY_SRC)
16
INC += -I$(BUILD)
17

Markus Siemens's avatar
Markus Siemens committed
18
# compiler settings
19
CFLAGS = $(INC) -Wall -Wpointer-arith -Werror -ansi -std=gnu99 -DUNIX -D__USE_MINGW_ANSI_STDIO=1 $(CFLAGS_MOD) $(COPT)
20
LDFLAGS = $(LDFLAGS_MOD) -lm
Markus Siemens's avatar
Markus Siemens committed
21
22
23

# Debugging/Optimization
ifdef DEBUG
24
25
CFLAGS += -g
COPT = -O0
Markus Siemens's avatar
Markus Siemens committed
26
else
27
COPT = -Os #-DNDEBUG
Markus Siemens's avatar
Markus Siemens committed
28
29
30
31
endif

# source files
SRC_C = \
32
33
	unix/main.c \
	unix/file.c \
34
	unix/input.c \
35
	unix/modos.c \
stijn's avatar
stijn committed
36
	unix/modtime.c \
37
	unix/gccollect.c \
38
	realpath.c \
39
	init.c \
stijn's avatar
stijn committed
40
	sleep.c \
41
	bss.c \
Markus Siemens's avatar
Markus Siemens committed
42
43

OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
44
45
46
47

ifeq ($(MICROPY_USE_READLINE),1)
CFLAGS_MOD += -DMICROPY_USE_READLINE=1
LDFLAGS_MOD += -lreadline
Markus Siemens's avatar
Markus Siemens committed
48
# the following is needed for BSD
49
50
51
52
53
#LDFLAGS_MOD += -ltermcap
endif

LIB += -lws2_32
#LIB += -lmman
Markus Siemens's avatar
Markus Siemens committed
54
55
56

include ../py/mkrules.mk