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
|
|
|
all: $(PROG)
|
|
|
|
|
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
|
|
|
# program for deletion
|
|
|
|
RM = /bin/rm
|
2014-01-08 13:15:39 -05:00
|
|
|
ECHO = @echo
|
2014-01-07 09:54:15 -05:00
|
|
|
|
|
|
|
# compiler settings
|
2013-10-12 09:30:21 -04:00
|
|
|
CC = gcc
|
2014-01-15 17:58:39 -05:00
|
|
|
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -DUNIX
|
2014-01-02 10:50:33 -05:00
|
|
|
LDFLAGS = -lm
|
2013-10-12 09:30:21 -04:00
|
|
|
|
2014-01-13 08:25:10 -05:00
|
|
|
#Debugging/Optimization
|
|
|
|
ifdef DEBUG
|
|
|
|
CFLAGS += -Og -ggdb
|
|
|
|
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 \
|
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
|
|
|
|
|
|
|
$(PROG): $(BUILD) $(OBJ)
|
2014-01-08 13:15:39 -05:00
|
|
|
$(ECHO) "LINK $<"
|
|
|
|
$(Q)$(CC) -o $@ $(OBJ) $(LIB) $(LDFLAGS)
|
2014-01-13 08:25:10 -05:00
|
|
|
ifndef DEBUG
|
2014-01-08 13:15:39 -05:00
|
|
|
$(Q)strip $(PROG)
|
2014-01-13 08:25:10 -05:00
|
|
|
endif
|
2014-01-08 13:15:39 -05:00
|
|
|
$(Q)size $(PROG)
|
2013-10-12 09:30:21 -04:00
|
|
|
|
2014-01-21 16:40:13 -05:00
|
|
|
$(BUILD)/%.o: %.c $(QSTR_DEFS)
|
2014-01-08 13:15:39 -05:00
|
|
|
$(ECHO) "CC $<"
|
|
|
|
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
|
2013-10-12 09:30:21 -04:00
|
|
|
|
2014-01-03 10:15:53 -05:00
|
|
|
$(BUILD)/main.o: mpconfigport.h
|
2013-10-12 09:30:21 -04:00
|
|
|
|
|
|
|
clean:
|
2014-01-07 09:54:15 -05:00
|
|
|
$(RM) -f $(PROG)
|
|
|
|
$(RM) -rf $(BUILD)
|
2013-12-29 13:01:01 -05:00
|
|
|
|
2014-01-07 09:54:15 -05:00
|
|
|
.PHONY: all clean
|