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
26 COMPILE_FLAGS += $(CSTD)
30 CFLAGS = -I$(LIBC_INC_DIR) $(OPT_FLAGS2)
33 CFILES = $(patsubst %,%.c,$(SRCS))
34 OFILES = $(patsubst %.c,%.o,$(CFILES))
37 $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
40 @echo "Please make target \`build-io-lib' setting"
41 @echo "MCU= to the target device (i.e. MCU=18f452)"
44 build-io-lib: build-library clean-intermediate-no-asm
47 $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
49 clean-intermediate-no-asm:
50 $(RM) -f *.lst *.dump* *.p *.d *.adb
53 clean: clean-intermediate
57 $(MAKE) -C ./ build-io-lib MCU=18f452
61 for temp in $(CFILES); do \
62 $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
63 $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
64 $(RM) -f .tmpdepend; \