2 # Makefile.rules - Common Makefile rules to build pic16
5 # This file is part of the GNU PIC Library.
8 # The GNU PIC Library is maintained by,
9 # Vangelis Rokas <vrokas@otenet.gr>
16 include ../../Makefile.common
18 PRJDIR = ../../../../..
20 LIBC_INC_DIR = $(PRJDIR)/device/include/pic16
22 COMPILE_FLAGS += $(MODELFLAGS) $(OPT_FLAGS)
24 CPPFLAGS := -nostdinc -I$(LIBC_INC_DIR)
25 CFLAGS += --nostdinc -I$(LIBC_INC_DIR)
27 CFILES = $(patsubst %,%.c,$(SRCS))
28 OFILES = $(patsubst %.c,%.o,$(CFILES))
31 $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
37 $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
40 clean: clean-intermediate
45 for temp in $(CFILES); do \
46 $(CPP) $(MM) $(CPPFLAGS) $$temp > .tmpdepend; \
47 $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
48 $(RM) -f .tmpdepend; \