* device/lib/Makefile.in: removed comment line with model-pic16,
[fw/sdcc] / device / lib / pic16 / libdev / Makefile
1 #
2 # Makefile  - Makefile to build device libraries
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 include ../Makefile.common
15
16 # The SDCC project directory
17 PRJDIR  = ../../../..
18
19 # headers directory
20 INCDIR  = $(PRJDIR)/device/include
21
22
23 # Supported devices
24 DEVS    =       18f242 \
25                 18f248 \
26                 18f252 \
27                 18f258 \
28                 18f442 \
29                 18f448 \
30                 18f452 \
31                 18f458 \
32                 18f1220 \
33                 18f6520 \
34                 18f6620 \
35                 18f6680 \
36                 18f6720 \
37                 18f8520 \
38                 18f8620 \
39                 18f8680 \
40                 18f8720
41
42
43 # pic16 port specific headers
44 PIC16_INCDIR    = $(INCDIR)/pic16
45
46 CFLAGS  = -I$(PIC16_INCDIR)
47
48 #COMPILE_FLAGS  = --pomit-config-words --pomit-ivt --no-peep
49 COMPILE_FLAGS   += $(MODELFLAGS) --nostdinc
50
51
52 CFILES  = $(patsubst %,pic%.c, $(DEVS))
53 OFILES  = $(patsubst %.c,%.o,$(CFILES))
54 LFILES  = $(patsubst %.c,%.lib,$(CFILES))
55
56 PFILE   = $(patsubst pic%.c,%,$<)
57 LFILE   = $(patsubst %.c,%.lib,$<)
58
59
60 .c.o:
61         $(CC) -p$(PFILE) $(CFLAGS) $(COMPILE_FLAGS) -c $<
62
63 %.lib: %.o
64         $(AR) -c $@ $<
65         
66 all: make-lib
67
68 make-lib: $(LFILES)
69         @$(MV) -v $(LFILES) ../bin
70         
71 $(LFILES): $(OFILES)
72
73 $(OFILES): $(CFILES)
74
75
76 clean-intermediate:
77         $(RM) -f *.lst *.asm *.dump*
78         
79 clean: clean-intermediate
80         $(RM) -f *.o
81
82 real-clean: clean
83         $(RM) -f .depend
84
85 dep .depend:
86         rm -f .depend
87         for temp in $(CFILES); do               \
88                 $(CPP) $(MM) $(CFLAGS) $$temp > .tmpdepend;     \
89                 $(SED) s/.rel/.o/g .tmpdepend >> .depend;       \
90                 $(RM) -f .tmpdepend;    \
91         done
92         
93 include .depend