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
21 COMPILE_FLAGS += $(MODELFLAGS)
22 COMPILE_FLAGS += -p$(MCU)
23 #COMPILE_FLAGS += --pomit-config-words --pomit-ivt
24 COMPILE_FLAGS += --no-peep
25 COMPILE_FLAGS += --i-code-in-asm
26 CFLAGS = -I$(LIBC_INC_DIR)
28 CFILES = $(patsubst %,%.c,$(SRCS))
29 OFILES = $(patsubst %.c,%.o,$(CFILES))
32 $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
35 @echo "Please make target build-mcu-library setting"
36 @echo "MCU= to the target device (i.e. MCU=18f452)"
39 build-mcu-library: build-library clean-intermediate-no-asm
42 $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
44 clean-intermediate-no-asm:
45 $(RM) -f *.lst *.dump* *.p *.d *.adb
48 clean: clean-intermediate
53 for temp in $(CFILES); do \
54 $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
55 $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
56 $(RM) -f .tmpdepend; \