* src/pic16/gen.c (genrshTwo): fixed sign extension
[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 COMPILE_FLAGS   += $(CSTD)
27
28 OPT_FLAGS2      +=
29
30 CFLAGS  = -I$(LIBC_INC_DIR) $(OPT_FLAGS2)
31
32
33 CFILES  = $(patsubst %,%.c,$(SRCS))
34 OFILES  = $(patsubst %.c,%.o,$(CFILES))
35
36 %.o: %.c
37         $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
38
39 all:
40         @echo "Please make target \`build-io-lib' setting"
41         @echo "MCU= to the target device (i.e. MCU=18f452)"
42
43
44 build-io-lib: build-library clean-intermediate-no-asm
45
46 clean-intermediate:
47         $(RM) -f *.lst *.asm *.dump* *.p *.d *.adb
48
49 clean-intermediate-no-asm:
50         $(RM) -f *.lst *.dump* *.p *.d *.adb
51
52
53 clean: clean-intermediate
54         $(RM) -f $(LIB) *.o
55
56 ttest:
57         $(MAKE) -C ./ build-io-lib MCU=18f452
58
59 dep .depend:
60         rm -f .depend
61         for temp in $(CFILES); do \
62                 $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend; \
63                 $(SED) s/.rel/.o/g .tmpdepend >> .depend; \
64                 $(RM) -f .tmpdepend; \
65         done;
66
67 include .depend