[GRASS-SVN] r41457 - in grass/trunk: . gem include/Make lib/init
lib/vector/diglib mswindows tools
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Mar 16 09:38:24 EDT 2010
Author: glynn
Date: 2010-03-16 09:38:23 -0400 (Tue, 16 Mar 2010)
New Revision: 41457
Added:
grass/trunk/mswindows/generic.manifest.rc
Modified:
grass/trunk/Makefile
grass/trunk/gem/Makefile
grass/trunk/include/Make/Compile.make
grass/trunk/include/Make/Etc.make
grass/trunk/include/Make/Grass.make
grass/trunk/lib/init/Makefile
grass/trunk/lib/vector/diglib/Makefile
grass/trunk/tools/Makefile
Log:
MinGW: embed manifests in EXEs
Modified: grass/trunk/Makefile
===================================================================
--- grass/trunk/Makefile 2010-03-16 06:03:34 UTC (rev 41456)
+++ grass/trunk/Makefile 2010-03-16 13:38:23 UTC (rev 41457)
@@ -20,6 +20,7 @@
MODULE_TOPDIR = .
include $(MODULE_TOPDIR)/include/Make/Dir.make
+include $(MODULE_TOPDIR)/include/Make/Compile.make
DATE := $(shell date '+%d_%m_%Y')
@@ -79,11 +80,10 @@
@if [ `wc -l < "$(ERRORLOG)"` -gt 8 ] ; then false ; else true ; fi
manifests:
-ifneq ($(strip $(MINGW)),)
+ifeq ($(MANIFEST),external)
find $(ARCH_DISTDIR) -type f -name '*.exe' | \
while read file ; do \
- cmd=`basename "$$file" .exe` ; \
- sed "s/@CMD@/$$cmd/" mswindows/generic.manifest > "$$file".manifest ; \
+ $(MAKE) "$$file".manifest ; \
done
endif
Modified: grass/trunk/gem/Makefile
===================================================================
--- grass/trunk/gem/Makefile 2010-03-16 06:03:34 UTC (rev 41456)
+++ grass/trunk/gem/Makefile 2010-03-16 13:38:23 UTC (rev 41457)
@@ -8,7 +8,7 @@
default: $(ARCH_BINDIR)/$(GEM)$(EXE)
$(ARCH_BINDIR)/$(GEM)$(EXE): $(ARCH_OBJS)
- $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $(filter %.o,$^) $(FMODE_OBJ) $(LIBES) $(EXTRA_LIBS)
+ $(call linker_base,$(LINK),$(LDFLAGS) $(EXTRA_LDFLAGS),$(FMODE_OBJ) $(LIBES) $(EXTRA_LIBS))
install: $(UNIX_BIN)/$(GEM)$(EXE)
Modified: grass/trunk/include/Make/Compile.make
===================================================================
--- grass/trunk/include/Make/Compile.make 2010-03-16 06:03:34 UTC (rev 41456)
+++ grass/trunk/include/Make/Compile.make 2010-03-16 13:38:23 UTC (rev 41457)
@@ -4,7 +4,18 @@
LINK = $(CC)
-linker_x = $(1) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $(filter %.o,$^) $(FMODE_OBJ) $(LIBES) $(EXTRA_LIBS) $(MATHLIB) $(XDRLIB)
+ifeq ($(MANIFEST),external)
+PRELINK=$(MAKE) $@.manifest
+else
+ifeq ($(MANIFEST),internal)
+PRELINK=$(MAKE) $(MANIFEST_OBJ)
+else
+PRELINK=:
+endif
+endif
+
+linker_base = $(PRELINK) && $(1) $(2) -o $@ $(filter %.o,$^) $(filter %.res,$^) $(3)
+linker_x = $(call linker_base,$(1),$(LDFLAGS) $(EXTRA_LDFLAGS),$(FMODE_OBJ) $(MANIFEST_OBJ) $(LIBES) $(EXTRA_LIBS) $(MATHLIB) $(XDRLIB))
linker_c = $(call linker_x,$(CC))
linker_cxx = $(call linker_x,$(CXX))
linker = $(call linker_x,$(LINK))
@@ -36,4 +47,13 @@
depend: $(C_SOURCES) $(CC_SOURCES) $(CPP_SOURCES)
-$(CC) -E -MM -MG $(ALL_CFLAGS) $^ | sed 's!^[0-9a-zA-Z_.-]*\.o:!$$(OBJDIR)/&!' > $(DEPFILE)
+%.manifest.res: %.manifest.rc %.exe.manifest
+ $(WINDRES) --input=$< --input-format=rc --output=$@ --output-format=coff
+
+%.manifest.rc:
+ sed 's/@CMD@/$(notdir $*)/' $(MODULE_TOPDIR)/mswindows/generic.manifest.rc > $@
+
+%.exe.manifest:
+ sed 's/@CMD@/$(notdir $*)/' $(MODULE_TOPDIR)/mswindows/generic.manifest > $@
+
-include $(DEPFILE)
Modified: grass/trunk/include/Make/Etc.make
===================================================================
--- grass/trunk/include/Make/Etc.make 2010-03-16 06:03:34 UTC (rev 41456)
+++ grass/trunk/include/Make/Etc.make 2010-03-16 13:38:23 UTC (rev 41457)
@@ -12,7 +12,7 @@
etc: $(ETC)/$(PGM)$(EXE) html
-$(ETC)/$(PGM)$(EXE): $(ARCH_OBJS) $(DEPENDENCIES)
+$(ETC)/$(PGM)$(EXE): $(ARCH_OBJS) $(DEPENDENCIES)
$(call linker)
.PHONY: etc
Modified: grass/trunk/include/Make/Grass.make
===================================================================
--- grass/trunk/include/Make/Grass.make 2010-03-16 06:03:34 UTC (rev 41456)
+++ grass/trunk/include/Make/Grass.make 2010-03-16 13:38:23 UTC (rev 41457)
@@ -83,7 +83,10 @@
# Object with _fmode which must be linked to each executable on Windows
ifdef MINGW
+WINDRES = windres
FMODE_OBJ = $(BASE_LIBDIR)/fmode.o
+MANIFEST_OBJ = $(OBJDIR)/$(basename $(notdir $@)).manifest.res
+MANIFEST = internal
endif
# lexical analyzer and default options
Modified: grass/trunk/lib/init/Makefile
===================================================================
--- grass/trunk/lib/init/Makefile 2010-03-16 06:03:34 UTC (rev 41456)
+++ grass/trunk/lib/init/Makefile 2010-03-16 13:38:23 UTC (rev 41457)
@@ -126,13 +126,13 @@
$(INSTALL_DATA) $< $@
$(ETC)/echo$(EXE) $(ETC)/run$(EXE): $(ETC)/%$(EXE): $(OBJDIR)/%.o
- $(CC) $(LDFLAGS) $< -o $@
+ $(call linker_base,$(LINK),$(LDFLAGS),)
$(ETC)/clean_temp$(EXE) $(ETC)/lock$(EXE): $(ETC)/%$(EXE): $(OBJDIR)/%.o
$(call linker)
$(ETC)/winlocale$(EXE): $(OBJDIR)/winlocale.o
- $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $^ -lkernel32
+ $(call linker_base,$(LINK),$(LDFLAGS) $(EXTRA_LDFLAGS), -lkernel32)
$(ETC)/VERSIONNUMBER:
rm -f $@
Modified: grass/trunk/lib/vector/diglib/Makefile
===================================================================
--- grass/trunk/lib/vector/diglib/Makefile 2010-03-16 06:03:34 UTC (rev 41456)
+++ grass/trunk/lib/vector/diglib/Makefile 2010-03-16 13:38:23 UTC (rev 41457)
@@ -19,8 +19,6 @@
TESTFILE = test32.ok
endif
-TEST = $(OBJDIR)/test$(EXE)
-
default: lib
@echo "==============TEST============="
$(MAKE) test
@@ -28,11 +26,11 @@
test: $(OBJDIR)/test.tmp $(TESTFILE)
diff $(OBJDIR)/test.tmp $(TESTFILE)
-$(OBJDIR)/test.tmp: $(TEST)
+$(OBJDIR)/test.tmp: $(OBJDIR)/test$(EXE)
cd $(OBJDIR) && $(call run_grass,./test)
# Test portable read/write functions
-$(TEST): $(OBJDIR)/test.o $(DIG2DEP)
+$(OBJDIR)/test$(EXE): $(OBJDIR)/test.o $(DIG2DEP)
$(call linker)
-$(TEST): LIBES = $(DIG2LIB)
+$(OBJDIR)/test$(EXE): LIBES = $(DIG2LIB)
Added: grass/trunk/mswindows/generic.manifest.rc
===================================================================
--- grass/trunk/mswindows/generic.manifest.rc (rev 0)
+++ grass/trunk/mswindows/generic.manifest.rc 2010-03-16 13:38:23 UTC (rev 41457)
@@ -0,0 +1,2 @@
+#include "winuser.h"
+1 RT_MANIFEST "@CMD at .exe.manifest"
Modified: grass/trunk/tools/Makefile
===================================================================
--- grass/trunk/tools/Makefile 2010-03-16 06:03:34 UTC (rev 41456)
+++ grass/trunk/tools/Makefile 2010-03-16 13:38:23 UTC (rev 41457)
@@ -11,4 +11,4 @@
$(INSTALL) $< $@
$(TOOLSDIR)/g.echo$(EXE): $(OBJDIR)/g.echo.o
- $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $^
+ $(call linker_base,$(LINK),$(LDFLAGS) $(EXTRA_LDFLAGS),)
More information about the grass-commit
mailing list