* device/lib/makefile.in: added abs.c and labs.c
[fw/sdcc] / device / lib / Makefile.in
1 #
2 #
3 #
4
5 VERSION         = @VERSION@
6 VERSIONHI       = @VERSIONHI@
7 VERSIONLO       = @VERSIONLO@
8 VERSIONP        = @VERSIONP@
9
10 SHELL           = /bin/sh
11 CPP             = @CPP@
12 INSTALL         = @INSTALL@
13 CP              = @CP@
14
15 PRJDIR          = ../..
16 INCDIR          = $(PRJDIR)/device/include
17
18 CC              = $(PRJDIR)/bin/sdcc
19 CPP             = $(PRJDIR)/bin/sdcpp
20
21 prefix          = @prefix@
22 exec_prefix     = @exec_prefix@
23 bindir          = @bindir@
24 libdir          = @libdir@
25 datadir         = @datadir@
26 includedir      = @includedir@
27 mandir          = @mandir@
28 man1dir         = $(mandir)/man1
29 man2dir         = $(mandir)/man2
30 infodir         = @infodir@
31 srcdir          = @srcdir@
32
33 lib_dir_suffix  = @lib_dir_suffix@
34
35 sdcc_libdir     = $(DESTDIR)$(datadir)/$(lib_dir_suffix)
36
37 CPPFLAGS        = -I$(INCDIR)
38 CFLAGS          = $(MODELFLAGS) --nostdinc
39
40 BUILDDIR        = build
41 # Default
42 PORT            = z80
43 PORTDIR         = $(BUILDDIR)/$(PORT)
44
45 SOURCES         = _atof.c _atoi.c _atol.c _autobaud.c _bp.c _schar2fs.c \
46                   _decdptr.c _divsint.c _divslong.c _divuint.c \
47                   _divulong.c _fs2schar.c _fs2sint.c _fs2slong.c \
48                   _fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \
49                   _fsdiv.c _fseq.c _fsgt.c _fslt.c _fscmp.c _fsmul.c \
50                   _fsneq.c _fssub.c _gptrget.c _gptrgetc.c _gptrput.c \
51                   _sint2fs.c _iscntrl.c _isdigit.c _isgraph.c \
52                   _islower.c _isprint.c _ispunct.c _isspace.c \
53                   _isupper.c _isxdigit.c _itoa.c _ltoa.c \
54                   _slong2fs.c \
55                   _memcmp.c _memcpy.c _memmove.c _memset.c \
56                   _modsint.c _modslong.c _moduint.c _modulong.c \
57                   _mulint.c _mullong.c \
58                   abs.c labs.c \
59                   _ser.c _setjmp.c \
60                   _spx.c _startup.c \
61                   _strcat.c _strchr.c _strcmp.c _strcpy.c \
62                   _strcspn.c _strlen.c _strncat.c _strncmp.c \
63                   _strncpy.c _strpbrk.c _strrchr.c _strspn.c \
64                   _strstr.c _strtok.c \
65                   _uchar2fs.c _uint2fs.c _ulong2fs.c \
66                   calloc.c malloc.c realloc.c free.c \
67                   serial.c ser_ir.c printfl.c \
68                   printf_large.c sprintf.c vprintf.c puts.c gets.c \
69                   printf_fast.c printf_fast_f.c printf_tiny.c \
70                   assert.c time.c bpx.c \
71                   _fsget1arg.c _fsget2args.c _fsnormalize.c \
72                   _fsreturnval.c _fsrshift.c _fsswapargs.c _logexpf.c \
73                   fabsf.c frexpf.c ldexpf.c expf.c powf.c sincosf.c sinf.c \
74                   cosf.c logf.c log10f.c sqrtf.c tancotf.c tanf.c cotf.c \
75                   asincosf.c asinf.c acosf.c atanf.c atan2f.c sincoshf.c \
76                   sinhf.c coshf.c tanhf.c floorf.c ceilf.c modff.c errno.c
77
78 OBJECTS         = $(patsubst %.c,$(PORTDIR)/%.rel,$(SOURCES))
79
80 Z80SOURCES      = _atof.c _atoi.c \
81                   _iscntrl.c _isdigit.c _isgraph.c \
82                   _islower.c _isprint.c _ispunct.c _isspace.c \
83                   _isupper.c _isxdigit.c \
84                   _memcmp.c _memcpy.c _memmove.c _memset.c \
85                   _startup.c \
86                   _strcat.c _strchr.c _strcmp.c _strcpy.c \
87                   _strcspn.c _strlen.c _strncat.c _strncmp.c \
88                   _strncpy.c _strpbrk.c _strrchr.c _strspn.c \
89                   _strstr.c _strtok.c \
90                   assert.c \
91                   _modslong.c _modulong.c \
92                   _mullong.c \
93                   abs.c labs.c \
94                   _divslong.c _divulong.c \
95                   calloc.c malloc.c realloc.c free.c \
96                   printf_large.c sprintf.c vprintf.c puts.c gets.c \
97                   _fs2schar.c _fs2sint.c _fs2slong.c \
98                   _fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \
99                   _fsdiv.c _fseq.c _fsgt.c _fslt.c _fsmul.c \
100                   _fsneq.c _fssub.c \
101                   _uchar2fs.c _uint2fs.c \
102                   _ulong2fs.c \
103                   _slong2fs.c _sint2fs.c _schar2fs.c
104
105 Z80OBJECTS      = $(Z80SOURCES:%.c=$(PORTDIR)/%.o)
106
107 XA51SOURCES      = _atof.c _atoi.c _atol.c _schar2fs.c \
108                   _divsint.c _divslong.c _divuint.c \
109                   _divulong.c _fs2schar.c _fs2sint.c _fs2slong.c \
110                   _fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \
111                   _fsdiv.c _fseq.c _fsgt.c _fslt.c _fsmul.c \
112                   _fsneq.c _fssub.c \
113                   _sint2fs.c _iscntrl.c _isdigit.c _isgraph.c \
114                   _islower.c _isprint.c _ispunct.c _isspace.c \
115                   _isupper.c _isxdigit.c _slong2fs.c _memcmp.c \
116                   _memcpy.c _memmove.c _memset.c _modsint.c _modslong.c \
117                   _moduint.c _modulong.c _mulint.c _mullong.c \
118                   abs.c labs.c \
119                   _strcat.c _strchr.c _strcmp.c _strcpy.c \
120                   _strcspn.c _strlen.c _strncat.c _strncmp.c \
121                   _strncpy.c _strpbrk.c _strrchr.c _strspn.c \
122                   _strstr.c _strtok.c \
123                   _uchar2fs.c _uint2fs.c _ulong2fs.c \
124                   calloc.c malloc.c realloc.c free.c \
125                   puts.c gets.c \
126                   printf_large.c puts.c gets.c \
127                   assert.c time.c \
128                   fabsf.c frexpf.c ldexpf.c expf.c powf.c sincosf.c sinf.c \
129                   cosf.c logf.c log10f.c sqrtf.c tancotf.c tanf.c cotf.c \
130                   asincosf.c asinf.c acosf.c atanf.c atan2f.c sincoshf.c \
131                   sinhf.c coshf.c tanhf.c floorf.c ceilf.c modff.c errno.c
132
133 XA51OBJECTS      = $(XA51SOURCES:%.c=$(PORTDIR)/%.rel)
134
135 HC08SOURCES     = _atof.c _atoi.c _atol.c _schar2fs.c \
136                   _divsint.c _divslong.c \
137                   _fs2schar.c _fs2sint.c _fs2slong.c \
138                   _fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \
139                   _fsdiv.c _fseq.c _fsgt.c _fslt.c _fsmul.c \
140                   _fsneq.c _fssub.c \
141                   _sint2fs.c _iscntrl.c _isdigit.c _isgraph.c \
142                   _islower.c _isprint.c _ispunct.c _isspace.c \
143                   _isupper.c _isxdigit.c _itoa.c _ltoa.c \
144                   _slong2fs.c \
145                   _memcmp.c _memcpy.c _memmove.c _memset.c \
146                   _modsint.c _modslong.c _moduint.c _modulong.c \
147                   abs.c labs.c \
148                   _spx.c _startup.c \
149                   _strcat.c _strchr.c _strcmp.c _strcpy.c \
150                   _strcspn.c _strlen.c _strncat.c _strncmp.c \
151                   _strncpy.c _strpbrk.c _strrchr.c _strspn.c \
152                   _strstr.c _strtok.c \
153                   _uchar2fs.c _uint2fs.c _ulong2fs.c \
154                   calloc.c malloc.c realloc.c free.c \
155                   printf_large.c sprintf.c vprintf.c \
156                   assert.c time.c \
157                   fabsf.c frexpf.c ldexpf.c expf.c powf.c sincosf.c sinf.c \
158                   cosf.c logf.c log10f.c sqrtf.c tancotf.c tanf.c cotf.c \
159                   asincosf.c asinf.c acosf.c atanf.c atan2f.c sincoshf.c \
160                   sinhf.c coshf.c tanhf.c floorf.c ceilf.c modff.c errno.c
161
162 HC08OBJECTS     = $(patsubst %.c,$(PORTDIR)/%.rel,$(HC08SOURCES))
163
164 OEXT            = .rel
165
166 include incl.mk
167
168 # Compiling entire program or any subproject
169 # ------------------------------------------
170 all: checkconf models model-ds390 model-ds400 model-z80 model-gbz80 model-hc08
171
172 # model-pic16
173 # (needs gputils curently not available of sourceforge's compile farm)
174
175 objects: build-dir $(OBJECTS) port-specific-objects lib-files clean_intermediate
176
177 models:
178         if [ "`grep mcs51 ../../ports.build`" = mcs51 ]; then \
179           for model in $(MODELS); do \
180             $(MAKE) MODELFLAGS="--model-$$model" PORT=$$model objects; \
181           done \
182         fi
183
184 model-mcs51-stack-auto:
185         if [ "`grep mcs51 ../../ports.build`" = mcs51 ]; then \
186           for model in $(MODELS); do \
187             $(MAKE) MODELFLAGS="--model-$$model --stack-auto" PORT=$$model-stack-auto objects; \
188           done \
189         fi
190
191 model-mcs51-xstack-auto:
192         if [ "`grep mcs51 ../../ports.build`" = mcs51 ]; then \
193           for model in $(MODELS); do \
194             $(MAKE) MODELFLAGS="--model-$$model --stack-auto --xstack" PORT=$$model-xstack-auto objects; \
195           done \
196         fi
197
198 model-ds390:
199         if [ "`grep ds390 ../../ports.build`" = ds390 ]; then \
200           $(MAKE) MODELFLAGS="-mds390" PORT=ds390 objects; \
201         fi
202
203 model-ds400:
204         if [ "`grep ds400 ../../ports.build`" = ds400 ]; then \
205           $(MAKE) MODELFLAGS="-mds400" PORT=ds400 objects; \
206         fi
207
208 model-xa51:
209         if [ "`grep xa51 ../../ports.build`" = xa51 ]; then \
210           $(MAKE) MODELFLAGS="-mxa51" PORT=xa51 objects-xa51; \
211         fi
212
213 objects-xa51: build-dir $(XA51OBJECTS) port-specific-objects
214         cd $(PORTDIR); ls *$(OEXT) > lib$(PORT).lib
215
216 model-z80:
217         if [ "`grep z80 ../../ports.build`" = z80 ]; then \
218           $(MAKE) MODELFLAGS="-mz80" PORT=z80 objects-z80 OEXT=.o; \
219         fi
220
221 model-gbz80:
222         if [ "`grep z80 ../../ports.build`" = z80 ]; then \
223           $(MAKE) MODELFLAGS="-mgbz80" PORT=gbz80 objects-z80 OEXT=.o; \
224         fi
225
226 objects-z80: build-dir $(Z80OBJECTS) port-specific-objects clean_intermediate
227         cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
228
229 model-hc08:
230         if [ "`grep hc08 ../../ports.build`" = hc08 ]; then \
231           $(MAKE) MODELFLAGS="-mhc08" PORT=hc08 objects-hc08; \
232         fi
233
234 objects-hc08: build-dir $(HC08OBJECTS) port-specific-objects clean_intermediate
235         cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
236
237 model-pic16:
238         if [ "`grep pic16 ../../ports.build`" = pic16 ]; then \
239           $(MAKE) MODELFLAGS="-mpic16" PORT=pic16 OEXT=.lib objects-pic16; \
240           fi
241
242 objects-pic16: build-dir port-specific-objects-pic16 clean_intermediate-pic16
243         cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
244
245
246 build-dir: $(PORTDIR)
247
248 $(PORTDIR):
249         mkdir -p $(PORTDIR)
250
251 port-specific-objects:
252         if [ -d $(PORT) ]; then \
253           $(MAKE) -C $(PORT); \
254           cp -f $(PORT)/*.lib $(PORT)/*$(OEXT) $(PORTDIR); \
255         fi
256
257 port-specific-objects-pic16:
258         if [ -d $(PORT) ]; then \
259           $(MAKE) -C $(PORT); \
260           cp -f $(PORT)/bin/*.* $(PORTDIR); \
261         fi
262
263 lib-files:
264         cp *.lib $(PORTDIR)
265
266 clean_intermediate:
267         rm -f $(PORTDIR)/*.lst $(PORTDIR)/*.sym
268
269 clean_intermediate-pic16:
270         $(MAKE) -C $(PORT) clean-intermediate
271
272 # Compiling and installing everything and runing test
273 # ---------------------------------------------------
274 install: all installdirs
275         cp -r -u $(BUILDDIR)/* $(sdcc_libdir)
276         cp -r -u ds390 ds400 gbz80 z80 hc08 *.c $(sdcc_libdir)/src
277         rm -r `find $(sdcc_libdir)/src -name '*.rel' -or -name '*.dump*' -or -name '*.sym' -or -name '*.o' -or -name '*.lst' -or -name '*.asm' -or -name 'CVS'`
278
279 # Deleting all the installed files
280 # --------------------------------
281 uninstall:
282         rm -rf $(sdcc_libdir)
283
284 # Performing self-test
285 # --------------------
286 check:
287
288
289 # Performing installation test
290 # ----------------------------
291 installcheck:
292
293
294 # Creating installation directories
295 # ---------------------------------
296 installdirs:
297         [ -d $(sdcc_libdir) ] || mkdir -p $(sdcc_libdir)
298         for model in $(MODELS); do \
299          [ -d $(sdcc_libdir)/$$model ] || \
300          mkdir -p $(sdcc_libdir)/$$model; \
301         done
302         [ -d $(sdcc_libdir)/ds390 ] || mkdir -p $(sdcc_libdir)/ds390
303         [ -d $(sdcc_libdir)/ds400 ] || mkdir -p $(sdcc_libdir)/ds400
304         [ -d $(sdcc_libdir)/hc08 ] || mkdir -p $(sdcc_libdir)/hc08
305         [ -d $(sdcc_libdir)/pic16 ] || mkdir -p $(sdcc_libdir)/pic16
306         mkdir -p $(sdcc_libdir)/src
307
308 # Creating dependencies
309 # ---------------------
310 dep: Makefile.dep
311
312 Makefile.dep: $(SOURCES) $(INCDIR)/*.h
313         rm -f Makefile.dep
314         for i in $(SOURCES); do \
315           $(CPP) -std=c99 -M $(CPPFLAGS) $$i >$${i}.dep; \
316           cat $${i}.dep >>Makefile.dep; \
317           rm $${i}.dep; \
318         done
319
320 include Makefile.dep
321 include clean.mk
322
323 # My rules
324 # --------
325
326 .SUFFIXES: .rel .o
327
328 $(PORTDIR)/%$(OEXT): %.c
329         $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
330
331 # Remaking configuration
332 # ----------------------
333 checkconf:
334         @if [ -f $(PRJDIR)/devel ]; then\
335           $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
336           freshconf;\
337         fi
338
339 # End of main_in.mk/main.mk