* device/include/pic16/string.h: modified prototype for memccpy()
[fw/sdcc] / device / lib / pic16 / libsdcc / Makefile.rules
1 #
2 # Makefile.rules - Common Makefile rules to build pic16
3 #                  support libraries
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 #OPT_FLAGS      += --stack-auto
23 COMPILE_FLAGS   += $(MODELFLAGS) $(OPT_FLAGS)
24
25 CFLAGS  = --nostdinc -I$(LIBC_INC_DIR)
26
27 CFILES  = $(patsubst %,%.c,$(SRCS))
28 OFILES  = $(patsubst %.c,%.o,$(CFILES))
29
30 SFILES  = $(patsubst %,%.S,$(AS_SRCS))
31 SOFILES = $(patsubst %.S,%.o,$(SFILES))
32
33 %.o: %.c
34         $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
35
36 .S.o:
37         $(AS) -c $<
38
39
40 all: build-library clean-intermediate-no-asm
41
42 clean-intermediate:
43         $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
44
45 clean-intermediate-no-asm:
46         $(RM) -f *.lst *.dump* *.p *.d *.adb
47
48 clean: clean-intermediate
49         $(RM) -f $(LIB) *.o
50
51 dep .depend:
52         rm -f .depend
53         for temp in $(CFILES); do \
54                 $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
55                 $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
56                 $(RM) -f .tmpdepend; \
57         done;
58         if [ ! -e .depend ]; then touch .depend ; fi ;
59 include .depend