circuitpython/unix/Makefile

54 lines
849 B
Makefile
Raw Normal View History

# define main target
2014-01-19 19:02:39 -05:00
PROG = micropython
all: $(PROG)
# include py core make definitions
include ../py/py.mk
# program for deletion
RM = /bin/rm
ECHO = @echo
# compiler settings
CC = gcc
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -DUNIX
LDFLAGS = -lm
#Debugging/Optimization
ifdef DEBUG
CFLAGS += -Og -ggdb
else
CFLAGS += -Os #-DNDEBUG
endif
# source files
SRC_C = \
main.c \
file.c \
2014-01-18 16:47:44 -05:00
socket.c \
OBJ = $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) $(PY_O)
2013-10-18 14:58:12 -04:00
LIB = -lreadline
# the following is needed for BSD
#LIB += -ltermcap
$(PROG): $(BUILD) $(OBJ)
$(ECHO) "LINK $<"
$(Q)$(CC) -o $@ $(OBJ) $(LIB) $(LDFLAGS)
ifndef DEBUG
$(Q)strip $(PROG)
endif
$(Q)size $(PROG)
$(BUILD)/%.o: %.c
$(ECHO) "CC $<"
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
$(BUILD)/main.o: mpconfigport.h
clean:
$(RM) -f $(PROG)
$(RM) -rf $(BUILD)
.PHONY: all clean