2013-01-19 01:03 keltezéssel, Andrew Dunstan írta:

On 01/18/2013 05:45 PM, Boszormenyi Zoltan wrote:
2013-01-18 23:37 keltezéssel, Andrew Dunstan írta:

On 01/18/2013 05:19 PM, Boszormenyi Zoltan wrote:
2013-01-18 22:52 keltezéssel, Alvaro Herrera írta:
Boszormenyi Zoltan wrote:


I want to test my lock_timeout code under Windows and
I compiled the whole PG universe with the MinGW cross-compiler
for 64-bit under Fedora 18.

The problem contrib directories where Makefile contains
     PROGRAM = ...
The executables binaries are created without the .exe suffix. E.g.:
I think you should be able to solve this by adding the $(X) suffix to
the $(PROGRAM) rule at the bottom of src/makefiles/pgxs.mk.


Do you mean the attached patch? It indeed fixes the build.




  ifdef PROGRAM
  $(PROGRAM): $(OBJS)
-    $(CC) $(CFLAGS) $(OBJS) $(PG_LIBS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
+    $(CC) $(CFLAGS) $(OBJS) $(PG_LIBS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o 
$@$(X)
  endif



Wouldn't it be better to make the rule be for $(PROGRAM)$(X) and adjust the dependency for "all" in the same manner? Otherwise make will rebuild it whether or not it's needed, won't it?

With this in place:

all: $(PROGRAM)$(X) $(DATA_built) $(SCRIPTS_built) $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .control, $(EXTENSION))

[zozo@localhost contrib]$ make
make -C adminpack all
make[1]: Entering directory `/home/zozo/crosscolumn/lock-timeout/12/postgresql.a/contrib/adminpack'
make[1]: *** No rule to make target `.exe', needed by `all'. Stop.
make[1]: Leaving directory `/home/zozo/crosscolumn/lock-timeout/12/postgresql.a/contrib/adminpack'
make: *** [all-adminpack-recurse] Error 2

It's not a good idea it seems.



Because that's only half of what I suggested.

No it's not. I only quoted half of the patch.


cheers

andrew






--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
     http://www.postgresql.at/

--- src/makefiles/pgxs.mk.orig	2013-01-18 23:10:57.808370762 +0100
+++ src/makefiles/pgxs.mk	2013-01-18 23:44:46.180421400 +0100
@@ -100,7 +100,7 @@
 override CPPFLAGS := $(PG_CPPFLAGS) $(CPPFLAGS)
 endif
 
-all: $(PROGRAM) $(DATA_built) $(SCRIPTS_built) $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .control, $(EXTENSION))
+all: $(PROGRAM)$(X) $(DATA_built) $(SCRIPTS_built) $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .control, $(EXTENSION))
 
 ifdef MODULE_big
 # shared library parameters
@@ -295,6 +295,6 @@
 endif
 
 ifdef PROGRAM
-$(PROGRAM): $(OBJS)
+$(PROGRAM)$(X): $(OBJS)
 	$(CC) $(CFLAGS) $(OBJS) $(PG_LIBS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
 endif
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to