5 top_builddir
= @top_builddir@
6 abs_top_builddir
= @abs_top_builddir@
10 CC
= export PATH
=$(top_builddir
)/bin
; sdcc
11 EXTRA_CFLAGS
= -mstm8
--max-allocs-per-node
25000
12 SAS
= $(top_builddir
)/bin
/sdasstm8
14 # override PORTDIR defined by super (parent) makefile
15 override PORTDIR
= ..
/build
/stm8
18 @
# TODO: sdas should place it\'s output in the current dir
19 test $(srcdir) = . || cp
$< .
20 -$(AS
) $(ASFLAGS
) $(notdir $<)
21 test $(srcdir) = . ||
rm $(notdir $<)
23 include $(srcdir)/..
/incl.mk
25 STM8_FLOAT
= $(COMMON_FLOAT
)
27 STM8_INT
= _mulschar.c _divschar.c _modschar.c
33 STM8_LONGLONG
= $(COMMON_LONGLONG
) \
44 STM8_SDCC
= $(COMMON_SDCC
) \
58 STM8SOURCES
= $(addprefix ..
/,$(STM8_FLOAT
) $(STM8_INT
) $(STM8_LONG
) $(STM8_LONGLONG
) $(STM8_SDCC
))
59 STM8OBJECTS
= $(patsubst %.c
,%.rel
,$(STM8_FLOAT
) $(STM8_INT
) $(STM8_LONG
) $(STM8_LONGLONG
) $(STM8_SDCC
))
61 OBJ
= setjmp.rel _mulint.rel __mulsint2slong.rel __mululonguchar2ulonglong.rel _divsint.rel _modsint.rel _mullong.rel _divslong.rel _modslong.rel _fast_long_neg.rel heap.rel strcpy.rel strcmp.rel memcpy.rel atomic_flag_test_and_set.rel
67 CFLAGS
= -I
$(srcdir)/..
/..
/include -I.
--std-c23
69 all: $(PORTDIR
)/$(LIB
)
71 $(PORTDIR
)/$(LIB
): $(OBJ
) $(STM8OBJECTS
) Makefile
72 ifeq ($(LIB_TYPE
), SDCCLIB
)
74 $(top_builddir
)/bin
/sdcclib
-a
$@
$(OBJ
) $(STM8OBJECTS
)
76 ifeq ($(LIB_TYPE
), AR
)
77 $(SDAR
) -rcSD
$@
$(OBJ
) $(STM8OBJECTS
)
79 ifeq ($(LIB_TYPE
), RANLIB
)
80 $(SDAR
) -rcD
$@
$(OBJ
) $(STM8OBJECTS
)
83 for i in
$(basename $(OBJ
) $(STM8OBJECTS
)); do echo
$$i >>$@
; done
84 cp
$(OBJ
) $(STM8OBJECTS
) $(PORTDIR
)
90 rm -f
*.rel
*.sym
*.lst
*~
$(CLEANSPEC
) *.dump
* *.asm
*.lib
95 Makefile
: $(srcdir)/Makefile.in
96 cd
$(top_builddir
); .
/config.status device
/lib
/stm8
/Makefile