* support/regression/Makefile: new target test-mcs51-stack-auto
[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 LIBSRCDIR = ../../device/lib
6 LIBDIR    = gen/$(PORT)/lib
7
8 LIBSDCCFLAGS+=--stack-auto
9 SDCCFLAGS   +=$(LIBSDCCFLAGS) --int-long-reent --float-reent --nostdlib -L$(LIBDIR) -llibsdcc -llibint -lliblong -llibfloat
10
11 # copy support.c
12 $(PORTS_DIR)/$(PORT)/%.c: $(PORTS_DIR)/mcs51/%.c
13         cp $< $@
14
15 include $(PORTS_DIR)/mcs51/spec.mk
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           _fsneq.c _fssub.c _gptrget.c _gptrput.c \
23           _sint2fs.c _iscntrl.c _isdigit.c _isgraph.c \
24           _islower.c _isprint.c _ispunct.c _isspace.c \
25           _isupper.c _isxdigit.c _slong2fs.c _memcmp.c \
26           _memcpy.c _memset.c _modsint.c _modslong.c \
27           _moduint.c _modulong.c _mulint.c _mullong.c \
28           _ser.c _setjmp.c \
29           _spx.c _startup.c _strchr.c _strcmp.c _strcpy.c \
30           _strcspn.c _strlen.c _strncat.c _strncmp.c \
31           _strncpy.c _strpbrk.c _strrchr.c _strspn.c \
32           _strstr.c _strtok.c _uchar2fs.c _uint2fs.c \
33           _ulong2fs.c malloc.c serial.c ser_ir.c printfl.c \
34           printf_large.c vprintf.c puts.c gets.c \
35           assert.c _strcat.c time.c printf_fast.c bpx.c
36
37 OBJECTS = $(patsubst %.c,$(LIBDIR)/%.rel,$(SOURCES))
38
39 make-library: $(LIBDIR) $(OBJECTS) lib-files
40
41
42 $(LIBDIR):
43         mkdir -p $(LIBDIR)
44
45 $(LIBDIR)/%.rel: $(LIBSRCDIR)/%.c
46         -$(SDCC) -I../../device/include $(LIBSDCCFLAGS) -c $< \
47          && mv -f $(<:.c=.rel) $@ \
48          && mv -f $(<:.c=.asm) $(@:.rel=.asm) \
49          && mv -f $(<:.c=.lst) $(@:.rel=.lst)
50
51 lib-files:
52         cp $(LIBSRCDIR)/*.lib $(LIBDIR)