struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / lib / Makefile.in
blobd5bd43ddc3efd1b40d96888d43935e9badbabe6b
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-c23
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_R800 = @OPT_DISABLE_R800@
82 OPT_DISABLE_STM8 = @OPT_DISABLE_STM8@
83 OPT_DISABLE_PDK13 = @OPT_DISABLE_PDK13@
84 OPT_DISABLE_PDK14 = @OPT_DISABLE_PDK14@
85 OPT_DISABLE_PDK15 = @OPT_DISABLE_PDK15@
86 OPT_DISABLE_MOS6502 = @OPT_DISABLE_MOS6502@
87 OPT_DISABLE_MOS65C02 = @OPT_DISABLE_MOS65C02@
88 OPT_DISABLE_F8 = @OPT_DISABLE_F8@
90 SOURCES_FLOAT = $(COMMON_FLOAT) \
91 _fscmp.c \
92 _fsget1arg.c \
93 _fsget2args.c \
94 _fsnormalize.c \
95 _fsreturnval.c \
96 _fsrshift.c \
97 _fsswapargs.c \
98 _logexpf.c
100 SOURCES_INT = $(COMMON_INT) \
101 _divsint.c \
102 _divuint.c \
103 _modsint.c \
104 _moduint.c \
105 _mulint.c
107 SOURCES_LONG = $(COMMON_LONG) \
108 _divulong.c \
109 _mullong.c
111 SOURCES_LONGLONG = $(COMMON_LONGLONG) \
112 _srulonglong.c \
113 _srslonglong.c \
114 _slulonglong.c \
115 _slslonglong.c \
116 _mullonglong.c \
117 _divslonglong.c \
118 _divulonglong.c \
119 _modslonglong.c \
120 _modulonglong.c
122 SOURCES_SDCC = $(COMMON_SDCC) \
123 _autobaud.c \
124 _bp.c \
125 _decdptr.c \
126 _gptrget.c \
127 _gptrgetc.c \
128 _gptrput.c \
129 _ser.c \
130 _setjmp.c \
131 serial.c \
132 __itoa.c \
133 __ltoa.c \
134 _spx.c \
135 _startup.c \
136 _strcmp.c \
137 strlen.c \
138 strnlen.c \
139 __memcpy.c \
140 memcpy.c \
141 _memmove.c \
142 _strcpy.c \
143 _heap.c \
144 div.c \
145 ldiv.c \
146 lldiv.c \
147 imaxdiv.c \
148 sprintf.c \
149 vprintf.c \
150 printf_fast.c \
151 printf_fast_f.c \
152 printf_tiny.c \
153 printfl.c \
154 bpx.c
156 SOURCES = $(SOURCES_FLOAT) $(SOURCES_INT) $(SOURCES_LONG) $(SOURCES_LONGLONG) $(SOURCES_SDCC)
158 OBJECTS_FLOAT = $(SOURCES_FLOAT:%.c=$(PORT)/%.rel)
159 OBJECTS_INT = $(SOURCES_INT:%.c=$(PORT)/%.rel)
160 OBJECTS_LONG = $(SOURCES_LONG:%.c=$(PORT)/%.rel)
161 OBJECTS_LONGLONG = $(SOURCES_LONGLONG:%.c=$(PORT)/%.rel)
162 OBJECTS_SDCC = $(SOURCES_SDCC:%.c=$(PORT)/%.rel)
164 OBJECTS = $(OBJECTS_FLOAT) $(OBJECTS_INT) $(OBJECTS_LONG) $(OBJECTS_LONGLONG) $(OBJECTS_SDCC)
166 XA51_FLOAT = $(COMMON_FLOAT)
168 XA51_INT = $(COMMON_INT) \
169 _divsint.c \
170 _divuint.c \
171 _modsint.c \
172 _moduint.c \
173 _mulint.c
175 XA51_LONG = $(COMMON_LONG) \
176 _divulong.c \
177 _mullong.c
179 XA51_SDCC = $(COMMON_SDCC) \
180 _memmove.c \
181 strlen.c \
182 strnlen.c \
183 _heap.c \
184 div.c \
185 ldiv.c \
186 lldiv.rel
188 XA51SOURCES = $(XA51_FLOAT) $(XA51_INT) $(XA51_LONG) $(XA51_SDCC)
189 XA51OBJECTS = $(XA51SOURCES:%.c=$(PORT)/%.rel)
191 LIB_FILES = $(PORTDIR)/libfloat.lib $(PORTDIR)/libint.lib $(PORTDIR)/liblong.lib $(PORTDIR)/liblonglong.lib $(PORTDIR)/libsdcc.lib
193 OEXT = .rel
195 include $(srcdir)/incl.mk
197 ifeq ($(OPT_DISABLE_DS390), 0)
198 TARGETS += model-ds390
199 endif
201 ifeq ($(OPT_DISABLE_DS400), 0)
202 TARGETS += model-ds400
203 endif
205 ifeq ($(OPT_DISABLE_HC08), 0)
206 TARGETS += model-hc08
207 endif
209 ifeq ($(OPT_DISABLE_S08), 0)
210 TARGETS += model-s08
211 TARGETS += model-s08-stack-auto
212 endif
214 ifeq ($(OPT_DISABLE_MOS6502), 0)
215 TARGETS += model-mos6502
216 TARGETS += model-mos6502-stack-auto
217 endif
219 ifeq ($(OPT_DISABLE_MOS65C02), 0)
220 TARGETS += model-mos65c02
221 endif
223 ifeq ($(OPT_DISABLE_MCS51), 0)
224 TARGETS += models small-mcs51-stack-auto large-mcs51-stack-auto
225 endif
227 ifeq ($(OPT_DISABLE_PIC14), 0)
228 TARGETS += model-pic14
229 endif
231 ifeq ($(OPT_DISABLE_PIC16), 0)
232 TARGETS += model-pic16
233 endif
235 ifeq ($(OPT_DISABLE_Z80), 0)
236 TARGETS += model-z80
237 endif
239 ifeq ($(OPT_DISABLE_Z180), 0)
240 TARGETS += model-z180
241 endif
243 ifeq ($(OPT_DISABLE_EZ80_Z80), 0)
244 TARGETS += model-ez80_z80
245 endif
247 ifeq ($(OPT_DISABLE_Z80N), 0)
248 TARGETS += model-z80n
249 endif
251 ifeq ($(OPT_DISABLE_R2K), 0)
252 TARGETS += model-r2k
253 endif
255 ifeq ($(OPT_DISABLE_R2KA), 0)
256 TARGETS += model-r2ka
257 endif
259 ifeq ($(OPT_DISABLE_R3KA), 0)
260 TARGETS += model-r3ka
261 endif
263 ifeq ($(OPT_DISABLE_TLCS90), 0)
264 TARGETS += model-tlcs90
265 endif
267 ifeq ($(OPT_DISABLE_SM83), 0)
268 TARGETS += model-sm83
269 endif
271 ifeq ($(OPT_DISABLE_R800), 0)
272 TARGETS += model-r800
273 endif
275 ifeq ($(OPT_DISABLE_STM8), 0)
276 TARGETS += model-stm8
277 TARGETS += model-stm8-large
278 endif
280 ifeq ($(OPT_DISABLE_PDK13), 0)
281 TARGETS += model-pdk13
282 endif
284 ifeq ($(OPT_DISABLE_PDK14), 0)
285 TARGETS += model-pdk14
286 endif
288 ifeq ($(OPT_DISABLE_PDK15), 0)
289 TARGETS += model-pdk15
290 TARGETS += model-pdk15-stack-auto
291 endif
293 ifeq ($(OPT_DISABLE_F8), 0)
294 TARGETS += model-f8
295 endif
297 # Compiling entire program or any subproject
298 # ------------------------------------------
299 all:
300 $(MAKE) checkconf
301 ifneq ($(TARGETS), )
302 $(MAKE) $(TARGETS)
303 endif
305 objects:
306 $(MAKE) build-dir
307 $(MAKE) $(OBJECTS)
308 $(MAKE) port-specific-objects
309 $(MAKE) $(LIB_FILES)
310 $(MAKE) clean_intermediate
312 models:
313 if grep '^mcs51$$' $(top_builddir)/ports.build > /dev/null; then \
314 for model in $(MODELS); do \
315 $(MAKE) MODELFLAGS="--model-$$model" PORT=$$model PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
316 done \
319 small-mcs51-stack-auto:
320 if grep '^mcs51$$' $(top_builddir)/ports.build > /dev/null; then \
321 mkdir -p small-stack-auto; cp small/Makefile small-stack-auto; \
322 $(MAKE) MODELFLAGS="--model-small --stack-auto" PORT=small-stack-auto PORTDIR=$(BUILDDIR)/small-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
325 large-mcs51-stack-auto:
326 if grep '^mcs51$$' $(top_builddir)/ports.build > /dev/null; then \
327 mkdir -p large-stack-auto; cp small/Makefile large-stack-auto; \
328 $(MAKE) MODELFLAGS="--model-large --stack-auto" PORT=large-stack-auto PORTDIR=$(BUILDDIR)/large-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
331 model-mcs51-stack-auto:
332 if grep '^mcs51$$' $(top_builddir)/ports.build > /dev/null; then \
333 for model in $(MODELS); do \
334 mkdir -p $${model}-stack-auto; cp $${model}/Makefile $${model}-stack-auto; \
335 $(MAKE) MODELFLAGS="--model-$$model --stack-auto" PORT=$${model}-stack-auto PORTDIR=$(BUILDDIR)/$${model}-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
336 done \
339 model-mcs51-xstack-auto:
340 if grep '^mcs51$$' $(top_builddir)/ports.build > /dev/null; then \
341 for model in $(MODELS); do \
342 mkdir -p $${model}-xstack-auto; cp $${model}/Makefile $${model}-xstack-auto; \
343 $(MAKE) MODELFLAGS="--model-$$model --stack-auto --xstack" PORT=$${model}-xstack-auto PORTDIR=$(BUILDDIR)/$${model}-xstack-auto PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
344 done \
347 model-ds390:
348 if grep '^ds390$$' $(top_builddir)/ports.build > /dev/null; then \
349 $(MAKE) MODELFLAGS="-mds390" PORT=ds390 PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
352 model-ds400:
353 if grep '^ds390$$' $(top_builddir)/ports.build > /dev/null; then \
354 $(MAKE) MODELFLAGS="-mds400" PORT=ds400 PORTINCDIR=$(INCDIR)/mcs51 objects || exit 1; \
357 model-xa51:
358 if grep '^xa51$$' $(top_builddir)/ports.build > /dev/null; then \
359 $(MAKE) MODELFLAGS="-mxa51" PORT=xa51 objects-xa51 || exit 1; \
362 objects-xa51:
363 $(MAKE) build-dir
364 $(MAKE) $(XA51OBJECTS)
365 $(MAKE) port-specific-objects
367 $(PORTDIR)/lib$(PORT).lib: $(XA51OBJECTS)
368 rm -f $(PORTDIR)/lib$(PORT).lib
369 ifeq ($(LIB_TYPE), SDCCLIB)
370 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS)
371 else
372 ifeq ($(LIB_TYPE), AR)
373 ${SDAR} -rcSD $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS)
374 else
375 ifeq ($(LIB_TYPE), RANLIB)
376 ${SDAR} -rcD $(PORTDIR)/lib$(PORT).lib $(XA51OBJECTS)
377 else
378 rm -f $(PORTDIR)/lib$(PORT).lib
379 for i in $(notdir $(basename $(XA51OBJECTS))); do echo $$i >> $(PORTDIR)/lib$(PORT).lib; done
380 cp $(XA51OBJECTS) $(PORTDIR)
381 endif
382 endif
383 endif
385 model-z80:
386 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
387 $(MAKE) MODELFLAGS="-mz80" PORT=z80 objects-z80 OEXT=.o || exit 1; \
390 model-z180:
391 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
392 $(MAKE) MODELFLAGS="-mz180" PORT=z180 objects-z80 OEXT=.o || exit 1; \
395 model-ez80_z80:
396 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
397 $(MAKE) MODELFLAGS="-mez80_z80" PORT=ez80_z80 objects-z80 OEXT=.o || exit 1; \
400 model-z80n:
401 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
402 $(MAKE) MODELFLAGS="-mz80n" PORT=z80n objects-z80 OEXT=.o || exit 1; \
405 model-r2k:
406 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
407 $(MAKE) MODELFLAGS="-mr2k" PORT=r2k objects-z80 OEXT=.o || exit 1; \
410 model-r2ka:
411 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
412 $(MAKE) MODELFLAGS="-mr2ka" PORT=r2ka objects-z80 OEXT=.o || exit 1; \
415 model-r3ka:
416 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
417 $(MAKE) MODELFLAGS="-mr3ka" PORT=r3ka objects-z80 OEXT=.o || exit 1; \
420 model-tlcs90:
421 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
422 $(MAKE) MODELFLAGS="-mtlcs90" PORT=tlcs90 objects-z80 OEXT=.o || exit 1; \
425 model-sm83:
426 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
427 $(MAKE) MODELFLAGS="-msm83" PORT=sm83 objects-z80 OEXT=.o || exit 1; \
430 model-r800:
431 if grep '^z80$$' $(top_builddir)/ports.build > /dev/null; then \
432 $(MAKE) MODELFLAGS="-mr800" PORT=r800 objects-z80 OEXT=.o || exit 1; \
435 objects-z80:
436 $(MAKE) build-dir
437 $(MAKE) port-specific-objects
438 $(MAKE) clean_intermediate
440 model-hc08:
441 if grep '^hc08$$' $(top_builddir)/ports.build > /dev/null; then \
442 $(MAKE) MODELFLAGS="-mhc08" PORT=hc08 objects-hc08 || exit 1; \
445 model-s08:
446 if grep '^hc08$$' $(top_builddir)/ports.build > /dev/null; then \
447 $(MAKE) MODELFLAGS="-ms08" PORT=s08 objects-hc08 || exit 1; \
450 model-s08-stack-auto:
451 if grep '^hc08$$' $(top_builddir)/ports.build > /dev/null; then \
452 $(MAKE) MODELFLAGS="-ms08 --stack-auto" PORT=s08-stack-auto objects-hc08 || exit 1; \
455 objects-hc08:
456 $(MAKE) build-dir
457 $(MAKE) port-specific-objects
458 $(MAKE) clean_intermediate
460 model-mos6502:
461 if grep '^mos6502$$' $(top_builddir)/ports.build > /dev/null; then \
462 $(MAKE) MODELFLAGS="-mmos6502" PORT=mos6502 objects-mos6502 || exit 1; \
465 model-mos6502-stack-auto:
466 if grep '^mos6502$$' $(top_builddir)/ports.build > /dev/null; then \
467 $(MAKE) MODELFLAGS="-mmos6502 --stack-auto" PORT=mos6502-stack-auto objects-mos6502 || exit 1; \
470 model-mos65c02:
471 if grep '^mos6502$$' $(top_builddir)/ports.build > /dev/null; then \
472 $(MAKE) MODELFLAGS="-mmos65c02" PORT=mos65c02 objects-mos6502 || exit 1; \
475 objects-mos6502:
476 $(MAKE) build-dir
477 $(MAKE) port-specific-objects
478 $(MAKE) clean_intermediate
480 model-stm8:
481 if grep '^stm8$$' $(top_builddir)/ports.build > /dev/null; then \
482 $(MAKE) MODELFLAGS="-mstm8" PORT=stm8 objects-stm8 || exit 1; \
485 objects-stm8:
486 $(MAKE) build-dir
487 $(MAKE) port-specific-objects
488 $(MAKE) clean_intermediate
490 model-stm8-large:
491 if grep '^stm8$$' $(top_builddir)/ports.build > /dev/null; then \
492 $(MAKE) MODELFLAGS="-mstm8 --model-large" PORT=stm8-large objects-stm8 || exit 1; \
495 model-pdk13:
496 if grep '^pdk$$' $(top_builddir)/ports.build > /dev/null; then \
497 $(MAKE) MODELFLAGS="-mpdk13" PORT=pdk13 objects-pdk13 || exit 1; \
500 objects-pdk13:
501 $(MAKE) build-dir
502 $(MAKE) port-specific-objects
503 $(MAKE) clean_intermediate
505 model-pdk14:
506 if grep '^pdk$$' $(top_builddir)/ports.build > /dev/null; then \
507 $(MAKE) MODELFLAGS="-mpdk14" PORT=pdk14 objects-pdk14 || exit 1; \
510 objects-pdk14:
511 $(MAKE) build-dir
512 $(MAKE) port-specific-objects
513 $(MAKE) clean_intermediate
515 model-pdk15:
516 if grep '^pdk$$' $(top_builddir)/ports.build > /dev/null; then \
517 $(MAKE) MODELFLAGS="-mpdk15" PORT=pdk15 objects-pdk15 || exit 1; \
520 objects-pdk15:
521 $(MAKE) build-dir
522 $(MAKE) port-specific-objects
523 $(MAKE) clean_intermediate
525 model-pdk15-stack-auto:
526 if grep '^pdk$$' $(top_builddir)/ports.build > /dev/null; then \
527 $(MAKE) MODELFLAGS="-mpdk15 --stack-auto" PORT=pdk15-stack-auto objects-pdk15 || exit 1; \
530 model-f8:
531 if grep '^f8$$' $(top_builddir)/ports.build > /dev/null; then \
532 $(MAKE) MODELFLAGS="-mf8" PORT=f8 objects-f8; \
535 objects-f8:
536 $(MAKE) build-dir
537 $(MAKE) port-specific-objects
538 $(MAKE) clean_intermediate
540 model-pic16:
541 if grep '^pic16$$' $(top_builddir)/ports.build > /dev/null; then \
542 $(MAKE) PORT=pic16 objects-pic16; \
545 objects-pic16:
546 $(MAKE) build-dir
547 $(MAKE) port-specific-objects-pic16
548 $(MAKE) clean_intermediate-pic16
550 model-pic14:
551 if grep '^pic14$$' $(top_builddir)/ports.build > /dev/null; then \
552 $(MAKE) PORT=pic14 objects-pic14; \
555 objects-pic14:
556 $(MAKE) build-dir
557 $(MAKE) port-specific-objects-pic14
558 $(MAKE) clean_intermediate-pic14
560 build-dir:
561 $(MAKE) $(PORTDIR)
562 $(MAKE) $(PORT)
564 $(PORTDIR):
565 mkdir -p $(PORTDIR)
567 $(PORT):
568 mkdir -p $(PORT)
570 port-specific-objects:
571 if [ -f $(PORT)/Makefile ]; then \
572 $(MAKE) -C $(PORT) PORT=$(PORT) || exit 1; \
573 fi || :
575 port-specific-objects-pic16:
576 # BUG: ignore errors
577 if [ -f $(PORT)/Makefile ]; then \
578 $(MAKE) -C $(PORT) || exit 0; \
579 for i in $(PORT)/*/lib*.a; do cp -f $$i $(PORTDIR)/`basename $$i .a`.lib; done; \
580 cp -f $(PORT)/*/crt0*.o $(PORTDIR); \
581 fi || :
583 port-specific-objects-pic14:
584 if [ -f $(PORT)/Makefile ]; then \
585 $(MAKE) -C $(PORT) || exit 1; \
586 find $(PORT) -name 'lib*.a' | while read i; do \
587 cp -f "$$i" $(PORTDIR)/`basename "$$i" .a`.lib; \
588 done; \
589 fi || :
591 ifeq ($(LIB_TYPE), SDCCLIB)
593 $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT)
594 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT)
596 $(PORTDIR)/libint.lib: $(OBJECTS_INT)
597 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/libint.lib $(OBJECTS_INT)
599 $(PORTDIR)/liblong.lib: $(OBJECTS_LONG)
600 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/liblong.lib $(OBJECTS_LONG)
602 $(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG)
603 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/liblonglong.lib $(OBJECTS_LONGLONG)
605 $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC)
606 $(top_builddir)/bin/sdcclib -a $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC)
608 else
609 ifeq ($(LIB_TYPE), AR)
611 $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT)
612 ${SDAR} -rcSD $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT)
614 $(PORTDIR)/libint.lib: $(OBJECTS_INT)
615 ${SDAR} -rcSD $(PORTDIR)/libint.lib $(OBJECTS_INT)
617 $(PORTDIR)/liblong.lib: $(OBJECTS_LONG)
618 ${SDAR} -rcSD $(PORTDIR)/liblong.lib $(OBJECTS_LONG)
620 $(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG)
621 ${SDAR} -rcSD $(PORTDIR)/liblonglong.lib $(OBJECTS_LONGLONG)
623 $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC)
624 ${SDAR} -rcSD $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC)
626 else
627 ifeq ($(LIB_TYPE), RANLIB)
629 $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT)
630 ${SDAR} -rcD $(PORTDIR)/libfloat.lib $(OBJECTS_FLOAT)
632 $(PORTDIR)/libint.lib: $(OBJECTS_INT)
633 ${SDAR} -rcD $(PORTDIR)/libint.lib $(OBJECTS_INT)
635 $(PORTDIR)/liblong.lib: $(OBJECTS_LONG)
636 ${SDAR} -rcD $(PORTDIR)/liblong.lib $(OBJECTS_LONG)
638 $(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG)
639 ${SDAR} -rcD $(PORTDIR)/liblonglong.lib $(OBJECTS_LONGLONG)
641 $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC)
642 ${SDAR} -rcD $(PORTDIR)/libsdcc.lib $(OBJECTS_SDCC)
644 else
646 $(PORTDIR)/libfloat.lib: $(OBJECTS_FLOAT)
647 rm -f $(PORTDIR)/libfloat.lib
648 for i in $(notdir $(basename $(OBJECTS_FLOAT))); do echo $$i >> $(PORTDIR)/libfloat.lib; done
649 cp $(OBJECTS_FLOAT) $(PORTDIR)
651 $(PORTDIR)/libint.lib: $(OBJECTS_INT)
652 rm -f $(PORTDIR)/libint.lib
653 for i in $(notdir $(basename $(OBJECTS_INT))); do echo $$i >> $(PORTDIR)/libint.lib; done
654 cp $(OBJECTS_INT) $(PORTDIR)
656 $(PORTDIR)/liblong.lib: $(OBJECTS_LONG)
657 rm -f $(PORTDIR)/liblong.lib
658 for i in $(notdir $(basename $(OBJECTS_LONG))); do echo $$i >> $(PORTDIR)/liblong.lib; done
659 cp $(OBJECTS_LONG) $(PORTDIR)
661 $(PORTDIR)/liblonglong.lib: $(OBJECTS_LONGLONG)
662 rm -f $(PORTDIR)/liblonglong.lib
663 for i in $(notdir $(basename $(OBJECTS_LONGLONG))); do echo $$i >> $(PORTDIR)/liblonglong.lib; done
664 cp $(OBJECTS_LONGLONG) $(PORTDIR)
666 $(PORTDIR)/libsdcc.lib: $(OBJECTS_SDCC)
667 rm -f $(PORTDIR)/libsdcc.lib
668 for i in $(notdir $(basename $(OBJECTS_SDCC))); do echo $$i >> $(PORTDIR)/libsdcc.lib; done
669 cp $(OBJECTS_SDCC) $(PORTDIR)
671 endif
672 endif
673 endif
675 clean_intermediate:
676 rm -f $(PORTDIR)/*.lst $(PORTDIR)/*.sym
678 clean_intermediate-pic16:
679 $(MAKE) -C $(PORT) clean-intermediate
681 clean_intermediate-pic14:
682 $(MAKE) -C $(PORT) clean-intermediate
684 # Compiling and installing everything and runing test
685 # ---------------------------------------------------
686 install: all installdirs
687 [ ! -d "$(BUILDDIR)" ] || $(CP_U) -r $(BUILDDIR)/* $(sdcc_libdir)
688 $(CP_U) -r $(MODELS) $(srcdir)/mcs51 $(srcdir)/ds390 $(srcdir)/ds400 \
689 $(srcdir)/z80 $(srcdir)/z180 $(srcdir)/ez80_z80 $(srcdir)/z80n $(srcdir)/r2k $(srcdir)/r2ka $(srcdir)/r3ka $(srcdir)/tlcs90 $(srcdir)/sm83 $(srcdir)/r800 \
690 $(srcdir)/hc08 $(srcdir)/s08 \
691 $(srcdir)/mos6502 $(srcdir)/mos65c02 \
692 $(srcdir)/stm8 \
693 $(srcdir)/pdk13 $(srcdir)/pdk14 $(srcdir)/pdk15 \
694 $(srcdir)/f8 \
695 $(srcdir)/pic14 $(srcdir)/pic16 $(srcdir)/*.c $(sdcc_libdir)/src
696 $(CP_U) -r $(MODELS) mcs51 ds390 ds400 z80 z180 ez80_z80 z80n r2k r2ka r3ka tlcs90 sm83 r800 hc08 s08 stm8 pdk13 pdk14 pdk15 f8 $(sdcc_libdir)/src
698 for src in $(MODELS) ds390 ds400 z80 z180 ez80_z80 z80n r2k r2ka r3ka tlcs90 sm83 r800 hc08 s08 mos6502 mos65c02 stm8 pdk13 pdk14 pdk15 f8 pic14 pic16; do \
699 find $(sdcc_libdir)/src/$$src -depth \
700 \( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \
701 -name '*.lst' -o -name '*.asm' -o -name '.svn' -o -name 'autom4te.cache' -o \
702 -name 'build' -o -name 'bin' -o -name 'Makefile*' -o -name 'config*' -o \
703 -name 'depcomp' -o -name 'missing' -o -name 'install-sh' -o \
704 -name 'bootstrap.sh' \) \
705 -exec rm -rf {} + ; \
706 done
707 find $(sdcc_libdir)/src/mcs51 -depth \
708 \( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \
709 -name '*.lst' -o -name '.svn' -o -name 'build' -o -name 'bin' -o \
710 -name 'Makefile*' \) \
711 -exec rm -rf {} +
713 # Deleting all the installed files
714 # --------------------------------
715 uninstall:
716 rm -rf $(sdcc_libdir)
718 # Performing self-test
719 # --------------------
720 check:
723 # Performing installation test
724 # ----------------------------
725 installcheck:
728 # Creating installation directories
729 # ---------------------------------
730 installdirs:
731 for model in $(MODELS); do \
732 mkdir -p $(sdcc_libdir)/$$model; \
733 done
734 for libdir in small-stack-auto ds390 ds400 hc08 s08 pic16 pic14; do \
735 mkdir -p $(sdcc_libdir)/$$libdir; \
736 done
737 mkdir -p $(sdcc_libdir)/src
739 # Creating dependencies
740 # ---------------------
741 dep: Makefile.dep
743 Makefile.dep: $(SOURCES) $(INCDIR)/*.h $(PORTINCDIR)/*.h
744 rm -f Makefile.dep
745 for i in $(filter %.c,$^); do \
746 $(CPP) -std=c23 -M $(CPPFLAGS) $$i >$${i}.dep; \
747 cat $${i}.dep >>Makefile.dep; \
748 rm $${i}.dep; \
749 done
751 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs checkconf \
752 clean distclean mostlyclean realclean)" ""
753 -include Makefile.dep
754 endif
755 include $(srcdir)/clean.mk
757 # My rules
758 # --------
760 .SUFFIXES: .rel .o
762 $(PORT)/%$(OEXT): %.c
763 $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
765 # Remaking configuration
766 # ----------------------
767 checkconf:
768 @if [ -f $(top_builddir)/devel ]; then\
769 $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" \
770 freshconf;\
773 # End of main_in.mk/main.mk
775 Makefile: $(srcdir)/Makefile.in
776 cd $(top_builddir); ./config.status device/lib/Makefile