* device/lib/Makefile.in: allow whitespaces at the end of lines in
[fw/sdcc] / device / lib / Makefile.in
index 900daff6eaa5da8ab7874962f249a11b4fac1b8e..f3b967704cee8332dcfcf42b808d86a3cb9ac19e 100644 (file)
@@ -124,7 +124,7 @@ Z80SOURCES =        \
                _strcspn.c _strlen.c _strncat.c _strncmp.c \
                _strncpy.c _strpbrk.c _strrchr.c _strspn.c \
                _strstr.c _strtok.c \
-               _memcmp.c _memcpy.c _memmove.c _memset.c \
+               _memcmp.c _memcpy.c _memset.c \
                _calloc.c _malloc.c _realloc.c _free.c \
                printf_large.c sprintf.c vprintf.c puts.c gets.c \
                assert.c time.c \
@@ -236,43 +236,43 @@ all: checkconf $(TARGETS)
 objects: build-dir $(OBJECTS) port-specific-objects lib-files clean_intermediate
 
 models:
-       if [ "`grep mcs51 $(top_builddir)/ports.build`" = mcs51 ]; then \
+       if grep '^mcs51\>' $(top_builddir)/ports.build > /dev/null; then \
          for model in $(MODELS); do \
            $(MAKE) MODELFLAGS="--model-$$model" PORT=$$model PORTINCDIR=$(INCDIR)/mcs51 objects; \
          done \
        fi
 
 small-mcs51-stack-auto:
-       if [ "`grep mcs51 $(top_builddir)/ports.build`" = mcs51 ]; then \
+       if grep '^mcs51\>' $(top_builddir)/ports.build > /dev/null; then \
          $(MAKE) MODELFLAGS="--model-small --stack-auto" PORT=small PORTDIR=$(BUILDDIR)/small-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects; \
        fi
 
 model-mcs51-stack-auto:
-       if [ "`grep mcs51 $(top_builddir)/ports.build`" = mcs51 ]; then \
+       if grep '^mcs51\>' $(top_builddir)/ports.build > /dev/null; then \
          for model in $(MODELS); do \
            $(MAKE) MODELFLAGS="--model-$$model --stack-auto" PORT=$$model PORTDIR=$(BUILDDIR)/$$model-stack-auto PORTINCDIR=$(INCDIR)/mcs51 objects; \
          done \
        fi
 
 model-mcs51-xstack-auto:
-       if [ "`grep mcs51 $(top_builddir)/ports.build`" = mcs51 ]; then \
+       if grep '^mcs51\>' $(top_builddir)/ports.build > /dev/null; then \
          for model in $(MODELS); do \
            $(MAKE) MODELFLAGS="--model-$$model --stack-auto --xstack" PORT=$$model PORTDIR=$(BUILDDIR)/$$model-xstack-auto PORTINCDIR=$(INCDIR)/mcs51 objects; \
          done \
        fi
 
 model-ds390:
-       if [ "`grep ds390 $(top_builddir)/ports.build`" = ds390 ]; then \
+       if grep '^ds390\>' $(top_builddir)/ports.build > /dev/null; then \
          $(MAKE) MODELFLAGS="-mds390" PORT=ds390 PORTINCDIR=$(INCDIR)/mcs51 objects; \
        fi
 
 model-ds400:
-       if [ "`grep ds400 $(top_builddir)/ports.build`" = ds400 ]; then \
+       if grep '^ds400\>' $(top_builddir)/ports.build > /dev/null; then \
          $(MAKE) MODELFLAGS="-mds400" PORT=ds400 PORTINCDIR=$(INCDIR)/mcs51 objects; \
        fi
 
 model-xa51:
-       if [ "`grep xa51 $(top_builddir)/ports.build`" = xa51 ]; then \
+       if grep '^xa51\>' $(top_builddir)/ports.build > /dev/null; then \
          $(MAKE) MODELFLAGS="-mxa51" PORT=xa51 objects-xa51; \
        fi
 
@@ -280,12 +280,12 @@ objects-xa51: build-dir $(XA51OBJECTS) port-specific-objects
        cd $(PORTDIR); ls *$(OEXT) > lib$(PORT).lib
 
 model-z80:
-       if [ "`grep z80 $(top_builddir)/ports.build`" = z80 ]; then \
+       if grep '^z80\>' $(top_builddir)/ports.build > /dev/null; then \
          $(MAKE) MODELFLAGS="-mz80" PORT=z80 objects-z80 OEXT=.o; \
        fi
 
 model-gbz80:
