* .version: bumped version number to 2.4.8
[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 COMPILE_FLAGS   += $(MODELFLAGS)
22 COMPILE_FLAGS   += -p$(MCU)
23 #COMPILE_FLAGS  += --pomit-config-words --pomit-ivt
24 COMPILE_FLAGS   += --no-peep
25 COMPILE_FLAGS   += --i-code-in-asm
26 CFLAGS  = -I$(LIBC_INC_DIR)
27
28 CFILES  = $(patsubst %,%.c,$(SRCS))
29 OFILES  = $(patsubst %.c,%.o,$(CFILES))
30
31 %.o: %.c
32         $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
33
34 all:
35         @echo "Please make target build-mcu-library setting"
36         @echo "MCU= to the target device (i.e. MCU=18f452)"
37
38
39 build-mcu-library: build-library clean-intermediate-no-asm
40
41 clean-intermediate:
42         $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
43
44 clean-intermediate-no-asm:
45         $(RM) -f *.lst *.dump* *.p *.d *.adb
46
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
59 include .depend