2 # Makefile.rules - Common Makefile rules to build pic16 C Library
4 # This file is part of the GNU PIC Library.
7 # The GNU PIC Library is maintained by,
8 # Vangelis Rokas <vrokas@otenet.gr>
15 include ../../Makefile.common
17 PRJDIR = ../../../../..
19 LIBC_INC_DIR = $(PRJDIR)/device/include/pic16
22 COMPILE_FLAGS += $(MODELFLAGS)
23 COMPILE_FLAGS += -p$(MCU)
24 COMPILE_FLAGS += $(OPT_FLAGS)
25 #COMPILE_FLAGS += --i-code-in-asm
29 CFLAGS = -I$(LIBC_INC_DIR) $(OPT_FLAGS2)
32 CFILES = $(patsubst %,%.c,$(SRCS))
33 OFILES = $(patsubst %.c,%.o,$(CFILES))
36 $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
39 @echo "Please make target \`build-io-lib' setting"
40 @echo "MCU= to the target device (i.e. MCU=18f452)"
43 build-io-lib: build-library clean-intermediate-no-asm
46 $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
48 clean-intermediate-no-asm:
49 $(RM) -f *.lst *.dump* *.p *.d *.adb
52 clean: clean-intermediate
56 $(MAKE) -C ./ build-io-lib MCU=18f452
60 for temp in $(CFILES); do \
61 $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
62 $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
63 $(RM) -f .tmpdepend; \