struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / lib / r2k / Makefile.in
bloba6a19b727da7820a933b384bb1183718c321d640
1 # libc/r2k Makefile
3 VPATH = @srcdir@
4 srcdir = @srcdir@
5 top_builddir = @top_builddir@
6 abs_top_builddir = @abs_top_builddir@
8 LIB_TYPE = @LIB_TYPE@
10 EXTRA_CFLAGS = -mr2k --max-allocs-per-node 25000
11 SAS = $(top_builddir)/bin/sdasrab
13 # override PORTDIR defined by super (parent) makefile
14 override PORTDIR = ../build/r2k
16 %.rel: %.s
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 Z80_FLOAT = $(COMMON_FLOAT)
26 Z80_INT = $(COMMON_INT)
28 Z80_LONG = $(COMMON_LONG) \
29 _divulong.c \
30 _mullong.c
32 Z80_LONGLONG = $(COMMON_LONGLONG) \
33 _mullonglong.c \
34 _divslonglong.c \
35 _divulonglong.c \
36 _modslonglong.c \
37 _modulonglong.c
39 Z80_SDCC = $(COMMON_SDCC) \
40 __itoa.c \
41 __ltoa.c \
42 _startup.c \
43 div.c \
44 ldiv.c \
45 lldiv.c \
46 sprintf.c \
47 vprintf.c \
48 strlen.c \
49 strnlen.c \
50 _strcmp.c \
51 atomic_flag_clear.c
53 Z80SOURCES = $(addprefix ../,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC))
54 Z8OBJECTS = $(patsubst %.c,%.rel,$(Z80_FLOAT) $(Z80_INT) $(Z80_LONG) $(Z80_LONGLONG) $(Z80_SDCC))
56 OBJ = divunsigned.rel divsigned.rel divmixed.rel modunsigned.rel modsigned.rel modmixed.rel mul.rel mulchar.rel \
57 heap.rel memmove.rel strcpy.rel abs.rel __sdcc_call_hl.rel __sdcc_call_iy.rel crtenter.rel memcpy.rel \
58 setjmp.rel atomic_flag_test_and_set.rel
60 LIB = r2k.lib
61 AS = $(SAS)
62 ASFLAGS = -plosgff
64 CFLAGS = -I$(srcdir)/../../include -I. --std-c23
66 all: $(PORTDIR)/$(LIB) $(PORTDIR)/crt0.rel
68 $(PORTDIR)/crt0.rel: crt0.rel
69 cp crt0.rel $(PORTDIR)/crt0.rel
71 Makefile: $(srcdir)/Makefile.in
72 cd $(top_builddir); ./config.status device/lib/r2k/Makefile
74 $(PORTDIR)/$(LIB): $(OBJ) $(Z8OBJECTS) Makefile
75 rm -f $@
76 ifeq ($(LIB_TYPE), SDCCLIB)
77 $(top_builddir)/bin/sdcclib -a $@ $(OBJ) $(Z8OBJECTS)
78 else
79 ifeq ($(LIB_TYPE), AR)
80 $(SDAR) -rcSD $@ $(OBJ) $(Z8OBJECTS)
81 else
82 ifeq ($(LIB_TYPE), RANLIB)
83 $(SDAR) -rcD $@ $(OBJ) $(Z8OBJECTS)
84 else
85 for i in $(basename $(OBJ) $(Z8OBJECTS)); do echo $$i >>$@; done
86 cp $(OBJ) $(Z8OBJECTS) $(PORTDIR)
87 endif
88 endif
89 endif
91 clean:
92 rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib
94 distclean: clean
95 rm -f Makefile
97 Makefile: $(srcdir)/Makefile.in
98 cd $(top_builddir); ./config.status device/lib/r2k/Makefile