diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-02 14:07:02 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-02 14:07:02 +0000 |
commit | ef8fa191d0ba50a664a5a0b27b5a39e7de0b65e6 (patch) | |
tree | 45621b160fca96e66f03ae0ee486ddf30e6c6ec4 /makefiles/Makefile.tools | |
parent | cd1c230244b6beb1e36f6471a89efc50ce5f6308 (diff) | |
download | buildsystem-ef8fa191d0ba50a664a5a0b27b5a39e7de0b65e6.tar.gz buildsystem-ef8fa191d0ba50a664a5a0b27b5a39e7de0b65e6.tar.bz2 |
Add support for mingw-based cross compilation for Windows.
Define pre-processor variables BUILD_{HOST,TARGET}_<platform>
svn path=/trunk/tools/buildsystem/; revision=8262
Diffstat (limited to 'makefiles/Makefile.tools')
-rw-r--r-- | makefiles/Makefile.tools | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools index a758970..7816b00 100644 --- a/makefiles/Makefile.tools +++ b/makefiles/Makefile.tools @@ -92,7 +92,6 @@ ifeq ($(TARGET),riscos) CC__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc) CMHG ?= PATH="$(GCCSDK_INSTALL_CROSSBIN):$(PATH)" $(GCCSDK_INSTALL_CROSSBIN)/cmunge GENHTML ?= echo - HOST_CC ?= cc LCOV ?= echo PKGCONFIG ?= $(GCCSDK_INSTALL_ENV)/ro-pkg-config @@ -139,6 +138,27 @@ ifeq ($(TARGET),beos) endif endif +# Windows +ifeq ($(TARGET),windows) + ifeq ($(HOST),windows) + $(error Compiling on Windows is not supported) + else + # Cross compiling for Windows -- assumes mingw toolchain + GCCSDK_INSTALL_ENV ?= /usr/local/mingw + + CC__ := i586-mingw32msvc-gcc + AR__ := i586-mingw32msvc-ar + + PKGCONFIG ?= $(GCCSDK_INSTALL_ENV)/bin/win-pkg-config + endif + + CFLAGS := $(CFLAGS) -I$(GCCSDK_INSTALL_ENV)/include + LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib + + # Default prefix + PREFIX ?= $(GCCSDK_INSTALL_ENV) +endif + ############################################################################### # Tool defaults ############################################################################### @@ -191,7 +211,7 @@ ifeq ($(origin ARFLAGS),default) ARFLAGS := cru endif -CFLAGS := $(CFLAGS) $(OPTCFLAGS) +CFLAGS := $(CFLAGS) $(OPTCFLAGS) -DBUILD_TARGET_$(TARGET) -DBUILD_HOST_$(HOST) LDFLAGS := $(LDFLAGS) $(OPTLDFLAGS) # Extensions for coverage target |