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