Announce SDCC 4.5.0 RC1.
[sdcc.git] / sdcc / device / lib / ds390 / Makefile.in
blob2c91ad20178c449246fed96a505619c3693898c2
1 # libc/ds390 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/ds390
16 #VERBOSE = --verbose
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
28 clean:
29 rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex
30 rm -f *.ihx temp.lnk *.map *.lib
32 distclean: clean
33 rm -f Makefile Makefile.dep
35 $(PORTDIR)/libds390.lib: $(OBJECTS)
36 ifeq ($(LIB_TYPE), SDCCLIB)
37 rm -f $@; \
38 $(top_builddir)/bin/sdcclib -a $@ $(OBJECTS)
39 else
40 ifeq ($(LIB_TYPE), AR)
41 $(SDAR) -rcSD $@ $(OBJECTS)
42 else
43 ifeq ($(LIB_TYPE), RANLIB)
44 $(SDAR) -rcD $@ $(OBJECTS)
45 else
46 rm -f $@;
47 for libfile in $(basename $(OBJECTS)); do echo $$libfile >>$@; done
48 cp $(OBJECTS) $(PORTDIR)
49 endif
50 endif
51 endif
53 %.rel: %.c
54 $(CC) -c $(CFLAGS) $<
56 # Creating dependencies
57 # ---------------------
58 depend: Makefile.dep
60 Makefile.dep: $(SOURCES)
61 rm -f Makefile.dep
62 for i in $^; do \
63 $(CC) -M $(CPPFLAGS) $$i >$${i}.dep; \
64 cat $${i}.dep >>Makefile.dep; \
65 rm $${i}.dep; \
66 done
68 ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" ""
69 -include Makefile.dep
70 endif