* .version: bumped version number to 2.4.8
[fw/sdcc] / device / lib / pic16 / libio / Makefile
1 #
2 # Makefile - Makefile to build pic16 support 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 MCUS    = $(shell cat ../pics.build)
15
16 PROCESSORS      = $(MCUS)
17
18
19 DIRS    = adc i2c
20
21 LOBJS   = $(patsubst %,%/*.o,$(DIRS))
22
23 # library name example libio18f8720.lib
24 LIB     = libio18f$(MMCU).lib
25
26 all: build-libraries
27
28 make-target: build-libraries
29
30 build-libraries:
31         for proc in $(PROCESSORS) ; do \
32                 echo "Building libraries for processor pic18f $$proc" ; \
33                 $(MAKE) -C . build-processor-library MMCU=$$proc ;  \
34         done ;
35
36 # Should have externally specified PROC
37 build-processor-library:
38         for dir in $(DIRS) ; do  \
39                 $(MAKE) -C $$dir clean ; \
40                 $(MAKE) -C $$dir build-mcu-library MCU=18f$(MMCU); \
41         done;
42         gplib -c $(LIB) $(LOBJS)
43         mv -v $(LIB) ../bin
44         
45
46 clean-intermediate:
47         @for dir in $(DIRS) ; do \
48                 $(MAKE) -C $$dir clean-intermediate ; \
49         done ;
50         
51 clean:
52         for dir in $(DIRS) ; do \
53                 $(MAKE) -C $$dir clean; \
54         done ;
55         rm -fv $(LIB)
56
57
58 real-clean: clean
59         find -name *.adb -print | xargs -- rm -fv ;
60         find -name *.p -print | xargs -- rm -fv ;
61         find -name *.d -print | xargs -- rm -fv ;
62         find -name *.dump* -print | xargs -- rm -fv ;
63         
64
65 dep:
66         for dir in $(DIRS) ; do \
67                 $(MAKE) -C $$dir dep; \
68         done