struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / lib / mcs51 / Makefile.in
blob85866712c5b061d4daeb9192dc89d8351ca785c1
1 # libc/mcs51 Makefile
3 VPATH = @srcdir@
4 srcdir = @srcdir@
6 top_srcdir = @top_srcdir@
7 top_builddir = @top_builddir@
9 LIB_TYPE = @LIB_TYPE@
10 SAS = $(top_builddir)/bin/sdas8051
11 SCC = $(top_builddir)/bin/sdcc
12 SDAR = $(top_builddir)/bin/sdar
14 # override PORTDIR defined by super (parent) makefile
15 override PORTDIR = ../build/$(PORT)
17 OBJ = crtstart.rel crtxinit.rel crtxclear.rel crtclear.rel \
18 crtpagesfr.rel crtbank.rel crtcall.rel \
19 crtxstack.rel crtxpush.rel crtxpushr0.rel crtxpop.rel crtxpopr0.rel \
20 gptr_cmp.rel \
21 atomic_flag_test_and_set.rel atomic_flag_clear.rel __sdcc_atomic_maybe_rollback.rel
23 LIB = mcs51.lib
25 CC = $(SCC)
26 AS = $(SAS)
27 ASFLAGS = -plosgff
29 CFLAGS = -I$(top_srcdir)/device/include --std-c23
31 all: $(PORTDIR)/$(LIB)
33 $(PORTDIR)/$(LIB): $(OBJ) Makefile
34 ifeq ($(LIB_TYPE), SDCCLIB)
35 rm -f $@; \
36 $(top_builddir)/bin/sdcclib -a $@ $(OBJ)
37 else
38 ifeq ($(LIB_TYPE), AR)
39 $(SDAR) -rcSD $@ $(OBJ)
40 else
41 ifeq ($(LIB_TYPE), RANLIB)
42 $(SDAR) -rcD $@ $(OBJ)
43 else
44 rm -f $@
45 for i in $(basename $(OBJ)); do echo $$i >>$@; done
46 cp $(OBJ) $(PORTDIR)
47 endif
48 endif
49 endif
51 %.rel: %.c
52 $(CC) $(CFLAGS) -c $<
54 %.rel: %.asm
55 @# TODO: asx8051 should place it\'s output in the current dir
56 test $(srcdir) = . || cp $< .
57 -$(AS) $(ASFLAGS) $(notdir $<)
58 test $(srcdir) = . || rm $(notdir $<)
60 clean:
61 rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.lib
63 distclean: clean
64 rm -r Makefile
66 Makefile: $(srcdir)/Makefile.in
67 cd $(top_builddir); ./config.status device/lib/mcs51/Makefile