Add inttypes.h and missing dependencies.
[sdcc.git] / sdcc / device / lib / Makefile.in
blob77ea80d5ce2a7fc05271d59f717a425c5bc68c59
5 VERSION = @VERSION@
6 VERSIONHI = @VERSIONHI@
7 VERSIONLO = @VERSIONLO@
8 VERSIONP = @VERSIONP@
10 SHELL = /bin/sh
11 INSTALL = @INSTALL@
12 CP = @CP@
14 LIB_TYPE = @LIB_TYPE@
16 ifeq ($(shell uname -s),Linux)
17 CP_U = $(CP) -u
18 else
19 CP_U = $(CP)
20 endif
22 top_builddir = @top_builddir@
23 abs_top_builddir= @abs_top_builddir@
24 top_srcdir = @top_srcdir@
25 VPATH = @srcdir@
26 srcdir = @srcdir@
27 INCDIR = $(top_srcdir)/device/include
28 ifndef PORTINCDIR
29 PORTINCDIR = $(INCDIR)/mcs51
30 endif
32 CC = $(top_builddir)/bin/sdcc
33 # The predefined macros reflect what SDCC predefines (so we don't get any errors when generating Makefile.dep).
34 CPP = $(top_builddir)/bin/sdcpp -D__STDC_ISO_10646__=201409L
35 SDAR = $(abs_top_builddir)/bin/sdar
37 prefix = @prefix@
38 exec_prefix = @exec_prefix@
39 bindir = @bindir@
40 libdir = @libdir@
41 datadir = @datadir@
42 datarootdir = @datarootdir@
43 includedir = @includedir@
44 mandir = @mandir@
45 man1dir = $(mandir)/man1
46 man2dir = $(mandir)/man2
47 infodir = @infodir@
49 lib_dir_suffix = @lib_dir_suffix@
51 sdcc_libdir = $(DESTDIR)$(datadir)/$(lib_dir_suffix)
53 CPPFLAGS = -I$(INCDIR) -I$(PORTINCDIR)
54 CFLAGS = $(MODELFLAGS) --nostdinc --std-c2x
56 BUILDDIR = build
57 # Default
58 PORT = z80
59 ifndef PORTDIR
60 PORTDIR = $(BUILDDIR)/$(PORT)
61 endif
63 OPT_DISABLE_AVR = @OPT_DISABLE_AVR@
64 OPT_DISABLE_DS390 = @OPT_DISABLE_DS390@
65 OPT_DISABLE_DS400 = @OPT_DISABLE_DS400@
66 OPT_DISABLE_HC08 = @OPT_DISABLE_HC08@
67 OPT_DISABLE_S08 = @OPT_DISABLE_S08@
68 OPT_DISABLE_MCS51 = @OPT_DISABLE_MCS51@
69 OPT_DISABLE_PIC14 = @OPT_DISABLE_PIC14@
70 OPT_DISABLE_PIC16 = @OPT_DISABLE_PIC16@
71 OPT_DISABLE_XA51 = @OPT_DISABLE_XA51@
72 OPT_DISABLE_Z80 = @OPT_DISABLE_Z80@
73 OPT_DISABLE_Z180 = @OPT_DISABLE_Z180@
74 OPT_DISABLE_EZ80_Z80 = @OPT_DISABLE_EZ80_Z80@
75 OPT_DISABLE_Z80N = @OPT_DISABLE_Z80N@
76 OPT_DISABLE_R2K = @OPT_DISABLE_R2K@
77 OPT_DISABLE_R2KA = @OPT_DISABLE_R2KA@
78 OPT_DISABLE_R3KA = @OPT_DISABLE_R3KA@
79 OPT_DISABLE_TLCS90 = @OPT_DISABLE_TLCS90@
80 OPT_DISABLE_SM83 = @OPT_DISABLE_SM83@
81 OPT_DISABLE_STM8 = @OPT_DISABLE_STM8@
82 OPT_DISABLE_PDK13 = @OPT_DISABLE_PDK13@
83 OPT_DISABLE_PDK14 = @OPT_DISABLE_PDK14@
84 OPT_DISABLE_PDK15 = @OPT_DISABLE_PDK15@
85 OPT_DISABLE_MOS6502 = @OPT_DISABLE_MOS6502@
86 OPT_DISABLE_MOS65C02 = @OPT_DISABLE_MOS65C02@
88 SOURCES_FLOAT = $(COMMON_FLOAT) \
89 _fscmp.c \
90 _fsget1arg.c \
91 _fsget2args.c \
92 _fsnormalize.c \
93 _fsreturnval.c \
94 _fsrshift.c \
95 _fsswapargs.c \
96 _logexpf.c
98 SOURCES_INT = $(COMMON_INT) \
99 _divsint.c \
100 _divuint.c \
101 _modsint.c \
102 _moduint.c \
103 _mulint.c
105 SOURCES_LONG = $(COMMON_LONG) \
106 _divulong.c \
107 _mullong.c
109 SOURCES_LONGLONG = $(COMMON_LONGLONG) \
110 _rrulonglong.c \
111 _rrslonglong.c \
112 _rlulonglong.c \
113 _rlslonglong.c \
114 _mullonglong.c \
115 _divslonglong.c \
116 _divulonglong.c \
117 _modslonglong.c \
118 _modulonglong.c
120 SOURCES_SDCC = $(COMMON_SDCC) \
121 _autobaud.c \
122 _bp.c \
123 _decdptr.c \
124 _gptrget.c \
125 _gptrgetc.c \
126 _gptrput.c \
127 _ser.c \
128 _setjmp.c \
129 serial.c \
130 __itoa.c \
131 __ltoa.c \
132 _spx.c \
133 _startup.c \
134 _strcmp.c \
135 _strlen.c \
136 __memcpy.c \
137 memcpy.c \
138 _memmove.c \
139 _strcpy.c \
140 _heap.c \
141 div.c \
142 ldiv.c \
143 lldiv.c \
144 imaxdiv.c \
145 sprintf.c \
146 vprintf.c \
147 printf_fast.c \
148 printf_fast_f.c \
149 printf_tiny.c \
150 printfl.c \
151 bpx.c
153 SOURCES = $(SOURCES_FLOAT) $(SOURCES_INT) $(SOURCES_LONG) $(SOURCES_LONGLONG) $(SOURCES_SDCC)
155 OBJECTS_FLOAT = $(SOURCES_FLOAT:%.c=$(PORT)/%.rel)
156 OBJECTS_INT = $(SOURCES_INT:%.c=$(PORT)/%.rel)
157 OBJECTS_LONG = $(SOURCES_LONG:%.c=$(PORT)/%.rel)
158 OBJECTS_LONGLONG = $(SOURCES_LONGLONG:%.c=$(PORT)/%.rel)
159 OBJECTS_SDCC = $(SOURCES_SDCC:%.c=$(PORT)/%.rel)
161 OBJECTS = $(OBJECTS_FLOAT) $(OBJECTS_INT) $(OBJECTS_LONG) $(OBJECTS_LONGLONG) $(OBJECTS_SDCC)
163 XA51_FLOAT = $(COMMON_FLOAT)
165 XA51_INT = $(COMMON_INT) \
166 _divsint.c \
167 _divuint.c \
168 _modsint.c \
169 _moduint.c \
170 _mulint.c
172 XA51_LONG = $(COMMON_LONG) \
173 _divulong.c \
174 _mullong.c
176 XA51_SDCC = $(COMMON_SDCC) \
177 _memmove.c \
178 _strlen.c \
179 _heap.c \
180 div.c \
181 ldiv.c \
182 lldiv.rel
184 XA51SOURCES = $(XA51_FLOAT) $(XA51_INT) $(XA51_LONG) $(XA51_SDCC)
185 XA51OBJECTS = $(XA51SOURCES:%.c=$(PORT)/%.rel)
187 LIB_FILES = $(PORTDIR)/libfloat.lib $(PORTDIR)/libint.lib $(PORTDIR)/liblong.lib $(PORTDIR)/liblonglong.lib $(PORTDIR)/libsdcc.lib
189 OEXT = .rel
191 include $(srcdir)/incl.mk
193 ifeq ($(OPT_DISABLE_DS390), 0)
194 TARGETS += model-ds390
195 endif
197 ifeq ($(OPT_DISABLE_DS400), 0)
198 TARGETS += model-ds400
199 endif
201 ifeq ($(OPT_DISABLE_HC08), 0)
202 TARGETS += model-hc08
203 endif
205 ifeq ($(OPT_DISABLE_S08), 0)
206 TARGETS += model-s08
207 TARGETS += model-s08-stack-auto
208 endif
210 ifeq ($(OPT_DISABLE_MOS6502), 0)
211 TARGETS += model-mos6502
212 TARGETS += model-mos6502-stack-auto
213 endif
215 ifeq ($(OPT_DISABLE_MOS65C02), 0)
216 TARGETS += model-mos65c02
217 endif
219 ifeq ($(OPT_DISABLE_MCS51), 0)
220 TARGETS += models small-mcs51-stack-auto large-mcs51-stack-auto
221 endif
223 ifeq ($(OPT_DISABLE_PIC14), 0)
224 TARGETS += model-pic14
225 endif
227 ifeq ($(OPT_DISABLE_PIC16), 0)
228 TARGETS += model-pic16
229 endif
231 ifeq ($(OPT_DISABLE_Z80), 0)
232 TARGETS += model-z80
233 endif
235 ifeq ($(OPT_DISABLE_Z180), 0)
236 TARGETS += model-z180
237 endif
239 ifeq ($(OPT_DISABLE_EZ80_Z80), 0)
240 TARGETS += model-ez80_z80
241 endif
243 ifeq ($(OPT_DISABLE_Z80N), 0)
244 TARGETS += model-z80n
245 endif
247 ifeq ($(OPT_DISABLE_R2K), 0)
248 TARGETS += model-r2k
249 endif
251 ifeq ($(OPT_DISABLE_R2KA), 0)
252 TARGETS += model-r2ka
253 endif
255 ifeq ($(OPT_DISABLE_R3KA), 0)
256 TARGETS += model-r3ka
257 endif
259 ifeq ($(OPT_DISABLE_TLCS90), 0)
260 TARGETS += model-tlcs90
261 endif
263 ifeq ($(OPT_DISABLE_SM83), 0)
264 TARGETS += model-sm83
265 endif
267 ifeq ($(OPT_DISABLE_STM8), 0)
268 TARGETS += model-stm8
269 TARGETS += model-stm8-large
270 endif
272 ifeq ($(OPT_DISABLE_PDK13), 0)
273 TARGETS += model-pdk13
274 endif
276 ifeq ($(OPT_DISABLE_PDK14), 0)
277 TARGETS += model-pdk14
278 endif
280 ifeq ($(OPT_DISABLE_PDK15), 0)
281 TARGETS += model-pdk15
282 TARGETS += model-pdk15-stack-auto
283 endif
285 # Compiling entire program or any subproject
286 # ------------------------------------------
287 all:
288 $(MAKE) checkconf
289 ifneq ($(TARGETS), )
290 $(MAKE) $(TARGETS)
291 endif
293 objects:
294 $(MAKE) build-dir
295 $(MAKE) $(OBJECTS)
296 $(MAKE) port-specific-objects
297 $(MAKE) $(LIB_FILES)
298 $(MAKE) clean_intermediate
300 models:
301 if grep '^mcs51$$' $(top_builddir)/ports.build > /dev/null; then \
302 for model in $(MODELS); do \
303 $(MAKE) MODELFLAGS="--model-$$model" PORT=$$model PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
304 done \
307 small-mcs51-stack-auto:
308 if grep '^mcs51$$' $(top_builddir)/ports.build > /dev/null; then \
309 mkdir -p small-stack-auto; cp small/Makefile small-stack-auto; \
310 $(MAKE) MODELFLAGS="--model-small --stack-auto" PORT=small-stack-auto PORTDIR=$(BUILDDIR)/small-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
313 large-mcs51-stack-auto:
314 if grep '^mcs51$$' $(top_builddir)/ports.build > /dev/null; then \
315 mkdir -p large-stack-auto; cp small/Makefile large-stack-auto; \
316 $(MAKE) MODELFLAGS="--model-large --stack-auto" PORT=large-stack-auto PORTDIR=$(BUILDDIR)/large-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
319 model-mcs51-stack-auto:
320 if grep '^mcs51$$' $(top_builddir)/ports.build > /dev/null; then \
321 for model in $(MODELS); do \
322 mkdir -p $${model}-stack-auto; cp $${model}/Makefile $${model}-stack-auto; \
323 $(MAKE) MODELFLAGS="--model-$$model --stack-auto" PORT=$${model}-stack-auto PORTDIR=$(BUILDDIR)/$${model}-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
324 done \
327 model-mcs51-xstack-auto:
328 if grep '^mcs51$$' $(top_builddir)/ports.build > /dev/null; then \
329 for model in $(MODELS); do \
330 mkdir -p $${model}-xstack-auto; cp $${model}/Makefile $${model}-xstack-auto; \
331 $(MAKE) MODELFLAGS="--model-$$model --stack-auto --xstack" PORT=$${model}-xstack-auto PORTDIR=$(BUILDDIR)/$${model}-xstack-auto PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
332 done \
335 model-ds390:
336 if grep '^ds390$$' $(top_builddir)/ports.build > /dev/null; then \
337 $(MAKE) MODELFLAGS="-mds390" PORT=ds390 PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
340 model-ds400:
341 if grep '^ds390$$' $(top_builddir)/ports.build > /dev/null; then \
342 $(MAKE) MODELFLAGS="-mds400" PORT=ds400 PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
345 model-xa51:
346 if grep '^xa51$$' $(top_builddir)/ports.build > /dev/null; then \
347 $(MAKE) MODELFLAGS="-mxa51" PORT=xa51 objects-xa51 || exit 1; \
350 objects-xa51:
351 $(MAKE) build-dir
352 $(MAKE) $(XA51OBJECTS)
353 $(MAKE) port-specific-objects
355 $(PORTDIR)/lib$(PORT).lib: $(XA51OBJECTS)
356 rm -f $(PORTDIR)/lib$(PORT).lib
357 ifeq ($(LIB_TYPE), SDCCLIB)
358 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS)
359 else
360 ifeq ($(LIB_TYPE), AR)
361 ${SDAR} -rcSD $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS)
362 else
363 ifeq ($(LIB_TYPE), RANLIB)
364 ${SDAR} -rcD $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS)
365 else
366 rm -f $(PORTDIR)/lib$(PORT).lib
367 for i in $(notdir $(basename $(XA51OBJECTS))); do echo $$i >> $(PORTDIR)/lib$(PORT).lib; done
368 cp $(XA51OBJECTS) $(PORTDIR)
369 endif
370 endif
371 endif
373 model-z80:
374 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
375 $(MAKE) MODELFLAGS="-mz80" PORT=z80 objects-z80 OEXT=.o || exit 1; \
378 model-z180:
379 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
380 $(MAKE) MODELFLAGS="-mz180" PORT=z180 objects-z80 OEXT=.o || exit 1; \
383 model-ez80_z80:
384 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
385 $(MAKE) MODELFLAGS="-mez80_z80" PORT=ez80_z80 objects-z80 OEXT=.o || exit 1; \
388 model-z80n:
389 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
390 $(MAKE) MODELFLAGS="-mz80n" PORT=z80n objects-z80 OEXT=.o || exit 1; \
393 model-r2k:
394 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
395 $(MAKE) MODELFLAGS="-mr2k" PORT=r2k objects-z80 OEXT=.o || exit 1; \
398 model-r2ka:
399 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
400 $(MAKE) MODELFLAGS="-mr2ka" PORT=r2ka objects-z80 OEXT=.o || exit 1; \
403 model-r3ka:
404 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
405 $(MAKE) MODELFLAGS="-mr3ka" PORT=r3ka objects-z80 OEXT=.o || exit 1; \
408 model-tlcs90:
409 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
410 $(MAKE) MODELFLAGS="-mtlcs90" PORT=tlcs90 objects-z80 OEXT=.o || exit 1; \
413 model-sm83:
414 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
415 $(MAKE) MODELFLAGS="-msm83" PORT=sm83 objects-z80 OEXT=.o || exit 1; \
418 objects-z80:
419 $(MAKE) build-dir
420 $(MAKE) port-specific-objects
421 $(MAKE) clean_intermediate
423 model-hc08:
424 if grep '^hc08$$' $(top_builddir)/ports.build > /dev/null; then \
425 $(MAKE) MODELFLAGS="-mhc08" PORT=hc08 objects-hc08 || exit 1; \
428 model-s08:
429 if grep '^hc08$$' $(top_builddir)/ports.build > /dev/null; then \
430 $(MAKE) MODELFLAGS="-ms08" PORT=s08 objects-hc08 || exit 1; \
433 model-s08-stack-auto:
434 if grep '^hc08$$' $(top_builddir)/ports.build > /dev/null; then \
435 $(MAKE) MODELFLAGS="-ms08 --stack-auto" PORT=s08-stack-auto objects-hc08 || exit 1; \
438 objects-hc08:
439 $(MAKE) build-dir
440 $(MAKE) port-specific-objects
441 $(MAKE) clean_intermediate
443 model-mos6502:
444 if grep '^mos6502$$' $(top_builddir)/ports.build > /dev/null; then \
445 $(MAKE) MODELFLAGS="-mmos6502" PORT=mos6502 objects-mos6502 || exit 1; \
448 model-mos6502-stack-auto:
449 if grep '^mos6502$$' $(top_builddir)/ports.build > /dev/null; then \
450 $(MAKE) MODELFLAGS="-mmos6502 --stack-auto" PORT=mos6502-stack-auto objects-mos6502 || exit 1; \
453 model-mos65c02:
454 if grep '^mos6502$$' $(top_builddir)/ports.build > /dev/null; then \
455 $(MAKE) MODELFLAGS="-mmos65c02" PORT=mos65c02 objects-mos6502 || exit 1; \
458 objects-mos6502:
459 $(MAKE) build-dir
460 $(MAKE) port-specific-objects
461 $(MAKE) clean_intermediate
463 model-stm8:
464 if grep '^stm8$$' $(top_builddir)/ports.build > /dev/null; then \
465 $(MAKE) MODELFLAGS="-mstm8" PORT=stm8 objects-stm8 || exit 1; \
468 objects-stm8:
469 $(MAKE) build-dir
470 $(MAKE) port-specific-objects
471 $(MAKE) clean_intermediate
473 model-stm8-large:
474 if grep '^stm8$$' $(top_builddir)/ports.build > /dev/null; then \
475 $(MAKE) MODELFLAGS="-mstm8 --model-large" PORT=stm8-large objects-stm8 || exit 1; \
478 model-pdk13:
479 if grep '^pdk$$' $(top_builddir)/ports.build > /dev/null; then \
480 $(MAKE) MODELFLAGS="-mpdk13" PORT=pdk13 objects-pdk13 || exit 1; \
483 objects-pdk13:
484 $(MAKE) build-dir
485 $(MAKE) port-specific-objects
486 $(MAKE) clean_intermediate
488 model-pdk14:
489 if grep '^pdk$$' $(top_builddir)/ports.build > /dev/null; then \
490 $(MAKE) MODELFLAGS="-mpdk14" PORT=pdk14 objects-pdk14 || exit 1; \
493 objects-pdk14:
494 $(MAKE) build-dir
495 $(MAKE) port-specific-objects
496 $(MAKE) clean_intermediate
498 model-pdk15:
499 if grep '^pdk$$' $(top_builddir)/ports.build > /dev/null; then \
500 $(MAKE) MODELFLAGS="-mpdk15" PORT=pdk15 objects-pdk15 || exit 1; \
503 objects-pdk15:
504 $(MAKE) build-dir
505 $(MAKE) port-specific-objects
506 $(MAKE) clean_intermediate
508 model-pdk15-stack-auto:
509 if grep '^pdk$$' $(top_builddir)/ports.build > /dev/null; then \
510 $(MAKE) MODELFLAGS="-mpdk15 --stack-auto" PORT=pdk15-stack-auto objects-pdk15 || exit 1; \
513 model-pic16:
514 if grep '^pic16$$' $(top_builddir)/ports.build > /dev/null; then \
515 $(MAKE) PORT=pic16 objects-pic16; \
518 objects-pic16:
519 $(MAKE) build-dir
520 $(MAKE) port-specific-objects-pic16
521 $(MAKE) clean_intermediate-pic16
523 model-pic14:
524 if grep '^pic14$$' $(top_builddir)/ports.build > /dev/null; then \
525 $(MAKE) PORT=pic14 objects-pic14; \
528 objects-pic14:
529 $(MAKE) build-dir
530 $(MAKE) port-specific-objects-pic14
531 $(MAKE) clean_intermediate-pic14
533 build-dir:
534 $(MAKE) $(PORTDIR)
535 $(MAKE) $(PORT)
537 $(PORTDIR):
538 mkdir -p $(PORTDIR)
540 $(PORT):
541 mkdir -p $(PORT)
543 port-specific-objects:
544 if [ -f $(PORT)/Makefile ]; then \
545 $(MAKE) -C $(PORT) PORT=$(PORT) || exit 1; \
546 fi || :
548 port-specific-objects-pic16:
549 # BUG: ignore errors
550 if [ -f $(PORT)/Makefile ]; then \
551 $(MAKE) -C $(PORT) || exit 0; \
552 for i in $(PORT)/*/lib*.a; do cp -f $$i $(PORTDIR)/`basename $$i .a`.lib; done; \
553 cp -f $(PORT)/*/crt0*.o $(PORTDIR); \
554 fi || :
556 port-specific-objects-pic14:
557 if [ -f $(PORT)/Makefile ]; then \
558 $(MAKE) -C $(PORT) || exit 1; \
559 find $(PORT) -name 'lib*.a' | while read i; do \
560 cp -f "$$i" $(PORTDIR)/`basename "$$i" .a`.lib; \
561 done; \
562 fi || :
564 ifeq ($(LIB_TYPE), SDCCLIB)
566 $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT)
567 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT)
569 $(PORTDIR)/libint.lib: $(OBJECTS_INT)
570 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/libint.lib $(OBJECTS_INT)
572 $(PORTDIR)/liblong.lib: $(OBJECTS_LONG)
573 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/liblong.lib $(OBJECTS_LONG)
575 $(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG)
576 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/liblonglong.lib $(OBJECTS_LONGLONG)
578 $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC)
579 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC)
581 else
582 ifeq ($(LIB_TYPE), AR)
584 $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT)
585 ${SDAR} -rcSD $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT)
587 $(PORTDIR)/libint.lib: $(OBJECTS_INT)
588 ${SDAR} -rcSD $(PORTDIR)/libint.lib $(OBJECTS_INT)
590 $(PORTDIR)/liblong.lib: $(OBJECTS_LONG)
591 ${SDAR} -rcSD $(PORTDIR)/liblong.lib $(OBJECTS_LONG)
593 $(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG)
594 ${SDAR} -rcSD $(PORTDIR)/liblonglong.lib $(OBJECTS_LONGLONG)
596 $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC)
597 ${SDAR} -rcSD $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC)
599 else
600 ifeq ($(LIB_TYPE), RANLIB)
602 $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT)
603 ${SDAR} -rcD $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT)
605 $(PORTDIR)/libint.lib: $(OBJECTS_INT)
606 ${SDAR} -rcD $(PORTDIR)/libint.lib $(OBJECTS_INT)
608 $(PORTDIR)/liblong.lib: $(OBJECTS_LONG)
609 ${SDAR} -rcD $(PORTDIR)/liblong.lib $(OBJECTS_LONG)
611 $(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG)
612 ${SDAR} -rcD $(PORTDIR)/liblonglong.lib $(OBJECTS_LONGLONG)
614 $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC)
615 ${SDAR} -rcD $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC)
617 else
619 $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT)
620 rm -f $(PORTDIR)/libfloat.lib
621 for i in $(notdir $(basename $(OBJECTS_FLOAT))); do echo $$i >> $(PORTDIR)/libfloat.lib; done
622 cp $(OBJECTS_FLOAT) $(PORTDIR)
624 $(PORTDIR)/libint.lib: $(OBJECTS_INT)
625 rm -f $(PORTDIR)/libint.lib
626 for i in $(notdir $(basename $(OBJECTS_INT))); do echo $$i >> $(PORTDIR)/libint.lib; done
627 cp $(OBJECTS_INT) $(PORTDIR)
629 $(PORTDIR)/liblong.lib: $(OBJECTS_LONG)
630 rm -f $(PORTDIR)/liblong.lib
631 for i in $(notdir $(basename $(OBJECTS_LONG))); do echo $$i >> $(PORTDIR)/liblong.lib; done
632 cp $(OBJECTS_LONG) $(PORTDIR)
634 $(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG)
635 rm -f $(PORTDIR)/liblonglong.lib
636 for i in $(notdir $(basename $(OBJECTS_LONGLONG))); do echo $$i >> $(PORTDIR)/liblonglong.lib; done
637 cp $(OBJECTS_LONGLONG) $(PORTDIR)
639 $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC)
640 rm -f $(PORTDIR)/libsdcc.lib
641 for i in $(notdir $(basename $(OBJECTS_SDCC))); do echo $$i >> $(PORTDIR)/libsdcc.lib; done
642 cp $(OBJECTS_SDCC) $(PORTDIR)
644 endif
645 endif
646 endif
648 clean_intermediate:
649 rm -f $(PORTDIR)/*.lst $(PORTDIR)/*.sym
651 clean_intermediate-pic16:
652 $(MAKE) -C $(PORT) clean-intermediate
654 clean_intermediate-pic14:
655 $(MAKE) -C $(PORT) clean-intermediate
657 # Compiling and installing everything and runing test
658 # ---------------------------------------------------
659 install: all installdirs
660 [ ! -d "$(BUILDDIR)" ] || $(CP_U) -r $(BUILDDIR)/* $(sdcc_libdir)
661 $(CP_U) -r $(MODELS) $(srcdir)/mcs51 $(srcdir)/ds390 $(srcdir)/ds400 \
662 $(srcdir)/z80 $(srcdir)/z180 $(srcdir)/ez80_z80 $(srcdir)/z80n $(srcdir)/r2k $(srcdir)/r2ka $(srcdir)/r3ka $(srcdir)/tlcs90 $(srcdir)/sm83 \
663 $(srcdir)/hc08 $(srcdir)/s08 \
664 $(srcdir)/mos6502 $(srcdir)/mos65c02 \
665 $(srcdir)/stm8 \
666 $(srcdir)/pdk13 $(srcdir)/pdk14 $(srcdir)/pdk15 \
667 $(srcdir)/pic14 $(srcdir)/pic16 $(srcdir)/*.c $(sdcc_libdir)/src
668 $(CP_U) -r $(MODELS) mcs51 ds390 ds400 z80 z180 ez80_z80 z80n r2k r2ka r3ka tlcs90 sm83 hc08 s08 stm8 pdk13 pdk14 pdk15 $(sdcc_libdir)/src
670 for src in $(MODELS) ds390 ds400 z80 z180 ez80_z80 z80n r2k r2ka r3ka tlcs90 sm83 hc08 s08 mos6502 mos65c02 stm8 pdk13 pdk14 pdk15 pic14 pic16; do \
671 find $(sdcc_libdir)/src/$$src -depth \
672 \( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \
673 -name '*.lst' -o -name '*.asm' -o -name '.svn' -o -name 'autom4te.cache' -o \
674 -name 'build' -o -name 'bin' -o -name 'Makefile*' -o -name 'config*' -o \
675 -name 'depcomp' -o -name 'missing' -o -name 'install-sh' -o \
676 -name 'bootstrap.sh' \) \
677 -exec rm -rf {} + ; \
678 done
679 find $(sdcc_libdir)/src/mcs51 -depth \
680 \( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \
681 -name '*.lst' -o -name '.svn' -o -name 'build' -o -name 'bin' -o \
682 -name 'Makefile*' \) \
683 -exec rm -rf {} +
685 # Deleting all the installed files
686 # --------------------------------
687 uninstall:
688 rm -rf $(sdcc_libdir)
690 # Performing self-test
691 # --------------------
692 check:
695 # Performing installation test
696 # ----------------------------
697 installcheck:
700 # Creating installation directories
701 # ---------------------------------
702 installdirs:
703 for model in $(MODELS); do \
704 mkdir -p $(sdcc_libdir)/$$model; \
705 done
706 for libdir in small-stack-auto ds390 ds400 hc08 s08 pic16 pic14; do \
707 mkdir -p $(sdcc_libdir)/$$libdir; \
708 done
709 mkdir -p $(sdcc_libdir)/src
711 # Creating dependencies
712 # ---------------------
713 dep: Makefile.dep
715 Makefile.dep: $(SOURCES) $(INCDIR)/*.h $(PORTINCDIR)/*.h
716 rm -f Makefile.dep
717 for i in $(filter %.c,$^); do \
718 $(CPP) -std=c2x -M $(CPPFLAGS) $$i >$${i}.dep; \
719 cat $${i}.dep >>Makefile.dep; \
720 rm $${i}.dep; \
721 done
723 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs checkconf \
724 clean distclean mostlyclean realclean)" ""
725 -include Makefile.dep
726 endif
727 include $(srcdir)/clean.mk
729 # My rules
730 # --------
732 .SUFFIXES: .rel .o
734 $(PORT)/%$(OEXT): %.c
735 $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
737 # Remaking configuration
738 # ----------------------
739 checkconf:
740 @if [ -f $(top_builddir)/devel ]; then\
741 $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" \
742 freshconf;\
745 # End of main_in.mk/main.mk
747 Makefile: $(srcdir)/Makefile.in
748 cd $(top_builddir); ./config.status device/lib/Makefile