# # Makefile.rules - Common Makefile rules to build pic16 C Library # # This file is part of the GNU PIC Library. # # January, 2004 # The GNU PIC Library is maintained by, # Vangelis Rokas # # $Id: Makefile.rules,v 1.6 2005/04/06 06:11:08 vrokas Exp $ # # include ../../Makefile.common PRJDIR = ../../../../.. LIBC_INC_DIR = $(PRJDIR)/device/include/pic16 COMPILE_FLAGS += $(MODELFLAGS) COMPILE_FLAGS += -p$(MCU) COMPILE_FLAGS += $(OPT_FLAGS) #COMPILE_FLAGS += --i-code-in-asm COMPILE_FLAGS += $(CSTD) OPT_FLAGS2 += CFLAGS = -I$(LIBC_INC_DIR) $(OPT_FLAGS2) CFILES = $(patsubst %,%.c,$(SRCS)) OFILES = $(patsubst %.c,%.o,$(CFILES)) %.o: %.c $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $< all: @echo "Please make target \`build-io-lib' setting" @echo "MCU= to the target device (i.e. MCU=18f452)" build-io-lib: build-library clean-intermediate-no-asm clean-intermediate: $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb clean-intermediate-no-asm: $(RM) -f *.lst *.dump* *.p *.d *.adb clean: clean-intermediate $(RM) -f $(LIB) *.o ttest: $(MAKE) -C ./ build-io-lib MCU=18f452 dep .depend: rm -f .depend for temp in $(CFILES); do \ $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \ $(SED) s/.rel/.o/g .tmpdepend >> .depend; \ $(RM) -f .tmpdepend; \ done; include .depend