1 # Port specification for the mcs51 port running with uCsim
3 # model small stack-auto
5 LIBSRCDIR = ../../device/lib
6 LIBDIR = gen/$(PORT)/lib
8 LIBSDCCFLAGS+=--stack-auto --int-long-reent --float-reent
9 SDCCFLAGS +=$(LIBSDCCFLAGS) --nostdlib -L$(LIBDIR) -llibsdcc -llibint \
10 -lliblong -llibfloat -lmcs51
13 $(PORTS_DIR)/$(PORT)/%.c: $(PORTS_DIR)/mcs51/%.c
16 include $(PORTS_DIR)/mcs51/spec.mk
18 SOURCES = _atoi.c _atol.c _autobaud.c _bp.c _schar2fs.c \
19 _decdptr.c _divsint.c _divslong.c _divuint.c \
20 _divulong.c _fs2schar.c _fs2sint.c _fs2slong.c \
21 _fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \
22 _fsdiv.c _fseq.c _fsgt.c _fslt.c _fsmul.c \
23 fabsf.c sqrtf.c logf.c log10f.c powf.c tanf.c \
24 errno.c frexpf.c ldexpf.c tancotf.c \
25 _fsneq.c _fssub.c _gptrget.c _gptrput.c \
26 _sint2fs.c _iscntrl.c _isdigit.c _isgraph.c \
27 _islower.c _isprint.c _ispunct.c _isspace.c \
28 _isupper.c _isxdigit.c _slong2fs.c \
29 _memcmp.c _memcpy.c _memmove.c _memset.c \
30 _modsint.c _modslong.c _moduint.c _modulong.c \
31 _mulint.c _mullong.c \
34 _strcat.c _strchr.c _strcmp.c _strcpy.c \
35 _strcspn.c _strlen.c _strncat.c _strncmp.c \
36 _strncpy.c _strpbrk.c _strrchr.c _strspn.c \
38 _uchar2fs.c _uint2fs.c _ulong2fs.c \
39 calloc.c malloc.c realloc.c free.c \
40 serial.c ser_ir.c printfl.c \
41 printf_large.c sprintf.c vprintf.c puts.c gets.c \
42 assert.c time.c printf_fast.c bpx.c
44 OBJECTS = $(patsubst %.c,$(LIBDIR)/%.rel,$(SOURCES))
45 MODULES = $(patsubst %.c,%,$(SOURCES))
48 make-library: $(LIBDIR) $(OBJECTS) lib-files
54 $(LIBDIR)/%.rel: $(LIBSRCDIR)/%.c
55 -$(SDCC) -I../../device/include $(LIBSDCCFLAGS) -c $< -o $@
59 make -C $(LIBSRCDIR)/mcs51 all
60 cp $(LIBSRCDIR)/mcs51/*.rel $(LIBSRCDIR)/mcs51/mcs51.lib $(LIBDIR)
61 echo $(MODULES) | tr ' ' '\n' > $(LIBDIR)/libsdcc.lib
62 touch $(LIBDIR)/libfloat.lib $(LIBDIR)/libint.lib $(LIBDIR)/liblong.lib