* src/pic16/device.c (Pics16[]): added devices 18F2550, 18F4331,
[fw/sdcc] / device / lib / pic16 / libio / Makefile.rules
1 #
2 # Makefile.rules - Common Makefile rules to build pic16 C Library
3 #
4 # This file is part of the GNU PIC Library.
5 #
6 # January, 2004
7 # The GNU PIC Library is maintained by,
8 #       Vangelis Rokas <vrokas@otenet.gr>
9 #
10 # $Id$
11 #
12 #
13
14
15 include ../../Makefile.common
16
17 PRJDIR  = ../../../../..
18
19 LIBC_INC_DIR    = $(PRJDIR)/device/include/pic16
20
21
22 COMPILE_FLAGS   += $(MODELFLAGS)
23 COMPILE_FLAGS   += -p$(MCU)
24 COMPILE_FLAGS   += $(OPT_FLAGS)
25 #COMPILE_FLAGS  += --i-code-in-asm
26
27 OPT_FLAGS2      +=
28
29 CFLAGS  = -I$(LIBC_INC_DIR) $(OPT_FLAGS2)
30
31
32 CFILES  = $(patsubst %,%.c,$(SRCS))
33 OFILES  = $(patsubst %.c,%.o,$(CFILES))
34
35 %.o: %.c
36         $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
37
38 all:
39         @echo "Please make target \`build-io-lib' setting"
40         @echo "MCU= to the target device (i.e. MCU=18f452)"
41
42
43 build-io-lib: build-library clean-intermediate-no-asm
44
45 clean-intermediate:
46         $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
47
48 clean-intermediate-no-asm:
49         $(RM) -f *.lst *.dump* *.p *.d *.adb
50
51
52 clean: clean-intermediate
53         $(RM) -f $(LIB) *.o
54
55 ttest:
56         $(MAKE) -C ./ build-io-lib MCU=18f452
57
58 dep .depend:
59         rm -f .depend
60         for temp in $(CFILES); do \
61                 $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
62                 $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
63                 $(RM) -f .tmpdepend; \
64         done;
65
66 include .depend