struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / device / lib / ds400 / Makefile.in
blob3cad38f4b3925fdb050cdd1fa2367b885a3d2433
1 # libc/ds400 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 CC = $(top_builddir)/bin/sdcc
11 SDAR = $(abs_top_builddir)/bin/sdar
13 # override PORTDIR defined by super (parent) makefile
14 override PORTDIR = ../build/ds400
16 #VERBOSE = --verbose
18 OBJECTS = tinibios.rel memcpyx.rel ds400rom.rel
20 SOURCES = $(patsubst %.rel,%.c,$(OBJECTS))
22 CPPFLAGS = -I$(srcdir)/../../include -I$(srcdir)/../../include/ds400
23 CFLAGS = -mds400 $(CPPFLAGS) $(VERBOSE) --std-c23
25 all: $(OBJECTS) $(PORTDIR)/libds400.lib
27 clean:
28 rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex
29 rm -f *.ihx temp.lnk *.map *.lib
31 distclean: clean
32 rm -f Makefile Makefile.dep
34 $(PORTDIR)/libds400.lib: $(OBJECTS)
35 ifeq ($(LIB_TYPE), SDCCLIB)
36 rm -f $@; \
37 $(top_builddir)/bin/sdcclib -a $@ $(OBJECTS)
38 else
39 ifeq ($(LIB_TYPE), AR)
40 $(SDAR) -rcSD $@ $(OBJECTS)
41 else
42 ifeq ($(LIB_TYPE), RANLIB)
43 $(SDAR) -rcD $@ $(OBJECTS)
44 else
45 rm -f $@;
46 for libfile in $(basename $(OBJECTS)); do echo $$libfile >>$@; done
47 cp $(OBJECTS) $(PORTDIR)
48 endif
49 endif
50 endif
52 %.rel: %.c
53 $(CC) -c $(CFLAGS) $<
55 # Creating dependencies
56 # ---------------------
57 depend: Makefile.dep
59 Makefile.dep: $(SOURCES)
60 rm -f Makefile.dep
61 for i in $^; do \
62 $(CC) -M $(CPPFLAGS) $$i >$${i}.dep; \
63 cat $${i}.dep >>Makefile.dep; \
64 rm $${i}.dep; \
65 done
67 ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" ""
68 -include Makefile.dep
69 endif
71 Makefile: $(srcdir)/Makefile.in
72 cd $(top_builddir); ./config.status device/lib/ds400/Makefile