cp on sparc-solaris (SunOS) does not support -u option
[fw/sdcc] / device / lib / Makefile.in
index 877c68b26c0e3902e479960bff0baa2c30882a74..81449e3ba65161287d9a3f083197ab725b30b7c6 100644 (file)
@@ -12,6 +12,12 @@ CPP          = @CPP@
 INSTALL                = @INSTALL@
 CP              = @CP@
 
+ifeq ($(shell uname -s),SunOS)
+CP_U   = $(CP)
+else
+CP_U   = $(CP) -p
+endif
+
 PRJDIR         = ../..
 INCDIR         = $(PRJDIR)/device/include
 ifndef PORTINCDIR
@@ -237,7 +243,7 @@ objects-hc08: build-dir $(HC08OBJECTS) port-specific-objects clean_intermediate
 model-pic16:
        if [ "`grep pic16 ../../ports.build`" = pic16 ]; then \
          $(MAKE) MODELFLAGS="-mpic16" PORT=pic16 OEXT=.lib objects-pic16; \
-         fi
+       fi
 
 objects-pic16: build-dir port-specific-objects-pic16 clean_intermediate-pic16
        cd $(PORTDIR); ls *$(OEXT) > $(PORT).lib
@@ -255,7 +261,8 @@ port-specific-objects:
        fi
 
 port-specific-objects-pic16:
-       if [ -d $(PORT) ]; then \
+       -if [ -d $(PORT) ]; then \
+         mkdir -p $(PORT)/bin; \
          $(MAKE) -C $(PORT); \
          cp -f $(PORT)/bin/*.* $(PORTDIR); \
        fi
@@ -272,8 +279,8 @@ clean_intermediate-pic16:
 # Compiling and installing everything and runing test
 # ---------------------------------------------------
 install: all installdirs
-       cp -r -u $(BUILDDIR)/* $(sdcc_libdir)
-       cp -r -u ds390 ds400 gbz80 z80 hc08 *.c $(sdcc_libdir)/src
+       $(CP_U) -r $(BUILDDIR)/* $(sdcc_libdir)
+       $(CP_U) -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