6 VERSIONHI
= @VERSIONHI@
7 VERSIONLO
= @VERSIONLO@
16 ifeq ($(shell uname
-s
),Linux
)
22 top_builddir
= @top_builddir@
23 abs_top_builddir
= @abs_top_builddir@
24 top_srcdir
= @top_srcdir@
27 INCDIR
= $(top_srcdir
)/device
/include
29 PORTINCDIR
= $(INCDIR
)/mcs51
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
38 exec_prefix = @
exec_prefix@
42 datarootdir
= @datarootdir@
43 includedir = @
includedir@
45 man1dir = $(mandir)/man1
46 man2dir = $(mandir)/man2
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
60 PORTDIR
= $(BUILDDIR
)/$(PORT
)
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
) \
100 SOURCES_INT
= $(COMMON_INT
) \
107 SOURCES_LONG
= $(COMMON_LONG
) \
111 SOURCES_LONGLONG
= $(COMMON_LONGLONG
) \
122 SOURCES_SDCC
= $(COMMON_SDCC
) \
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
) \
175 XA51_LONG
= $(COMMON_LONG
) \
179 XA51_SDCC
= $(COMMON_SDCC
) \
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
195 include $(srcdir)/incl.mk
197 ifeq ($(OPT_DISABLE_DS390
), 0)
198 TARGETS
+= model-ds390
201 ifeq ($(OPT_DISABLE_DS400
), 0)
202 TARGETS
+= model-ds400
205 ifeq ($(OPT_DISABLE_HC08
), 0)
206 TARGETS
+= model-hc08
209 ifeq ($(OPT_DISABLE_S08
), 0)
211 TARGETS
+= model-s08-stack-auto
214 ifeq ($(OPT_DISABLE_MOS6502
), 0)
215 TARGETS
+= model-mos6502
216 TARGETS
+= model-mos6502-stack-auto
219 ifeq ($(OPT_DISABLE_MOS65C02
), 0)
220 TARGETS
+= model-mos65c02
223 ifeq ($(OPT_DISABLE_MCS51
), 0)
224 TARGETS
+= models small-mcs51-stack-auto large-mcs51-stack-auto
227 ifeq ($(OPT_DISABLE_PIC14
), 0)
228 TARGETS
+= model-pic14
231 ifeq ($(OPT_DISABLE_PIC16
), 0)
232 TARGETS
+= model-pic16
235 ifeq ($(OPT_DISABLE_Z80
), 0)
239 ifeq ($(OPT_DISABLE_Z180
), 0)
240 TARGETS
+= model-z180
243 ifeq ($(OPT_DISABLE_EZ80_Z80
), 0)
244 TARGETS
+= model-ez80_z80
247 ifeq ($(OPT_DISABLE_Z80N
), 0)
248 TARGETS
+= model-z80n
251 ifeq ($(OPT_DISABLE_R2K
), 0)
255 ifeq ($(OPT_DISABLE_R2KA
), 0)
256 TARGETS
+= model-r2ka
259 ifeq ($(OPT_DISABLE_R3KA
), 0)
260 TARGETS
+= model-r3ka
263 ifeq ($(OPT_DISABLE_TLCS90
), 0)
264 TARGETS
+= model-tlcs90
267 ifeq ($(OPT_DISABLE_SM83
), 0)
268 TARGETS
+= model-sm83
271 ifeq ($(OPT_DISABLE_R800
), 0)
272 TARGETS
+= model-r800
275 ifeq ($(OPT_DISABLE_STM8
), 0)
276 TARGETS
+= model-stm8
277 TARGETS
+= model-stm8-large
280 ifeq ($(OPT_DISABLE_PDK13
), 0)
281 TARGETS
+= model-pdk13
284 ifeq ($(OPT_DISABLE_PDK14
), 0)
285 TARGETS
+= model-pdk14
288 ifeq ($(OPT_DISABLE_PDK15
), 0)
289 TARGETS
+= model-pdk15
290 TARGETS
+= model-pdk15-stack-auto
293 ifeq ($(OPT_DISABLE_F8
), 0)
297 # Compiling entire program or any subproject
298 # ------------------------------------------
308 $(MAKE
) port-specific-objects
310 $(MAKE
) clean_intermediate
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; \
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; \
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; \
348 if grep
'^ds390$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
349 $(MAKE
) MODELFLAGS
="-mds390" PORT
=ds390 PORTINCDIR
=$(INCDIR
)/mcs51 objects || exit
1; \
353 if grep
'^ds390$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
354 $(MAKE
) MODELFLAGS
="-mds400" PORT
=ds400 PORTINCDIR
=$(INCDIR
)/mcs51 objects || exit
1; \
358 if grep
'^xa51$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
359 $(MAKE
) MODELFLAGS
="-mxa51" PORT
=xa51 objects-xa51 || exit
1; \
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
)
372 ifeq ($(LIB_TYPE
), AR
)
373 ${SDAR} -rcSD
$(PORTDIR
)/lib
$(PORT
).lib
$(XA51OBJECTS
)
375 ifeq ($(LIB_TYPE
), RANLIB
)
376 ${SDAR} -rcD
$(PORTDIR
)/lib
$(PORT
).lib
$(XA51OBJECTS
)
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
)
386 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
387 $(MAKE
) MODELFLAGS
="-mz80" PORT
=z80 objects-z80 OEXT
=.o || exit
1; \
391 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
392 $(MAKE
) MODELFLAGS
="-mz180" PORT
=z180 objects-z80 OEXT
=.o || exit
1; \
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; \
401 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
402 $(MAKE
) MODELFLAGS
="-mz80n" PORT
=z80n objects-z80 OEXT
=.o || exit
1; \
406 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
407 $(MAKE
) MODELFLAGS
="-mr2k" PORT
=r2k objects-z80 OEXT
=.o || exit
1; \
411 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
412 $(MAKE
) MODELFLAGS
="-mr2ka" PORT
=r2ka objects-z80 OEXT
=.o || exit
1; \
416 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
417 $(MAKE
) MODELFLAGS
="-mr3ka" PORT
=r3ka objects-z80 OEXT
=.o || exit
1; \
421 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
422 $(MAKE
) MODELFLAGS
="-mtlcs90" PORT
=tlcs90 objects-z80 OEXT
=.o || exit
1; \
426 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
427 $(MAKE
) MODELFLAGS
="-msm83" PORT
=sm83 objects-z80 OEXT
=.o || exit
1; \
431 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
432 $(MAKE
) MODELFLAGS
="-mr800" PORT
=r800 objects-z80 OEXT
=.o || exit
1; \
437 $(MAKE
) port-specific-objects
438 $(MAKE
) clean_intermediate
441 if grep
'^hc08$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
442 $(MAKE
) MODELFLAGS
="-mhc08" PORT
=hc08 objects-hc08 || exit
1; \
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; \
457 $(MAKE
) port-specific-objects
458 $(MAKE
) clean_intermediate
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; \
471 if grep
'^mos6502$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
472 $(MAKE
) MODELFLAGS
="-mmos65c02" PORT
=mos65c02 objects-mos6502 || exit
1; \
477 $(MAKE
) port-specific-objects
478 $(MAKE
) clean_intermediate
481 if grep
'^stm8$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
482 $(MAKE
) MODELFLAGS
="-mstm8" PORT
=stm8 objects-stm8 || exit
1; \
487 $(MAKE
) port-specific-objects
488 $(MAKE
) clean_intermediate
491 if grep
'^stm8$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
492 $(MAKE
) MODELFLAGS
="-mstm8 --model-large" PORT
=stm8-large objects-stm8 || exit
1; \
496 if grep
'^pdk$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
497 $(MAKE
) MODELFLAGS
="-mpdk13" PORT
=pdk13 objects-pdk13 || exit
1; \
502 $(MAKE
) port-specific-objects
503 $(MAKE
) clean_intermediate
506 if grep
'^pdk$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
507 $(MAKE
) MODELFLAGS
="-mpdk14" PORT
=pdk14 objects-pdk14 || exit
1; \
512 $(MAKE
) port-specific-objects
513 $(MAKE
) clean_intermediate
516 if grep
'^pdk$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
517 $(MAKE
) MODELFLAGS
="-mpdk15" PORT
=pdk15 objects-pdk15 || exit
1; \
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; \
531 if grep
'^f8$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
532 $(MAKE
) MODELFLAGS
="-mf8" PORT
=f8 objects-f8
; \
537 $(MAKE
) port-specific-objects
538 $(MAKE
) clean_intermediate
541 if grep
'^pic16$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
542 $(MAKE
) PORT
=pic16 objects-pic16
; \
547 $(MAKE
) port-specific-objects-pic16
548 $(MAKE
) clean_intermediate-pic16
551 if grep
'^pic14$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
552 $(MAKE
) PORT
=pic14 objects-pic14
; \
557 $(MAKE
) port-specific-objects-pic14
558 $(MAKE
) clean_intermediate-pic14
570 port-specific-objects
:
571 if
[ -f
$(PORT
)/Makefile
]; then \
572 $(MAKE
) -C
$(PORT
) PORT
=$(PORT
) || exit
1; \
575 port-specific-objects-pic16
:
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
); \
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
; \
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
)
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
)
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
)
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
)
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 \
693 $(srcdir)/pdk13
$(srcdir)/pdk14
$(srcdir)/pdk15 \
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
{} + ; \
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*' \
) \
713 # Deleting all the installed files
714 # --------------------------------
716 rm -rf
$(sdcc_libdir
)
718 # Performing self-test
719 # --------------------
723 # Performing installation test
724 # ----------------------------
728 # Creating installation directories
729 # ---------------------------------
731 for model in
$(MODELS
); do \
732 mkdir
-p
$(sdcc_libdir
)/$$model; \
734 for
libdir in small-stack-auto ds390 ds400 hc08 s08 pic16 pic14
; do \
735 mkdir
-p
$(sdcc_libdir
)/$$libdir; \
737 mkdir
-p
$(sdcc_libdir
)/src
739 # Creating dependencies
740 # ---------------------
743 Makefile.dep
: $(SOURCES
) $(INCDIR
)/*.h
$(PORTINCDIR
)/*.h
745 for i in
$(filter %.c
,$^
); do \
746 $(CPP
) -std
=c23
-M
$(CPPFLAGS
) $$i >$${i}.dep
; \
747 cat
$${i}.dep
>>Makefile.dep
; \
751 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs checkconf \
752 clean distclean mostlyclean realclean)" ""
753 -include Makefile.dep
755 include $(srcdir)/clean.mk
762 $(PORT
)/%$(OEXT
): %.c
763 $(CC
) $(CPPFLAGS
) $(CFLAGS
) -c
$< -o
$@
765 # Remaking configuration
766 # ----------------------
768 @if
[ -f
$(top_builddir
)/devel
]; then\
769 $(MAKE
) -f
$(srcdir)/conf.mk
srcdir="$(srcdir)" top_builddir
="$(top_builddir)" \
773 # End of main_in.mk/main.mk
775 Makefile
: $(srcdir)/Makefile.in
776 cd
$(top_builddir
); .
/config.status device
/lib
/Makefile