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 CFLAGS = --nostdinc -I$(LIBC_INC_DIR)
26 CFILES = $(patsubst %,%.c,$(SRCS))
27 OFILES = $(patsubst %.c,%.o,$(CFILES))
30 $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
36 $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
39 clean: clean-intermediate
44 for temp in $(CFILES); do \
45 $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
46 $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
47 $(RM) -f .tmpdepend; \