2014-01-07 14:54:15 +00:00
|
|
|
# define main target
|
|
|
|
PROG = py
|
|
|
|
all: $(PROG)
|
|
|
|
|
|
|
|
# include py core make definitions
|
|
|
|
include ../py/py.mk
|
2013-10-12 14:30:21 +01:00
|
|
|
|
2014-01-07 14:54:15 +00:00
|
|
|
# program for deletion
|
|
|
|
RM = /bin/rm
|
2014-01-08 18:15:39 +00:00
|
|
|
ECHO = @echo
|
2014-01-07 14:54:15 +00:00
|
|
|
|
|
|
|
# compiler settings
|
2013-10-12 14:30:21 +01:00
|
|
|
CC = gcc
|
2014-01-07 14:54:15 +00:00
|
|
|
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -Os #-DNDEBUG
|
2014-01-02 15:50:33 +00:00
|
|
|
LDFLAGS = -lm
|
2013-10-12 14:30:21 +01:00
|
|
|
|
2014-01-07 14:54:15 +00:00
|
|
|
# source files
|
2013-10-12 14:30:21 +01:00
|
|
|
SRC_C = \
|
|
|
|
main.c \
|
2014-01-08 00:52:20 +00:00
|
|
|
file.c \
|
2013-10-12 14:30:21 +01:00
|
|
|
|
2014-01-07 14:54:15 +00:00
|
|
|
OBJ = $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) $(PY_O)
|
2013-10-18 19:58:12 +01:00
|
|
|
LIB = -lreadline
|
2014-01-02 15:50:33 +00:00
|
|
|
# the following is needed for BSD
|
|
|
|
#LIB += -ltermcap
|
2013-10-12 14:30:21 +01:00
|
|
|
|
|
|
|
$(PROG): $(BUILD) $(OBJ)
|
2014-01-08 18:15:39 +00:00
|
|
|
$(ECHO) "LINK $<"
|
|
|
|
$(Q)$(CC) -o $@ $(OBJ) $(LIB) $(LDFLAGS)
|
|
|
|
$(Q)strip $(PROG)
|
|
|
|
$(Q)size $(PROG)
|
2013-10-12 14:30:21 +01:00
|
|
|
|
|
|
|
$(BUILD)/%.o: %.c
|
2014-01-08 18:15:39 +00:00
|
|
|
$(ECHO) "CC $<"
|
|
|
|
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
|
2013-10-12 14:30:21 +01:00
|
|
|
|
2014-01-03 15:15:53 +00:00
|
|
|
$(BUILD)/main.o: mpconfigport.h
|
2013-10-12 14:30:21 +01:00
|
|
|
|
|
|
|
clean:
|
2014-01-07 14:54:15 +00:00
|
|
|
$(RM) -f $(PROG)
|
|
|
|
$(RM) -rf $(BUILD)
|
2013-12-29 18:01:01 +00:00
|
|
|
|
2014-01-07 14:54:15 +00:00
|
|
|
.PHONY: all clean
|