5 top_builddir
= @top_builddir@
6 abs_top_builddir
= @abs_top_builddir@
10 CC
= $(top_builddir
)/bin
/sdcc
11 SDAR
= $(abs_top_builddir
)/bin
/sdar
13 # override PORTDIR defined by super (parent) makefile
14 override PORTDIR
= ..
/build
/ds390
18 OBJECTS
= tinibios.rel memcpyx.rel i2c390.rel rtc390.rel putchar.rel gptr_cmp.rel \
19 atomic_flag_test_and_set.rel atomic_flag_clear.rel __sdcc_atomic_maybe_rollback.rel
21 SOURCES
= $(patsubst %.rel
,%.c
,$(OBJECTS
))
23 CPPFLAGS
= -I
$(srcdir)/..
/..
/include
24 CFLAGS
= -mds390
$(CPPFLAGS
) $(VERBOSE
) --std-c23
26 all: $(OBJECTS
) $(PORTDIR
)/libds390.lib
29 rm -f
*.lst
*.rel
*.sym
*.cdb
*.asm \
#* *~ *.rst *.hex
30 rm -f
*.ihx temp.lnk
*.map
*.lib
33 rm -f Makefile Makefile.dep
35 $(PORTDIR
)/libds390.lib
: $(OBJECTS
)
36 ifeq ($(LIB_TYPE
), SDCCLIB
)
38 $(top_builddir
)/bin
/sdcclib
-a
$@
$(OBJECTS
)
40 ifeq ($(LIB_TYPE
), AR
)
41 $(SDAR
) -rcSD
$@
$(OBJECTS
)
43 ifeq ($(LIB_TYPE
), RANLIB
)
44 $(SDAR
) -rcD
$@
$(OBJECTS
)
47 for libfile in
$(basename $(OBJECTS
)); do echo
$$libfile >>$@
; done
48 cp
$(OBJECTS
) $(PORTDIR
)
56 # Creating dependencies
57 # ---------------------
60 Makefile.dep
: $(SOURCES
)
63 $(CC
) -M
$(CPPFLAGS
) $$i >$${i}.dep
; \
64 cat
$${i}.dep
>>Makefile.dep
; \
68 ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" ""