crossplatform.mk,tarball; improve cross-platform recursive copy (cpr) function. fix...
authorRejean Loyer <redj@ecere.com>
Wed, 2 Mar 2016 19:56:36 +0000 (14:56 -0500)
committerJerome St-Louis <jerome@ecere.com>
Thu, 28 Jul 2016 22:23:22 +0000 (18:23 -0400)
Makefile
crossplatform.mk

index d4f024a..df9ecc3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -115,7 +115,7 @@ export DOCDIR=$(DESTDIR)$(prefix)/share/ecere/doc
 endif
 
 ifndef MANDIR
-export MANDIR=$(DESTDIR)$(prefix)/share/man/
+export MANDIR=$(DESTDIR)$(prefix)/share/man
 endif
 
 ifndef BINDIR
@@ -632,7 +632,9 @@ ifdef CodeGuard
 endif
        $(call cp,$(OBJLIBDIR)libecereVanilla$(A),"$(DESTSLIBDIR)/")
        $(call cp,doc/tao.pdf,"$(DOCDIR)/Ecere Tao of Programming [work in progress].pdf") || echo "The Ecere Tao of Programming is available at http://ecere.com/tao.pdf"
-       $(call cpr,$(DOC)/*.econ,"$(DOCDIR)/")
+       $(call cpr,$(DOC)/ecereCOM,"$(DOCDIR)/ecereCOM")
+       $(call cpr,$(DOC)/ecere,"$(DOCDIR)/ecere")
+       $(call cpr,$(DOC)/EDA,"$(DOCDIR)/EDA")
 endif
 
 ifdef OSX_TARGET
@@ -660,14 +662,16 @@ endif
        install $(OBJLIBDIR)libecereVanilla$(A) $(DESTSLIBDIR)/
        install -d $(DOCDIR)/
        install doc/tao.pdf $(DOCDIR)/"Ecere Tao of Programming [work in progress].pdf" >/dev/null 2>&1 || echo "The Ecere Tao of Programming is available at http://ecere.com/tao.pdf"
-       $(call cpr,$(DOC)/*.econ,"$(DOCDIR)/")
+       $(call cpr,$(DOC)/ecereCOM,"$(DOCDIR)/ecereCOM")
+       $(call cpr,$(DOC)/ecere,"$(DOCDIR)/ecere")
+       $(call cpr,$(DOC)/EDA,"$(DOCDIR)/EDA")
        mkdir -p $(MANDIR)/man1
-       cp -pRf share/man/man1/* $(MANDIR)/man1
+       $(call cpr,share/man/man1,$(MANDIR)/man1)
        mkdir -p $(SAMPLESDIR)
-       cp -pRf samples/* $(SAMPLESDIR)
+       $(call cpr,samples,$(SAMPLESDIR))
        find $(SAMPLESDIR) -type d -exec chmod 777 {} \;
        mkdir -p $(EXTRASDIR)
-       cp -pRf extras/* $(EXTRASDIR)
+       $(call cpr,extras,$(EXTRASDIR))
 endif
 
 ifndef OSX_TARGET
@@ -732,7 +736,9 @@ ifdef BSD_HOST
        install $(INSTALL_FLAGS) -d $(DOCDIR)
 endif
        install $(INSTALL_FLAGS) -m 644 doc/tao.pdf $(DOCDIR)/"Ecere Tao of Programming [work in progress].pdf" >/dev/null 2>&1 || echo "The Ecere Tao of Programming is available at http://ecere.com/tao.pdf"
-       $(call cpr,$(DOC)/*.econ,"$(DOCDIR)/")
+       $(call cpr,$(DOC)/ecereCOM,"$(DOCDIR)/ecereCOM")
+       $(call cpr,$(DOC)/ecere,"$(DOCDIR)/ecere")
+       $(call cpr,$(DOC)/EDA,"$(DOCDIR)/EDA")
        mkdir -p $(MANDIR)/man1
        cp -pRf share/man/man1/* $(MANDIR)/man1
        mkdir -p $(SAMPLESDIR)
index 10cd02e..8e9324b 100644 (file)
@@ -180,16 +180,15 @@ ifndef MSYSCON
    WIN_PS_TOOLS := defined
 endif
 endif
+slash_path = $(subst $(backslash),$(slash),$(1))
 ifdef WIN_PS_TOOLS
    psep := $(backslash)
-   slash_path = $(subst $(backslash),$(slash),$(1))
    sys_path = $(subst $(backslash)$(backslash),$(slash),$(subst $(slash),$(backslash),$(1)))
    quote_path = "$(call sys_path,$(call unescp_all,$(1)))"
    each_path_quote = $(if $(findstring $(esc),$(path)),"$(call unescp_all,$(call shwspace,$(path)))",$(call unescp_all,$(path)))
    sys_path_list = $(foreach path,$(1),$(each_path_quote))
 else
    psep := $(slash)
-   slash_path = $(1)
    sys_path = $(1)
    quote_path = $(1)
 endif
@@ -248,7 +247,7 @@ ifdef WIN_SHELL_COMMANDS
    echo = $(if $(1),echo $(1))
    touch = $(if $(1),@cmd /c "for %%I in ($(call sys_path,$(1))) do @(cd %%~pI && type nul >> %%~nxI && copy /by %%~nxI+,, > nul 2>&1 && cd %%cd%%)")
    cp = $(if $(1),@cmd /c "for %%I in ($(call sys_path,$(1))) do copy /by %%I $(call sys_path,$(2))"$(if $(SILENT_IS_ON), > nul,))
-   cpr = $(if $(1),xcopy /y /s$(if $(SILENT_IS_ON), /q,) $(call sys_path,$(call sys_path_list,$(1))) $(call sys_path,$(2))$(if $(SILENT_IS_ON), > nul,))
+   cpr = $(if $(1),xcopy /y /i /e$(if $(SILENT_IS_ON), /q,) $(call sys_path,$(call sys_path_list,$(1))) $(call sys_path,$(2))$(if $(SILENT_IS_ON), > nul,))
    rm = $(if $(1),-del /f$(if $(SILENT_IS_ON), /q,) $(call sys_path,$(call sys_path_list,$(1)))$(if $(SILENT_IS_ON), > nul,)$(if $(DEBUG_IS_ON),, 2>&1))
    rmr = $(if $(1),-rmdir /s$(if $(SILENT_IS_ON), /q,) $(call sys_path,$(1))$(if $(SILENT_IS_ON), > nul,))
    mkdir = $(if $(1),-mkdir $(call sys_path,$(1))$(if $(SILENT_IS_ON), > nul,)$(if $(DEBUG_IS_ON),, 2>&1))
@@ -258,7 +257,7 @@ else
    echo = $(if $(1),echo "$(1)")
    touch = $(if $(1),touch $(1))
    cp = $(if $(1),cp$(if $(SILENT_IS_ON),, -v) $(1) $(2))
-   cpr = $(if $(1),cp -r$(if $(SILENT_IS_ON),,v) $(1) $(2))
+   cpr = $(if $(1),cp -prf$(if $(SILENT_IS_ON),,v) $(1) $(2))
    rm = $(if $(1),-rm -f$(if $(SILENT_IS_ON),,v) $(1))
    rmr = $(if $(1),-rm -fr$(if $(SILENT_IS_ON),,v) $(1))
    mkdir = $(if $(1),-mkdir -p$(if $(SILENT_IS_ON),,v) $(1))