* device/lib/Makefile.in: fixed test for pic16 install dir
[fw/sdcc] / device / lib / pic16 / startup / Makefile
1 #
2 # Makefile - Makefile to build startup files
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 PRJDIR  = ../../../..
16 include ../Makefile.common
17
18
19 SRCS    =       crt0    \
20                 crt0i   \
21                 crt0iz
22
23
24 # add nostdinc and nostdlib for this device libraries
25 COMPILE_FLAGS   += --denable-peeps --optimize-goto --obanksel=2 --pomit-config-words --pomit-ivt
26 COMPILE_FLAGS   += $(MODELFLAGS) --nostdinc --nostdlib
27
28 CFILES  = $(patsubst %,%.c,$(SRCS))
29 OFILES  = $(patsubst %.c,%.o,$(CFILES))
30
31
32 %.o: %.c
33         $(CC) $(CFLAGS) $(COMPILE_FLAGS) -c $<
34
35
36 all: build-library
37         @$(CP) -v $(OFILES) ../bin
38
39 build-library: compile-sources
40
41 compile-sources: $(OFILES)
42
43
44 clean:
45         rm -f *.o *.lst *.asm
46
47
48 clean-intermediate:
49         $(RM) -f *.lst *.asm *.dump*
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