[PATCH 1/3] programs: Add rule for cross-building modules.

Octavian Voicu octavian.voicu at gmail.com
Fri Jul 22 09:22:24 CDT 2011


Allows cross-building modules similar to how tests are cross-built.

For each module, a MODULE_cross.exe target is added to cross-build the module.
No other targets are affected.

Cross-building doesn't work if the module uses libwine or the associated
includes. Currently only notepad_cross.exe can be built using this method,
but next patch makes it possible to also build winetest_cross.exe.

[I always found it annoying that make crosstest only builds executables for
individual tests. This patch series makes it also build an executable for
winetest.]

---
 programs/Makeprog.rules.in |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/programs/Makeprog.rules.in b/programs/Makeprog.rules.in
index 9eb832b..84aa542 100644
--- a/programs/Makeprog.rules.in
+++ b/programs/Makeprog.rules.in
@@ -12,8 +12,11 @@
 DLLFLAGS    = @DLLFLAGS@
 DEFS        = -DWINE_STRICT_PROTOTYPES $(EXTRADEFS)
 ALL_LIBS    = $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(EXTRALIBS) -lwine $(LIBPORT) $(LDFLAGS) $(LIBS)
+CROSS_LIBS  = $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
 INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(dlldir) $(DESTDIR)$(fakedlldir) $(DESTDIR)$(mandir)/man$(prog_manext)
 
+CROSSMODULE = $(MODULE:%.exe=%)_cross.exe
+
 @MAKE_RULES@
 
 all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
@@ -21,6 +24,9 @@ all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
 $(MODULE) $(MODULE).so $(MODULE).fake: $(OBJS) Makefile.in
 	$(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
 
+$(CROSSMODULE): $(CROSSOBJS) Makefile.in
+	$(CROSSWINEGCC) $(APPMODE) $(CROSSOBJS) -o $@ $(CROSS_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
+
 # Rules for installation
 
 .PHONY: install_prog install_prog.so install_prog.fake
@@ -40,4 +46,4 @@ uninstall::
 	$(RM) $(DESTDIR)$(bindir)/$(MODULE) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE)
 
 clean::
-	$(RM) $(MODULE)
+	$(RM) $(MODULE) $(CROSSMODULE)
-- 
1.7.4.1




More information about the wine-patches mailing list