1 # libc/mos6502 Makefile
5 top_builddir
= @top_builddir@
6 abs_top_builddir
= @abs_top_builddir@
10 EXTRA_CFLAGS
= -mmos6502
--stack-auto
--max-allocs-per-node
25000 --opt-code-speed
11 SAS
= $(top_builddir
)/bin
/sdas6500
13 # override PORTDIR defined by super (parent) makefile
14 override PORTDIR
= ..
/build
/mos6502-stack-auto
16 include $(srcdir)/..
/incl.mk
18 MOS6502_FLOAT
= $(COMMON_FLOAT
)
20 MOS6502_INT
= $(COMMON_INT
) \
33 MOS6502_LONG
= $(COMMON_LONG
) \
37 MOS6502_LONGLONG
= $(COMMON_LONGLONG
) \
48 MOS6502_SDCC
= $(COMMON_SDCC
) \
67 MOS6502SOURCES
= $(addprefix ..
/,$(MOS6502_FLOAT
) $(MOS6502_INT
) $(MOS6502_LONG
) $(MOS6502_LONGLONG
) $(MOS6502_SDCC
))
68 MOS6502OBJECTS
= $(patsubst %.c
,%.rel
,$(MOS6502_FLOAT
) $(MOS6502_INT
) $(MOS6502_LONG
) $(MOS6502_LONGLONG
) $(MOS6502_SDCC
))
70 OBJ
= _dptr.rel _temp.rel _ret01.rel _ret23.rel _ret4567.rel _setjmp.rel atomic_flag_test_and_set.rel __sdcc_indirect_jsr.rel
76 CFLAGS
= -I
$(srcdir)/..
/..
/include -I.
--std-c23
78 all: $(PORTDIR
)/$(LIB
) $(PORTDIR
)/crt0.rel
80 $(PORTDIR
)/crt0.rel
: crt0.rel
81 cp crt0.rel
$(PORTDIR
)/crt0.rel
83 $(PORTDIR
)/$(LIB
): $(OBJ
) $(MOS6502OBJECTS
) Makefile
84 ifeq ($(LIB_TYPE
), SDCCLIB
)
86 $(top_builddir
)/bin
/sdcclib
-a
$@
$(OBJ
) $(MOS6502OBJECTS
)
88 ifeq ($(LIB_TYPE
), AR
)
89 $(SDAR
) -rcSD
$@
$(OBJ
) $(MOS6502OBJECTS
)
91 ifeq ($(LIB_TYPE
), RANLIB
)
92 $(SDAR
) -rcD
$@
$(OBJ
) $(MOS6502OBJECTS
)
95 for i in
$(basename $(OBJ
) $(MOS6502OBJECTS
)); do echo
$$i >>$@
; done
96 cp
$(OBJ
) $(MOS6502OBJECTS
) $(PORTDIR
)
102 @
# TODO: sdas should place it\'s output in the current dir
103 test $(srcdir) = . || cp
$< .
104 -$(AS
) $(ASFLAGS
) $(notdir $<)
105 test $(srcdir) = . ||
rm $(notdir $<)
108 rm -f
*.rel
*.sym
*.lst
*~
$(CLEANSPEC
) *.dump
* *.asm
*.lib
113 Makefile
: $(srcdir)/Makefile.in
114 cd
$(top_builddir
); .
/config.status device
/lib
/mos6502-stack-auto
/Makefile