* src/SDCCmain.c (linkEdit): don't suppress crt0 if --nostdlib is used
[fw/sdcc] / support / regression / ports / mcs51-stack-auto / spec.mk
1 # Port specification for the mcs51 port running with uCsim
2 #
3 # model small stack-auto
4
5 include $(PORTS_DIR)/mcs51/spec.mk
6
7 LIBSRCDIR = ../../device/lib
8 LIBDIR    = gen/$(PORT)/lib
9
10 LIBSDCCFLAGS+=--stack-auto
11 SDCCFLAGS   +=$(LIBSDCCFLAGS)
12
13 # copy support.c
14 $(PORTS_DIR)/$(PORT)/%.c: $(PORTS_DIR)/mcs51/%.c
15         cp $< $@
16
17 SOURCES = _atoi.c _atol.c _autobaud.c _bp.c _schar2fs.c \
18           _decdptr.c _divsint.c _divslong.c _divuint.c \
19           _divulong.c _fs2schar.c _fs2sint.c _fs2slong.c \
20           _fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \
21           _fsdiv.c _fseq.c _fsgt.c _fslt.c _fsmul.c \
22           fabsf.c sqrtf.c logf.c log10f.c powf.c tanf.c \
23           errno.c frexpf.c ldexpf.c tancotf.c \
24           _fsneq.c _fssub.c _gptrget.c _gptrput.c \
25           _sint2fs.c _iscntrl.c _isdigit.c _isgraph.c \
26           _islower.c _isprint.c _ispunct.c _isspace.c \
27           _isupper.c _isxdigit.c _slong2fs.c \
28           _memcmp.c _memcpy.c _memmove.c _memset.c \
29           _modsint.c _modslong.c _moduint.c _modulong.c \
30           _mulint.c _mullong.c \
31           _ser.c _setjmp.c \
32           _spx.c _startup.c \
33           _strcat.c _strchr.c _strcmp.c _strcpy.c \
34           _strcspn.c _strlen.c _strncat.c _strncmp.c \
35           _strncpy.c _strpbrk.c _strrchr.c _strspn.c \
36           _strstr.c _strtok.c \
37           _uchar2fs.c _uint2fs.c _ulong2fs.c \
38           calloc.c malloc.c realloc.c free.c \
39           serial.c ser_ir.c printfl.c \
40           printf_large.c sprintf.c vprintf.c puts.c gets.c \
41           assert.c time.c printf_fast.c bpx.c
42
43 OBJECTS = $(patsubst %.c,$(LIBDIR)/%.rel,$(SOURCES))
44 MODULES = $(patsubst %.c,%,$(SOURCES))
45
46 .PHONY: make-library
47 make-library: $(LIBDIR) $(OBJECTS) lib-files
48
49
50 $(LIBDIR):
51         mkdir -p $(LIBDIR)
52
53 $(LIBDIR)/%.rel: $(LIBSRCDIR)/%.c
54         -$(SDCC) -I../../device/include $(LIBSDCCFLAGS) -c $< -o $@
55
56 .PHONY: lib-files
57 lib-files:
58         make -C $(LIBSRCDIR)/mcs51 all
59         cp $(LIBSRCDIR)/mcs51/*.rel $(LIBSRCDIR)/mcs51/mcs51.lib $(LIBDIR)
60         echo $(MODULES) | tr ' ' '\n' > $(LIBDIR)/libsdcc.lib
61         touch $(LIBDIR)/libfloat.lib $(LIBDIR)/libint.lib $(LIBDIR)/liblong.lib