1 # libc/stm8-large Makefile
5 top_builddir
= @top_builddir@
6 abs_top_builddir
= @abs_top_builddir@
10 EXTRA_CFLAGS
= -mstm8
--model-large
--max-allocs-per-node
25000
11 SAS
= $(top_builddir
)/bin
/sdasstm8
13 # override PORTDIR defined by super (parent) makefile
14 override PORTDIR
= ..
/build
/stm8-large
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 STM8_FLOAT
= $(COMMON_FLOAT
)
26 STM8_INT
= _mulschar.c _divschar.c _modschar.c
30 STM8_LONGLONG
= $(COMMON_LONGLONG
) \
41 STM8_SDCC
= $(COMMON_SDCC
) \
55 STM8SOURCES
= $(addprefix ..
/,$(STM8_FLOAT
) $(STM8_INT
) $(STM8_LONG
) $(STM8_LONGLONG
) $(STM8_SDCC
))
56 STM8OBJECTS
= $(patsubst %.c
,%.rel
,$(STM8_FLOAT
) $(STM8_INT
) $(STM8_LONG
) $(STM8_LONGLONG
) $(STM8_SDCC
))
58 OBJ
= setjmp.rel _mulint.rel __mulsint2slong.rel __mululonguchar2ulonglong.rel _divsint.rel _modsint.rel _mullong.rel _divulong.rel _modulong.rel _divslong.rel _modslong.rel _fast_long_neg.rel heap.rel strcpy.rel strcmp.rel memcpy.rel atomic_flag_test_and_set.rel
64 CFLAGS
= -I
$(srcdir)/..
/..
/include -I.
--std-c23
66 all: $(PORTDIR
)/$(LIB
)
68 $(PORTDIR
)/$(LIB
): $(OBJ
) $(STM8OBJECTS
) Makefile
69 ifeq ($(LIB_TYPE
), SDCCLIB
)
71 $(top_builddir
)/bin
/sdcclib
-a
$@
$(OBJ
) $(STM8OBJECTS
)
73 ifeq ($(LIB_TYPE
), AR
)
74 $(SDAR
) -rcSD
$@
$(OBJ
) $(STM8OBJECTS
)
76 ifeq ($(LIB_TYPE
), RANLIB
)
77 $(SDAR
) -rcD
$@
$(OBJ
) $(STM8OBJECTS
)
80 for i in
$(basename $(OBJ
) $(STM8OBJECTS
)); do echo
$$i >>$@
; done
81 cp
$(OBJ
) $(STM8OBJECTS
) $(PORTDIR
)
87 rm -f
*.rel
*.sym
*.lst
*~
$(CLEANSPEC
) *.dump
* *.asm
*.lib
92 Makefile
: $(srcdir)/Makefile.in
93 cd
$(top_builddir
); .
/config.status device
/lib
/stm8-large
/Makefile