-       if [ "`grep z80 $(top_builddir)/ports.build`" = z80 ]; then \
+       if grep '^z80\>' $(top_builddir)/ports.build > /dev/null; then \
          $(MAKE) MODELFLAGS="-mgbz80" PORT=gbz80 objects-z80 OEXT=.o; \
        fi
 
@@ -293,7 +293,7 @@ objects-z80: build-dir $(Z80OBJECTS) port-specific-objects clean_intermediate
        cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
 
 model-hc08:
-       if [ "`grep hc08 $(top_builddir)/ports.build`" = hc08 ]; then \
+       if grep '^hc08\>' $(top_builddir)/ports.build > /dev/null; then \
          $(MAKE) MODELFLAGS="-mhc08" PORT=hc08 objects-hc08; \
        fi
 
@@ -301,19 +301,19 @@ objects-hc08: build-dir $(HC08OBJECTS) port-specific-objects clean_intermediate
        cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
 
 model-pic16:
-       if [ "`grep pic16 $(top_builddir)/ports.build`" = pic16 ]; then \
-         $(MAKE) MODELFLAGS="-mpic16" PORT=pic16 OEXT=.lib objects-pic16; \
+       if grep '^pic16\>' $(top_builddir)/ports.build > /dev/null; then \
+         $(MAKE) PORT=pic16 objects-pic16; \
        fi
 
 objects-pic16: build-dir port-specific-objects-pic16 clean_intermediate-pic16
-       -cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
 
-# yes, we do reuse the *-pic16 rules for pic14
 model-pic14:
-       if [ "`grep pic $(top_builddir)/ports.build | grep -v pic16`" = pic ]; then \
-         $(MAKE) MODELFLAGS="-mpic14" PORT=pic OEXT=.lib objects-pic16; \
+       if grep '^pic\>' $(top_builddir)/ports.build > /dev/null; then \
+         $(MAKE) PORT=pic objects-pic14; \
        fi
 
+objects-pic14: build-dir port-specific-objects-pic14 clean_intermediate-pic14
+
 build-dir: $(PORTDIR)
 
 $(PORTDIR):
@@ -326,6 +326,13 @@ port-specific-objects:
        fi
 
 port-specific-objects-pic16:
+       -if [ -f $(PORT)/Makefile ]; then \
+         $(MAKE) -C $(PORT); \
+         for i in $(PORT)/*/lib*.a; do cp -f $$i $(PORTDIR)/$$(basename $$i .a).lib; done; \
+         cp -f $(PORT)/*/crt0*.o $(PORTDIR); \
+       fi
+
+port-specific-objects-pic14:
        -if [ -f $(PORT)/Makefile ]; then \
          mkdir -p $(PORT)/bin; \
          $(MAKE) -C $(PORT); \
@@ -341,6 +348,9 @@ clean_intermediate:
 clean_intermediate-pic16:
        $(MAKE) -C $(PORT) clean-intermediate
 
+clean_intermediate-pic14:
+       $(MAKE) -C $(PORT) clean-intermediate
+
 # Compiling and installing everything and runing test
 # ---------------------------------------------------
 install: all installdirs
@@ -353,15 +363,17 @@ install: all installdirs
        for src in $(MODELS) ds390 ds400 gbz80 z80 hc08 pic pic16; do \
          find $(sdcc_libdir)/src/$$src -depth \
            \( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \
-           -name '*.lst' -o -name '*.asm' -o -name '.svn' -o -name 'build' -o -name 'bin' -o \
-           -name 'Makefile*' \) \
-           -exec rm -rf {}+ \; ; \
+           -name '*.lst' -o -name '*.asm' -o -name '.svn' -o -name 'autom4te.cache' -o \
+           -name 'build' -o -name 'bin' -o -name 'Makefile*' -o -name 'config*' -o \
+           -name 'depcomp' -o -name 'missing' -o -name 'install-sh' -o \
+           -name 'bootstrap.sh' \) \
+           -exec rm -rf {} + ; \
        done
        find $(sdcc_libdir)/src/mcs51 -depth \
          \( -name '*.rel' -o -name '*.dump*' -o -name '*.sym' -o -name '*.o' -o -name '*.lib' -o \
          -name '*.lst' -o -name '.svn' -o -name 'build' -o -name 'bin' -o \
          -name 'Makefile*' \) \
-         -exec rm -rf {}+ \;
+         -exec rm -rf {} +
 
 # Deleting all the installed files
 # --------------------------------