From 3383279d4141bea1bd8fca37bd6f6bfd0483487d Mon Sep 17 00:00:00 2001 From: Hannu Koivisto Date: Sun, 28 Aug 2011 23:00:00 +0300 Subject: [PATCH 4/4] NT build: install target fixes Support install directory with spaces in it. Don't fail if target directories exist already. --- leim/makefile.w32-in | 14 +++++++------- lib-src/makefile.w32-in | 18 +++++++++--------- lisp/makefile.w32-in | 6 +++--- nt/gmake.defs | 5 +++++ nt/makefile.w32-in | 40 ++++++++++++++++++++-------------------- src/makefile.w32-in | 4 ++-- 6 files changed, 46 insertions(+), 41 deletions(-) diff --git a/leim/makefile.w32-in b/leim/makefile.w32-in index 736a49a..60b9161 100644 --- a/leim/makefile.w32-in +++ b/leim/makefile.w32-in @@ -199,14 +199,14 @@ leim-list.el: $(SUBDIRS) $(WORLD) $(srcdir)/leim-ext.el $(RUN_EMACS) --eval $(ARGQUOTE)(w32-append-code-lines $(DQUOTE)$@$(DQUOTE) $(DQUOTE)$(srcdir)/leim-ext.el$(DQUOTE))$(ARGQUOTE) install: all - - mkdir "$(INSTALLDIR)" + - mkdir -p "$(INSTALLDIR)" - $(DEL) same-dir.tst - - $(DEL) $(INSTALL_DIR)/same-dir.tst - echo SameDirTest > $(INSTALL_DIR)/same-dir.tst - $(IFNOTSAMEDIR) $(CP) leim-list.el $(INSTALLDIR) $(ENDIF) - $(IFNOTSAMEDIR) $(CP_DIR) quail $(INSTALLDIR) $(ENDIF) - $(IFNOTSAMEDIR) $(CP_DIR) ja-dic $(INSTALLDIR) $(ENDIF) - - $(DEL) $(INSTALL_DIR)/same-dir.tst + - $(DEL) "$(INSTALL_DIR)/same-dir.tst" + echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst" + $(IFNOTSAMEDIR) $(CP) leim-list.el "$(INSTALLDIR)" $(ENDIF) + $(IFNOTSAMEDIR) $(CP_DIR) quail "$(INSTALLDIR)" $(ENDIF) + $(IFNOTSAMEDIR) $(CP_DIR) ja-dic "$(INSTALLDIR)" $(ENDIF) + - $(DEL) "$(INSTALL_DIR)/same-dir.tst" clean mostlyclean: - $(FOREACH) $(TIT) $(FORDO) $(DEL) $(FORVAR) $(ENDFOR) diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in index 28f913a..1cc9634 100644 --- a/lib-src/makefile.w32-in +++ b/lib-src/makefile.w32-in @@ -304,15 +304,15 @@ all: stamp_BLD $(ALL) $(DOC) # INSTALL_FILES = $(ALL) install: $(INSTALL_FILES) - - mkdir "$(INSTALL_DIR)/bin" - $(CP) $(BLD)/etags.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/ebrowse.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin - - mkdir "$(INSTALL_DIR)/etc" + - mkdir -p "$(INSTALL_DIR)/bin" + $(CP) $(BLD)/etags.exe "$(INSTALL_DIR)/bin" + $(CP) $(BLD)/ebrowse.exe "$(INSTALL_DIR)/bin" + $(CP) $(BLD)/ctags.exe "$(INSTALL_DIR)/bin" + $(CP) $(BLD)/hexl.exe "$(INSTALL_DIR)/bin" + $(CP) $(BLD)/movemail.exe "$(INSTALL_DIR)/bin" + $(CP) $(BLD)/emacsclient.exe "$(INSTALL_DIR)/bin" + $(CP) $(BLD)/emacsclientw.exe "$(INSTALL_DIR)/bin" + - mkdir -p "$(INSTALL_DIR)/etc" $(CP) $(DOC) $(INSTALL_DIR)/etc # diff --git a/lisp/makefile.w32-in b/lisp/makefile.w32-in index 4619776..7a292c6 100644 --- a/lisp/makefile.w32-in +++ b/lisp/makefile.w32-in @@ -508,7 +508,7 @@ bootstrap: update-subdirs autoloads mh-autoloads compile finder-data custom-deps # Windows 95 makes this harder than it should be. # install: - - mkdir "$(INSTALL_DIR)/lisp" + - mkdir -p "$(INSTALL_DIR)/lisp" - $(DEL) ../same-dir.tst - $(DEL) "$(INSTALL_DIR)/same-dir.tst" echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst" @@ -534,13 +534,13 @@ install: # since cp does not preserve time stamps install-lisp-SH: cp -f *.el "$(INSTALL_DIR)/lisp" - for dir in $(WINS); do [ -d "$(INSTALL_DIR)/lisp/$$dir" ] || mkdir "$(INSTALL_DIR)/lisp/$$dir"; done + for dir in $(WINS); do [ -d "$(INSTALL_DIR)/lisp/$$dir" ] || mkdir -p "$(INSTALL_DIR)/lisp/$$dir"; done for dir in $(WINS); do cp -f $$dir/*.el "$(INSTALL_DIR)/lisp/$$dir"; done for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; done install-lisp-CMD: cp -f *.el "$(INSTALL_DIR)/lisp" - for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir "$(INSTALL_DIR)/lisp/%%f" + for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir -p "$(INSTALL_DIR)/lisp/%%f" for %%f in ($(WINS)) do cp -f %%f/*.el "$(INSTALL_DIR)/lisp/%%f" for %%f in (. $(WINS)) do cp -f %%f/*.elc "$(INSTALL_DIR)/lisp/%%f" diff --git a/nt/gmake.defs b/nt/gmake.defs index 2ceb216..74d1664 100644 --- a/nt/gmake.defs +++ b/nt/gmake.defs @@ -119,6 +119,11 @@ ifndef INSTALL_DIR INSTALL_DIR = $(CURDIR)/.. endif +INSTALL_DIR_MIXED := $(INSTALL_DIR) +ifeq "$(shell cygpath $(INSTALL_DIR))" "$(INSTALL_DIR)" +INSTALL_DIR_MIXED := $(shell cygpath -m "$(INSTALL_DIR)") +endif + export EMACSLOADPATH # Determine the architecture we're running on. diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in index 05ce4eb..c7cdf4a 100644 --- a/nt/makefile.w32-in +++ b/nt/makefile.w32-in @@ -197,10 +197,10 @@ bootstrap-clean-gmake: $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean $(INSTALL_DIR): - - mkdir "$(INSTALL_DIR)" + - mkdir -p "$(INSTALL_DIR)" $(INSTALL_DIR)/bin: $(INSTALL_DIR) - - mkdir "$(INSTALL_DIR)/bin" + - mkdir -p "$(INSTALL_DIR)/bin" # # Build and install emacs in INSTALL_DIR @@ -210,28 +210,28 @@ $(INSTALL_DIR)/bin: $(INSTALL_DIR) install: install-bin install-shortcuts install-bin: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE) - - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin - - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin - - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin - - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin - - $(CP) README.W32 $(INSTALL_DIR) + - $(CP) $(BLD)/addpm.exe "$(INSTALL_DIR_MIXED)/bin" + - $(CP) $(BLD)/ddeclient.exe "$(INSTALL_DIR_MIXED)/bin" + - $(CP) $(BLD)/cmdproxy.exe "$(INSTALL_DIR_MIXED)/bin" + - $(CP) $(BLD)/runemacs.exe "$(INSTALL_DIR_MIXED)/bin" + - $(CP) README.W32 "$(INSTALL_DIR)" - $(DEL) ../same-dir.tst - $(DEL) $(INSTALL_DIR)/same-dir.tst echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst" - - mkdir "$(INSTALL_DIR)/etc" - - mkdir "$(INSTALL_DIR)/info" - - mkdir "$(INSTALL_DIR)/lock" - - mkdir "$(INSTALL_DIR)/data" - - mkdir "$(INSTALL_DIR)/site-lisp" - - mkdir "$(INSTALL_DIR)/etc/icons" - $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp $(ENDIF) - $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF) - - $(CP_DIR) icons $(INSTALL_DIR)/etc - $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF) - $(IFNOTSAMEDIR) $(CP) ../COPYING $(INSTALL_DIR) $(ENDIF) - - $(CP) ../COPYING $(INSTALL_DIR)/bin + - mkdir -p "$(INSTALL_DIR)/etc" + - mkdir -p "$(INSTALL_DIR)/info" + - mkdir -p "$(INSTALL_DIR)/lock" + - mkdir -p "$(INSTALL_DIR)/data" + - mkdir -p "$(INSTALL_DIR)/site-lisp" + - mkdir -p "$(INSTALL_DIR)/etc/icons" + $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el "$(INSTALL_DIR)/site-lisp" $(ENDIF) + $(IFNOTSAMEDIR) $(CP_DIR) ../etc "$(INSTALL_DIR)" $(ENDIF) + - $(CP_DIR) icons "$(INSTALL_DIR)/etc" + $(IFNOTSAMEDIR) $(CP_DIR) ../info "$(INSTALL_DIR)" $(ENDIF) + $(IFNOTSAMEDIR) $(CP) ../COPYING "$(INSTALL_DIR)" $(ENDIF) + - $(CP) ../COPYING "$(INSTALL_DIR)/bin" - $(DEL) ../same-dir.tst - - $(DEL) $(INSTALL_DIR)/same-dir.tst + - $(DEL) "$(INSTALL_DIR)/same-dir.tst" install-other-dirs-nmake: cd ..\lib-src diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 53cb5f8..c46d57c 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -307,8 +307,8 @@ $(TLASTLIB): $(BLD)/lastfile.$(O) # Assuming INSTALL_DIR is defined, build and install emacs in it. # install: $(ALL) - - mkdir "$(INSTALL_DIR)/bin" - $(CP) $(EMACS) $(INSTALL_DIR)/bin + - mkdir -p "$(INSTALL_DIR)/bin" + $(CP) $(EMACS) "$(INSTALL_DIR)/bin" # # Maintenance -- 1.7.7.rc0