X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=device%2Flib%2FMakefile.in;h=15b25800543b4f81f46c935545b77adbf0ef2937;hb=67da89445478477cbda97171c16f8cc2666ce240;hp=31e8d875ede38ec46637bb6f753c2decfc8d43a7;hpb=e5b9beb67e37e9595289c672556a41bf7b229e95;p=fw%2Fsdcc diff --git a/device/lib/Makefile.in b/device/lib/Makefile.in index 31e8d875..15b25800 100644 --- a/device/lib/Makefile.in +++ b/device/lib/Makefile.in @@ -30,79 +30,204 @@ man2dir = $(mandir)/man2 infodir = @infodir@ srcdir = @srcdir@ -CPPFLAGS = -I$(INCDIR) -CFLAGS = - -OBJECTS = _atoi.rel _atol.rel _autobaud.rel _bp.rel _schar2fs.rel \ - _decdptr.rel _divsint.rel _divslong.rel _divuint.rel \ - _divulong.rel _fs2schar.rel _fs2sint.rel _fs2slong.rel \ - _fs2uchar.rel _fs2uint.rel _fs2ulong.rel _fsadd.rel \ - _fsdiv.rel _fseq.rel _fsgt.rel _fslt.rel _fsmul.rel \ - _fsneq.rel _fssub.rel _gptrget.rel _gptrput.rel \ - _sint2fs.rel _iscntrl.rel _isdigit.rel _isgraph.rel \ - _islower.rel _isprint.rel _ispunct.rel _isspace.rel \ - _isupper.rel _isxdigit.rel _slong2fs.rel _memcmp.rel \ - _memcpy.rel _memset.rel _modsint.rel _modslong.rel \ - _moduint.rel _modulong.rel _mulsint.rel _muluint.rel \ - _mululong.rel _muslong.rel _ser.rel _setjmp.rel \ - _spx.rel _startup.rel _strchr.rel _strcmp.rel _strcpy.rel \ - _strcspn.rel _strlen.rel _strncat.rel _strncmp.rel \ - _strncpy.rel _strpbrk.rel _strrchr.rel _strspn.rel \ - _strstr.rel _strtok.rel _uchar2fs.rel _uint2fs.rel \ - _ulong2fs.rel malloc.rel serial.rel ser_ir.rel printfl.rel \ - printf_large.rel vprintf.rel puts.rel gets.rel \ - assert.rel _strcat.rel -SOURCES = $(patsubst %.rel,%.c,$(OBJECTS)) +lib_dir_suffix = @lib_dir_suffix@ + +sdcc_libdir = $(datadir)/$(lib_dir_suffix) + +CPPFLAGS = -I$(INCDIR) +CFLAGS = $(MODELFLAGS) --nostdinc + +BUILDDIR = build +# Default +PORT = z80 +PORTDIR = $(BUILDDIR)/$(PORT) + +SOURCES = _atof.c _atoi.c _atol.c _autobaud.c _bp.c _schar2fs.c \ + _decdptr.c _divsint.c _divslong.c _divuint.c \ + _divulong.c _fs2schar.c _fs2sint.c _fs2slong.c \ + _fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \ + _fsdiv.c _fseq.c _fsgt.c _fslt.c _fsmul.c \ + _fsneq.c _fssub.c _gptrget.c _gptrgetc.c _gptrput.c \ + _sint2fs.c _iscntrl.c _isdigit.c _isgraph.c \ + _islower.c _isprint.c _ispunct.c _isspace.c \ + _isupper.c _isxdigit.c _itoa.c _ltoa.c \ + _slong2fs.c _memcmp.c \ + _memcpy.c _memmove.c _memset.c _modsint.c _modslong.c \ + _moduint.c _modulong.c _mulint.c _mullong.c \ + _ser.c _setjmp.c \ + _spx.c _startup.c _strchr.c _strcmp.c _strcpy.c \ + _strcspn.c _strlen.c _strncat.c _strncmp.c \ + _strncpy.c _strpbrk.c _strrchr.c _strspn.c \ + _strstr.c _strtok.c _uchar2fs.c _uint2fs.c \ + _ulong2fs.c malloc.c serial.c ser_ir.c printfl.c \ + printf_large.c vprintf.c puts.c gets.c \ + assert.c _strcat.c time.c printf_fast.c bpx.c \ + fabsf.c frexpf.c ldexpf.c expf.c powf.c sincosf.c sinf.c \ + cosf.c logf.c log10f.c sqrtf.c tancotf.c tanf.c cotf.c \ + asincosf.c asinf.c acosf.c atanf.c atan2f.c sincoshf.c \ + sinhf.c coshf.c tanhf.c floorf.c ceilf.c modff.c errno.c + +OBJECTS = $(patsubst %.c,$(PORTDIR)/%.rel,$(SOURCES)) + +Z80SOURCES = _atof.c _atoi.c \ + _iscntrl.c _isdigit.c _isgraph.c \ + _islower.c _isprint.c _ispunct.c _isspace.c \ + _isupper.c _isxdigit.c _memcmp.c \ + _memcpy.c _memmove.c _memset.c \ + _startup.c _strchr.c _strcmp.c _strcpy.c \ + _strcspn.c _strlen.c _strncat.c _strncmp.c \ + _strncpy.c _strpbrk.c _strrchr.c _strspn.c \ + _strstr.c _strtok.c \ + puts.c gets.c \ + assert.c _strcat.c \ + _modslong.c _modulong.c \ + _mullong.c \ + _divslong.c _divulong.c \ + malloc.c \ + _fs2schar.c _fs2sint.c _fs2slong.c \ + _fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \ + _fsdiv.c _fseq.c _fsgt.c _fslt.c _fsmul.c \ + _fsneq.c _fssub.c \ + _uchar2fs.c _uint2fs.c \ + _ulong2fs.c \ + _slong2fs.c _sint2fs.c _schar2fs.c + +Z80OBJECTS = $(Z80SOURCES:%.c=$(PORTDIR)/%.o) + +XA51SOURCES = _atof.c _atoi.c _atol.c _schar2fs.c \ + _divsint.c _divslong.c _divuint.c \ + _divulong.c _fs2schar.c _fs2sint.c _fs2slong.c \ + _fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \ + _fsdiv.c _fseq.c _fsgt.c _fslt.c _fsmul.c \ + _fsneq.c _fssub.c \ + _sint2fs.c _iscntrl.c _isdigit.c _isgraph.c \ + _islower.c _isprint.c _ispunct.c _isspace.c \ + _isupper.c _isxdigit.c _slong2fs.c _memcmp.c \ + _memcpy.c _memmove.c _memset.c _modsint.c _modslong.c \ + _moduint.c _modulong.c _mulint.c _mullong.c \ + _strchr.c _strcmp.c _strcpy.c \ + _strcspn.c _strlen.c _strncat.c _strncmp.c \ + _strncpy.c _strpbrk.c _strrchr.c _strspn.c \ + _strstr.c _strtok.c _uchar2fs.c _uint2fs.c \ + _ulong2fs.c malloc.c puts.c gets.c \ + printf_large.c puts.c gets.c \ + assert.c _strcat.c time.c \ + fabsf.c frexpf.c ldexpf.c expf.c powf.c sincosf.c sinf.c \ + cosf.c logf.c log10f.c sqrtf.c tancotf.c tanf.c cotf.c \ + asincosf.c asinf.c acosf.c atanf.c atan2f.c sincoshf.c \ + sinhf.c coshf.c tanhf.c floorf.c ceilf.c modff.c errno.c + +XA51OBJECTS = $(XA51SOURCES:%.c=$(PORTDIR)/%.rel) + +HC08SOURCES = _atof.c _atoi.c _atol.c _schar2fs.c \ + _divsint.c _divslong.c \ + _fs2schar.c _fs2sint.c _fs2slong.c \ + _fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \ + _fsdiv.c _fseq.c _fsgt.c _fslt.c _fsmul.c \ + _fsneq.c _fssub.c \ + _sint2fs.c _iscntrl.c _isdigit.c _isgraph.c \ + _islower.c _isprint.c _ispunct.c _isspace.c \ + _isupper.c _isxdigit.c _itoa.c _ltoa.c \ + _slong2fs.c _memcmp.c \ + _memcpy.c _memmove.c _memset.c _modsint.c _modslong.c \ + _moduint.c _modulong.c \ + _spx.c _startup.c _strchr.c _strcmp.c _strcpy.c \ + _strcspn.c _strlen.c _strncat.c _strncmp.c \ + _strncpy.c _strpbrk.c _strrchr.c _strspn.c \ + _strstr.c _strtok.c _uchar2fs.c _uint2fs.c \ + _ulong2fs.c malloc.c \ + assert.c _strcat.c time.c \ + fabsf.c frexpf.c ldexpf.c expf.c powf.c sincosf.c sinf.c \ + cosf.c logf.c log10f.c sqrtf.c tancotf.c tanf.c cotf.c \ + asincosf.c asinf.c acosf.c atanf.c atan2f.c sincoshf.c \ + sinhf.c coshf.c tanhf.c floorf.c ceilf.c modff.c errno.c + +HC08OBJECTS = $(patsubst %.c,$(PORTDIR)/%.rel,$(HC08SOURCES)) + +OEXT = .rel include incl.mk # Compiling entire program or any subproject # ------------------------------------------ -all: checkconf models modelDS390 +all: checkconf models model-ds390 model-ds400 model-z80 model-gbz80 model-hc08 -objects: $(OBJECTS) +objects: build-dir $(OBJECTS) port-specific-objects lib-files clean_intermediate models: - for model in $(MODELS); do \ - test -d $$model || mkdir $$model; \ - $(MAKE) CFLAGS="$(CFLAGS) --model-$$model" objects; \ - mv *.rel $$model; \ - mv *.asm $$model; \ - mv *.cdb $$model; \ - done + if [ "`grep mcs51 ../../ports.build`" = mcs51 ]; then \ + for model in $(MODELS); do \ + $(MAKE) MODELFLAGS="--model-$$model" PORT=$$model objects; \ + done \ + fi -modelDS390: - test -d ds390 || mkdir ds390 - $(MAKE) CFLAGS="$(CFLAGS) -mds390 --model-flat24 \ - --stack-10bit" objects - cd ds390; $(MAKE) - cp *.lib ds390 - mv *.rel *.asm *.cdb ds390 +model-ds390: + if [ "`grep ds390 ../../ports.build`" = ds390 ]; then \ + $(MAKE) MODELFLAGS="-mds390" PORT=ds390 objects; \ + fi + +model-ds400: + if [ "`grep ds400 ../../ports.build`" = ds400 ]; then \ + $(MAKE) MODELFLAGS="-mds400" PORT=ds400 objects; \ + fi + +model-xa51: + if [ "`grep xa51 ../../ports.build`" = xa51 ]; then \ + $(MAKE) MODELFLAGS="-mxa51" PORT=xa51 objects-xa51; \ + fi + +objects-xa51: build-dir $(XA51OBJECTS) port-specific-objects + cd $(PORTDIR); ls *$(OEXT) > lib$(PORT).lib + +model-z80: + if [ "`grep z80 ../../ports.build`" = z80 ]; then \ + $(MAKE) MODELFLAGS="-mz80" PORT=z80 objects-z80 OEXT=.o; \ + fi + +model-gbz80: + if [ "`grep z80 ../../ports.build`" = z80 ]; then \ + $(MAKE) MODELFLAGS="-mgbz80" PORT=gbz80 objects-z80 OEXT=.o; \ + fi + +objects-z80: build-dir $(Z80OBJECTS) port-specific-objects clean_intermediate + cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib + +model-hc08: + if [ "`grep hc08 ../../ports.build`" = hc08 ]; then \ + $(MAKE) MODELFLAGS="-mhc08" PORT=hc08 objects-hc08; \ + fi + +objects-hc08: build-dir $(HC08OBJECTS) port-specific-objects clean_intermediate + cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib + +build-dir: $(PORTDIR) + +$(PORTDIR): + mkdir -p $(PORTDIR) + +port-specific-objects: + if [ -d $(PORT) ]; then \ + $(MAKE) -C $(PORT); \ + cp -f $(PORT)/*.lib $(PORT)/*$(OEXT) $(PORTDIR); \ + fi + +lib-files: + cp *.lib $(PORTDIR) + +clean_intermediate: + rm -f $(PORTDIR)/*.lst $(PORTDIR)/*.sym # Compiling and installing everything and runing test # --------------------------------------------------- -install: installDS390 - $(CP) *.c $(datadir)/lib/ - for model in $(MODELS); do \ - [ -d $$model ] || $(MAKE) all; \ - $(CP) $$model/*.rel *.lib $(datadir)/lib/$$model/; \ - $(CP) $$model/*.asm $(datadir)/lib/$$model/; \ - $(CP) $$model/*.cdb $(datadir)/lib/$$model/; \ - done - -installDS390: installdirs - $(CP) ds390/*.lib ds390/*.rel ds390/*.asm ds390/*.cdb $(datadir)/lib/ds390 +install: all installdirs + cp -r $(BUILDDIR)/* $(sdcc_libdir) + cp -r ds390 ds400 gbz80 z80 hc08 *.c $(sdcc_libdir)/src + rm -r `find $(sdcc_libdir)/src -name '*.rel' -or -name '*.dump*' -or -name '*.sym' -or -name '*.o' -or -name '*.lst' -or -name '*.asm' -or -name 'CVS'` # Deleting all the installed files # -------------------------------- uninstall: - for hdr in ../include/*.h; do rm -f $(datadir)/include/$$hdr; done - for cfl in *.c; do rm -f $(datadir)/lib/$$cfl; done - for model in $(MODELS); do \ - rm -rf $(datadir)/lib/$$model; \ - done - rm -rf $(datadir)/lib/ds390 - + rm -rf $(sdcc_libdir) # Performing self-test # -------------------- @@ -117,12 +242,15 @@ installcheck: # Creating installation directories # --------------------------------- installdirs: - [ -d $(datadir)/lib ] || mkdir -p $(datadir)/lib + [ -d $(sdcc_libdir) ] || mkdir -p $(sdcc_libdir) for model in $(MODELS); do \ - [ -d $(datadir)/lib/$$model ] || \ - mkdir -p $(datadir)/lib/$$model; \ + [ -d $(sdcc_libdir)/$$model ] || \ + mkdir -p $(sdcc_libdir)/$$model; \ done - [ -d $(datadir)/lib/ds390 ] || mkdir -p $(datadir)/lib/ds390 + [ -d $(sdcc_libdir)/ds390 ] || mkdir -p $(sdcc_libdir)/ds390 + [ -d $(sdcc_libdir)/ds400 ] || mkdir -p $(sdcc_libdir)/ds400 + [ -d $(sdcc_libdir)/hc08 ] || mkdir -p $(sdcc_libdir)/hc08 + mkdir -p $(sdcc_libdir)/src # Creating dependencies # --------------------- @@ -131,7 +259,7 @@ dep: Makefile.dep Makefile.dep: $(SOURCES) $(INCDIR)/*.h rm -f Makefile.dep for i in $(SOURCES); do \ - $(CPP) -M $(CPPFLAGS) $$i >$${i}.dep; \ + $(CPP) -std=c99 -M $(CPPFLAGS) $$i >$${i}.dep; \ cat $${i}.dep >>Makefile.dep; \ rm $${i}.dep; \ done @@ -142,11 +270,10 @@ include clean.mk # My rules # -------- -.SUFFIXES: .rel - -.c.rel: - $(CC) $(CPPFLAGS) $(CFLAGS) -c $< +.SUFFIXES: .rel .o +$(PORTDIR)/%$(OEXT): %.c + $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ # Remaking configuration # ----------------------