Rework makefiles. Add proper dependency checking.

This commit is contained in:
Dave Hylands
2014-01-24 01:05:30 -08:00
parent 2b2cb7b7f4
commit c89c681a9f
9 changed files with 195 additions and 201 deletions

View File

@@ -1,16 +1,12 @@
include ../py/mkenv.mk
# define main target
PROG = cpy
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
@@ -28,20 +24,5 @@ SRC_C = \
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
LIB =
$(PROG): $(BUILD) $(OBJ)
$(ECHO) "LINK $<"
$(Q)$(CC) -o $@ $(OBJ) $(LIB) $(LDFLAGS)
$(Q)strip $(PROG)
$(Q)size $(PROG)
include ../py/mkrules.mk
$(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