1 # libc/mos65c02 Makefile
5 top_builddir
= @top_builddir@
6 abs_top_builddir
= @abs_top_builddir@
10 EXTRA_CFLAGS
= -mmos65c02
--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
/mos65c02
17 @
# TODO: sdas should place it\'s output in the current dir
18 test $(srcdir) = . || cp
$< .
19 -$(AS
) $(ASFLAGS
) $(notdir $<)
20 test $(srcdir) = . ||
rm $(notdir $<)
22 include $(srcdir)/..
/incl.mk
24 M6502_FLOAT
= $(COMMON_FLOAT
)
26 M6502_INT
= $(COMMON_INT
) \
39 M6502_LONG
= $(COMMON_LONG
) \
43 M6502_LONGLONG
= $(COMMON_LONGLONG
) \
54 M6502_SDCC
= $(COMMON_SDCC
) \
71 M6502SOURCES
= $(addprefix ..
/,$(M6502_FLOAT
) $(M6502_INT
) $(M6502_LONG
) $(M6502_LONGLONG
) $(M6502_SDCC
))
72 M6502OBJECTS
= $(patsubst %.c
,%.rel
,$(M6502_FLOAT
) $(M6502_INT
) $(M6502_LONG
) $(M6502_LONGLONG
) $(M6502_SDCC
))
74 OBJ
= _dptr.rel _temp.rel _ret01.rel _ret23.rel _ret4567.rel _setjmp.rel atomic_flag_test_and_set.rel __sdcc_indirect_jsr.rel
80 CFLAGS
= -I
$(srcdir)/..
/..
/include -I.
--std-c23
82 all: $(PORTDIR
)/$(LIB
) $(PORTDIR
)/crt0.rel
84 $(PORTDIR
)/crt0.rel
: crt0.rel
85 cp crt0.rel
$(PORTDIR
)/crt0.rel
87 $(PORTDIR
)/$(LIB
): $(OBJ
) $(M6502OBJECTS
) Makefile
88 ifeq ($(LIB_TYPE
), SDCCLIB
)
90 $(top_builddir
)/bin
/sdcclib
-a
$@
$(OBJ
) $(M6502OBJECTS
)
92 ifeq ($(LIB_TYPE
), AR
)
93 $(SDAR
) -rcSD
$@
$(OBJ
) $(M6502OBJECTS
)
95 ifeq ($(LIB_TYPE
), RANLIB
)
96 $(SDAR
) -rcD
$@
$(OBJ
) $(M6502OBJECTS
)
99 for i in
$(basename $(OBJ
) $(M6502OBJECTS
)); do echo
$$i >>$@
; done
100 cp
$(OBJ
) $(M6502OBJECTS
) $(PORTDIR
)
106 rm -f
*.rel
*.sym
*.lst
*~
$(CLEANSPEC
) *.dump
* *.asm
*.lib
111 Makefile
: $(srcdir)/Makefile.in
112 cd
$(top_builddir
); .
/config.status device
/lib
/mos65c02
/Makefile