[Geany-devel] Remove MSYS dependency of Geany on Win~1

Nick Treleaven nick.treleaven at xxxxx
Sun Jul 8 12:04:54 UTC 2012

On 07/07/2012 13:16, Dimitar Zhekov wrote:
> On Wed, 04 Jul 2012 12:59:11 +0100
> Nick Treleaven<nick.treleaven at btinternet.com>  wrote:
>> On 28/06/2012 18:55, Dimitar Zhekov wrote:
>> BTW if you think plugins$(DIRSEP)*.dll looks ugly, we can use:
>> plugins$/*.dll
> Nice. :) Though what I find a bit unpleasant is using the specific
> separator for a single install command, not the particular syntax.

It may turn out to be needed elsewhere.

>> This is what I intend to do.
> Then why not put it for all install commands? We'll not depend on the
> (undocumented AFAIK) behaviour of win~1 mkdir/copy/del to treat slash
> as a directory separator in some cases, but not in others.


BTW I've run into 2 problems with the install target:

1. cp -r and xcopy treat the destination path differently. Currently 
MSYS install is broken and will install data files as 
$DESTDIR/data/data/* - I've replaced xcopy with separate copy targets 
locally. Unfortunately that causes errors with subdirectories so I had 
to ignore them, which I'd prefer not to do. See attached diff.

2. A weird problem. Installing from cmd.exe doesn't overwrite 
geany.glade (and maybe some other files) even though it appears to 
succeed. I only noticed this because I'm missing the View->Editor->Color 
Schemes menu which was added about a month ago (I tend to test in place 
rather than install each time).

-------------- next part --------------
diff --git a/makefile.win32 b/makefile.win32
index 2f39eb4..fce209f 100644
--- a/makefile.win32
+++ b/makefile.win32
@@ -15,8 +15,7 @@
 WINDRES = windres.exe
 CC = gcc
 CXX = g++
-CP = copy /Y
-CP_R = xcopy /S /Y
+CP = copy /y
 RM = del
 MKDIR = mkdir
 # $/ is used as a portable directory separator
@@ -27,7 +26,6 @@ DESTDIR = C:/Program Files/Geany
 ifdef MSYS
 CP = cp
-CP_R = cp -r
 RM = rm -f
 / = /
@@ -62,7 +60,9 @@ clean: deps
 # likely requires admin privileges
 # mkdir output is ignored in case dir exists
+# cp ignored because of subdirectories
 # 'copy' seems to only accept / in the destination
+# xcopy has different destination semantics from cp -r, so we can't use it
 	-$(MKDIR) "$(DESTDIR)"
 	-$(MKDIR) "$(DESTDIR)/bin"
@@ -70,4 +70,10 @@ install:
 	-$(MKDIR) "$(DESTDIR)/lib"
 	$(CP) plugins$/*.dll "$(DESTDIR)/lib"
 	-$(MKDIR) "$(DESTDIR)/data"
-	$(CP_R) data "$(DESTDIR)/data"
+	-$(CP) data$/* "$(DESTDIR)/data"
+	-$(MKDIR) "$(DESTDIR)/data/colorschemes"
+	$(CP) data$/colorschemes$/* "$(DESTDIR)/data/colorschemes"
+	-$(MKDIR) "$(DESTDIR)/data/templates"
+	-$(CP) data$/templates$/* "$(DESTDIR)/data/templates"
+	-$(MKDIR) "$(DESTDIR)/data/templates/files"
+	$(CP) data$/templates$/files$/* "$(DESTDIR)/data/templates/files"

More information about the Devel mailing list