Rework makefiles. Add proper dependency checking.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user