2004-11-04 Vangelis Rokas <vrokas AT otenet.gr>
[fw/sdcc] / device / lib / pic16 / debug / Makefile.rules
1 #
2 # Makefile.rules - Common Makefile rules to build pic16
3 #                  debug library
4 #
5 # This file is part of the GNU PIC Library.
6 #
7 # January, 2004
8 # The GNU PIC Library is maintained by,
9 #       Vangelis Rokas <vrokas@otenet.gr>
10 #
11 # $Id$
12 #
13 #
14
15
16 include ../../Makefile.common
17
18 PRJDIR  = ../../../../..
19
20 LIBC_INC_DIR    = $(PRJDIR)/device/include/pic16
21
22 COMPILE_FLAGS   += $(MODELFLAGS) --pomit-config-words --pomit-ivt --no-peep --i-code-in-asm
23 CFLAGS  = --nostdinc -I$(LIBC_INC_DIR)
24
25 CFILES  = $(patsubst %,%.c,$(SRCS))
26 OFILES  = $(patsubst %.c,%.o,$(CFILES))
27
28 %.o: %.c
29         $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
30
31
32 all: build-library
33
34 clean-intermediate:
35         $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
36
37
38 clean: clean-intermediate
39         $(RM) -f $(LIB) *.o
40
41 dep .depend:
42         rm -f .depend
43         for temp in $(CFILES); do \
44                 $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
45                 $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
46                 $(RM) -f .tmpdepend; \
47         done;
48
49 include .depend