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