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-c2x
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_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
) \
98 SOURCES_INT
= $(COMMON_INT
) \
105 SOURCES_LONG
= $(COMMON_LONG
) \
109 SOURCES_LONGLONG
= $(COMMON_LONGLONG
) \
120 SOURCES_SDCC
= $(COMMON_SDCC
) \
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
) \
172 XA51_LONG
= $(COMMON_LONG
) \
176 XA51_SDCC
= $(COMMON_SDCC
) \
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
191 include $(srcdir)/incl.mk
193 ifeq ($(OPT_DISABLE_DS390
), 0)
194 TARGETS
+= model-ds390
197 ifeq ($(OPT_DISABLE_DS400
), 0)
198 TARGETS
+= model-ds400
201 ifeq ($(OPT_DISABLE_HC08
), 0)
202 TARGETS
+= model-hc08
205 ifeq ($(OPT_DISABLE_S08
), 0)
207 TARGETS
+= model-s08-stack-auto
210 ifeq ($(OPT_DISABLE_MOS6502
), 0)
211 TARGETS
+= model-mos6502
212 TARGETS
+= model-mos6502-stack-auto
215 ifeq ($(OPT_DISABLE_MOS65C02
), 0)
216 TARGETS
+= model-mos65c02
219 ifeq ($(OPT_DISABLE_MCS51
), 0)
220 TARGETS
+= models small-mcs51-stack-auto large-mcs51-stack-auto
223 ifeq ($(OPT_DISABLE_PIC14
), 0)
224 TARGETS
+= model-pic14
227 ifeq ($(OPT_DISABLE_PIC16
), 0)
228 TARGETS
+= model-pic16
231 ifeq ($(OPT_DISABLE_Z80
), 0)
235 ifeq ($(OPT_DISABLE_Z180
), 0)
236 TARGETS
+= model-z180
239 ifeq ($(OPT_DISABLE_EZ80_Z80
), 0)
240 TARGETS
+= model-ez80_z80
243 ifeq ($(OPT_DISABLE_Z80N
), 0)
244 TARGETS
+= model-z80n
247 ifeq ($(OPT_DISABLE_R2K
), 0)
251 ifeq ($(OPT_DISABLE_R2KA
), 0)
252 TARGETS
+= model-r2ka
255 ifeq ($(OPT_DISABLE_R3KA
), 0)
256 TARGETS
+= model-r3ka
259 ifeq ($(OPT_DISABLE_TLCS90
), 0)
260 TARGETS
+= model-tlcs90
263 ifeq ($(OPT_DISABLE_SM83
), 0)
264 TARGETS
+= model-sm83
267 ifeq ($(OPT_DISABLE_STM8
), 0)
268 TARGETS
+= model-stm8
269 TARGETS
+= model-stm8-large
272 ifeq ($(OPT_DISABLE_PDK13
), 0)
273 TARGETS
+= model-pdk13
276 ifeq ($(OPT_DISABLE_PDK14
), 0)
277 TARGETS
+= model-pdk14
280 ifeq ($(OPT_DISABLE_PDK15
), 0)
281 TARGETS
+= model-pdk15
282 TARGETS
+= model-pdk15-stack-auto
285 # Compiling entire program or any subproject
286 # ------------------------------------------
296 $(MAKE
) port-specific-objects
298 $(MAKE
) clean_intermediate
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; \
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; \
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; \
336 if grep
'^ds390$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
337 $(MAKE
) MODELFLAGS
="-mds390" PORT
=ds390 PORTINCDIR
=$(INCDIR
)/mcs51 objects || exit
1; \
341 if grep
'^ds390$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
342 $(MAKE
) MODELFLAGS
="-mds400" PORT
=ds400 PORTINCDIR
=$(INCDIR
)/mcs51 objects || exit
1; \
346 if grep
'^xa51$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
347 $(MAKE
) MODELFLAGS
="-mxa51" PORT
=xa51 objects-xa51 || exit
1; \
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
)
360 ifeq ($(LIB_TYPE
), AR
)
361 ${SDAR} -rcSD
$(PORTDIR
)/lib
$(PORT
).lib
$(XA51OBJECTS
)
363 ifeq ($(LIB_TYPE
), RANLIB
)
364 ${SDAR} -rcD
$(PORTDIR
)/lib
$(PORT
).lib
$(XA51OBJECTS
)
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
)
374 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
375 $(MAKE
) MODELFLAGS
="-mz80" PORT
=z80 objects-z80 OEXT
=.o || exit
1; \
379 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
380 $(MAKE
) MODELFLAGS
="-mz180" PORT
=z180 objects-z80 OEXT
=.o || exit
1; \
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; \
389 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
390 $(MAKE
) MODELFLAGS
="-mz80n" PORT
=z80n objects-z80 OEXT
=.o || exit
1; \
394 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
395 $(MAKE
) MODELFLAGS
="-mr2k" PORT
=r2k objects-z80 OEXT
=.o || exit
1; \
399 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
400 $(MAKE
) MODELFLAGS
="-mr2ka" PORT
=r2ka objects-z80 OEXT
=.o || exit
1; \
404 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
405 $(MAKE
) MODELFLAGS
="-mr3ka" PORT
=r3ka objects-z80 OEXT
=.o || exit
1; \
409 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
410 $(MAKE
) MODELFLAGS
="-mtlcs90" PORT
=tlcs90 objects-z80 OEXT
=.o || exit
1; \
414 if grep
'^z80$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
415 $(MAKE
) MODELFLAGS
="-msm83" PORT
=sm83 objects-z80 OEXT
=.o || exit
1; \
420 $(MAKE
) port-specific-objects
421 $(MAKE
) clean_intermediate
424 if grep
'^hc08$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
425 $(MAKE
) MODELFLAGS
="-mhc08" PORT
=hc08 objects-hc08 || exit
1; \
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; \
440 $(MAKE
) port-specific-objects
441 $(MAKE
) clean_intermediate
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; \
454 if grep
'^mos6502$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
455 $(MAKE
) MODELFLAGS
="-mmos65c02" PORT
=mos65c02 objects-mos6502 || exit
1; \
460 $(MAKE
) port-specific-objects
461 $(MAKE
) clean_intermediate
464 if grep
'^stm8$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
465 $(MAKE
) MODELFLAGS
="-mstm8" PORT
=stm8 objects-stm8 || exit
1; \
470 $(MAKE
) port-specific-objects
471 $(MAKE
) clean_intermediate
474 if grep
'^stm8$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
475 $(MAKE
) MODELFLAGS
="-mstm8 --model-large" PORT
=stm8-large objects-stm8 || exit
1; \
479 if grep
'^pdk$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
480 $(MAKE
) MODELFLAGS
="-mpdk13" PORT
=pdk13 objects-pdk13 || exit
1; \
485 $(MAKE
) port-specific-objects
486 $(MAKE
) clean_intermediate
489 if grep
'^pdk$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
490 $(MAKE
) MODELFLAGS
="-mpdk14" PORT
=pdk14 objects-pdk14 || exit
1; \
495 $(MAKE
) port-specific-objects
496 $(MAKE
) clean_intermediate
499 if grep
'^pdk$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
500 $(MAKE
) MODELFLAGS
="-mpdk15" PORT
=pdk15 objects-pdk15 || exit
1; \
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; \
514 if grep
'^pic16$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
515 $(MAKE
) PORT
=pic16 objects-pic16
; \
520 $(MAKE
) port-specific-objects-pic16
521 $(MAKE
) clean_intermediate-pic16
524 if grep
'^pic14$$' $(top_builddir
)/ports.build
> /dev
/null
; then \
525 $(MAKE
) PORT
=pic14 objects-pic14
; \
530 $(MAKE
) port-specific-objects-pic14
531 $(MAKE
) clean_intermediate-pic14
543 port-specific-objects
:
544 if
[ -f
$(PORT
)/Makefile
]; then \
545 $(MAKE
) -C
$(PORT
) PORT
=$(PORT
) || exit
1; \
548 port-specific-objects-pic16
:
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
); \
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
; \
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
)
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
)
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
)
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
)
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 \
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
{} + ; \
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*' \
) \
685 # Deleting all the installed files
686 # --------------------------------
688 rm -rf
$(sdcc_libdir
)
690 # Performing self-test
691 # --------------------
695 # Performing installation test
696 # ----------------------------
700 # Creating installation directories
701 # ---------------------------------
703 for model in
$(MODELS
); do \
704 mkdir
-p
$(sdcc_libdir
)/$$model; \
706 for
libdir in small-stack-auto ds390 ds400 hc08 s08 pic16 pic14
; do \
707 mkdir
-p
$(sdcc_libdir
)/$$libdir; \
709 mkdir
-p
$(sdcc_libdir
)/src
711 # Creating dependencies
712 # ---------------------
715 Makefile.dep
: $(SOURCES
) $(INCDIR
)/*.h
$(PORTINCDIR
)/*.h
717 for i in
$(filter %.c
,$^
); do \
718 $(CPP
) -std
=c2x
-M
$(CPPFLAGS
) $$i >$${i}.dep
; \
719 cat
$${i}.dep
>>Makefile.dep
; \
723 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs checkconf \
724 clean distclean mostlyclean realclean)" ""
725 -include Makefile.dep
727 include $(srcdir)/clean.mk
734 $(PORT
)/%$(OEXT
): %.c
735 $(CC
) $(CPPFLAGS
) $(CFLAGS
) -c
$< -o
$@
737 # Remaking configuration
738 # ----------------------
740 @if
[ -f
$(top_builddir
)/devel
]; then\
741 $(MAKE
) -f
$(srcdir)/conf.mk
srcdir="$(srcdir)" top_builddir
="$(top_builddir)" \
745 # End of main_in.mk/main.mk
747 Makefile
: $(srcdir)/Makefile.in
748 cd
$(top_builddir
); .
/config.status device
/lib
/Makefile