blob: cd35c942f960b3d1434a0e98651b1199a47e922b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# libc/mcs51 Makefile
srcdir = .
top_srcdir = ../../..
top_builddir = ../../..
LIB_TYPE = RANLIB
SAS = $(top_builddir)/bin/sdas8051
SCC = $(top_builddir)/bin/sdcc
# override PORTDIR defined by super (parent) makefile
override PORTDIR = ../build/$(PORT)
OBJ = crtstart.rel crtxinit.rel crtxclear.rel crtclear.rel \
crtpagesfr.rel crtbank.rel crtcall.rel \
crtxstack.rel crtxpush.rel crtxpushr0.rel crtxpop.rel crtxpopr0.rel \
gptr_cmp.rel
LIB = mcs51.lib
CC = $(SCC)
AS = $(SAS)
ASFLAGS = -plosgff
CFLAGS = -I$(top_srcdir)/include --std-c11
all: $(PORTDIR)/$(LIB)
$(PORTDIR)/$(LIB): $(OBJ) Makefile
ifeq ($(LIB_TYPE), SDCCLIB)
rm -f $@; \
$(top_builddir)/bin/sdcclib -a $@ $(OBJ)
else
ifeq ($(LIB_TYPE), AR)
$(top_builddir)/bin/sdar -rcSD $@ $(OBJ)
else
ifeq ($(LIB_TYPE), RANLIB)
$(top_builddir)/bin/sdar -rcD $@ $(OBJ)
else
rm -f $@
for i in $(basename $(OBJ)); do echo $$i >>$@; done
cp $(OBJ) $(PORTDIR)
endif
endif
endif
%.rel: %.c
$(CC) $(CFLAGS) -c $<
%.rel: %.asm
@# TODO: asx8051 should place it\'s output in the current dir
test $(srcdir) = . || cp $< .
-$(AS) $(ASFLAGS) $(notdir $<)
test $(srcdir) = . || rm $(notdir $<)
clean:
rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.lib
distclean: clean
rm -r Makefile
|