annotate Makefile.in @ 3087:3663f6300abf

[MSVC] enable FFTW compilation - fix cc-msvc when all input files are pushed into @-files by libtool - make libtool think clgfortran is not the GNU Fortran compiler - don't bother compiling long-double version of FFTW, MSVC does not support long double type, it's typedef'ed to double
author Michael Goffioul <michael.goffioul@gmail.com>
date Mon, 24 Jun 2013 22:10:13 -0400
parents c0222ce8760d
children 034f830a5823
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2333
f653602a0500 Rebrand to new project name MXE
Volker Grabsch <vog@notjusthosting.com>
parents: 2330
diff changeset
1 # This file is part of MXE.
2353
99516e73b368 Move doc/index.html -> index.html
Volker Grabsch <vog@notjusthosting.com>
parents: 2350
diff changeset
2 # See index.html for further information.
123
9fedbab70063 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 122
diff changeset
3
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
4 PWD := $(shell pwd)
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
5
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
6 ## Configuration variables.
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
7
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
8 # Set the following configuration variables with a configure script?
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
9
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
10 # Current valid values are mingw (cross) and gnu-linux (native).
3043
cbfe5d38ff2c use configure script to generate Makefile
John W. Eaton <jwe@octave.org>
parents: 3042
diff changeset
11 MXE_SYSTEM := @MXE_SYSTEM@
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
12
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
13 # Set to "no" if doing a cross compile build.
3043
cbfe5d38ff2c use configure script to generate Makefile
John W. Eaton <jwe@octave.org>
parents: 3042
diff changeset
14 MXE_NATIVE_BUILD := @MXE_NATIVE_BUILD@
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
15
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
16 # Set to "yes" to use the versions of GCC and binutils already
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
17 # installed on your system. NOTE: building a copy of GCC for a
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
18 # native build does not appear to work correctly yet, so for now you
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
19 # must set USE_SYSTEM_GCC to yes if MXE_NATIVE_BUILD is set to yes.
3043
cbfe5d38ff2c use configure script to generate Makefile
John W. Eaton <jwe@octave.org>
parents: 3042
diff changeset
20 USE_SYSTEM_GCC := @USE_SYSTEM_GCC@
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
21
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
22 # Should match what config.guess prints for your system.
3005
c154d525c70e use config.guess to set TARGET for native builds
John W. Eaton <jwe@octave.org>
parents: 3003
diff changeset
23 # If cross compiling, you must set it manually.
c154d525c70e use config.guess to set TARGET for native builds
John W. Eaton <jwe@octave.org>
parents: 3003
diff changeset
24 ifeq ($(MXE_NATIVE_BUILD),yes)
3009
23989e9403a3 use $(shell ...) to execute config.guess
John W. Eaton <jwe@octave.org>
parents: 3006
diff changeset
25 TARGET := $(shell tools/config.guess)
3005
c154d525c70e use config.guess to set TARGET for native builds
John W. Eaton <jwe@octave.org>
parents: 3003
diff changeset
26 else
c154d525c70e use config.guess to set TARGET for native builds
John W. Eaton <jwe@octave.org>
parents: 3003
diff changeset
27 TARGET := i686-pc-mingw32
c154d525c70e use config.guess to set TARGET for native builds
John W. Eaton <jwe@octave.org>
parents: 3003
diff changeset
28 endif
3013
bcc26ffe9a0f use variable for --host and --build configure arguments
John W. Eaton <jwe@octave.org>
parents: 3012
diff changeset
29 BUILD_SYSTEM := $(shell tools/config.guess)
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
30
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
31 # Enable shared or static libs, or perhaps both. Probably it doesn't
2855
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
32 # make sense to disable both...
3043
cbfe5d38ff2c use configure script to generate Makefile
John W. Eaton <jwe@octave.org>
parents: 3042
diff changeset
33 BUILD_SHARED := @BUILD_SHARED@
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
34 BUILD_STATIC := @BUILD_STATIC@
3043
cbfe5d38ff2c use configure script to generate Makefile
John W. Eaton <jwe@octave.org>
parents: 3042
diff changeset
35
3049
b374f89bc920 fix USE_PIC_FLAG substitution in Makefile.in
John W. Eaton <jwe@octave.org>
parents: 3048
diff changeset
36 USE_PIC_FLAG := @USE_PIC_FLAG@
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
37
3043
cbfe5d38ff2c use configure script to generate Makefile
John W. Eaton <jwe@octave.org>
parents: 3042
diff changeset
38 # Attempt to build Octave and dependencies with 64-bit indexing
cbfe5d38ff2c use configure script to generate Makefile
John W. Eaton <jwe@octave.org>
parents: 3042
diff changeset
39 # enabled (experimental; requires 64-bit system and compiler).
cbfe5d38ff2c use configure script to generate Makefile
John W. Eaton <jwe@octave.org>
parents: 3042
diff changeset
40 ENABLE_64 := @ENABLE_64@
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
41
3043
cbfe5d38ff2c use configure script to generate Makefile
John W. Eaton <jwe@octave.org>
parents: 3042
diff changeset
42 # Attempt to build LLVM and enable Octave's experimental JIT compiler.
cbfe5d38ff2c use configure script to generate Makefile
John W. Eaton <jwe@octave.org>
parents: 3042
diff changeset
43 ENABLE_JIT := @ENABLE_JIT@
3015
ec6f91539788 initial support for --enable-64
John W. Eaton <jwe@octave.org>
parents: 3014
diff changeset
44
3068
fb0836e4a677 Add --enable-openblas option to configure
John Donoghue <john.donoghue@ieee.org>
parents: 3063
diff changeset
45 # Use openblas for octave
fb0836e4a677 Add --enable-openblas option to configure
John Donoghue <john.donoghue@ieee.org>
parents: 3063
diff changeset
46 ENABLE_OPENBLAS := @ENABLE_OPENBLAS@
fb0836e4a677 Add --enable-openblas option to configure
John Donoghue <john.donoghue@ieee.org>
parents: 3063
diff changeset
47
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
48 ## end of configuration variables.
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
49
3013
bcc26ffe9a0f use variable for --host and --build configure arguments
John W. Eaton <jwe@octave.org>
parents: 3012
diff changeset
50 ifneq ($(MXE_NATIVE_BUILD),yes)
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
51 ifeq ($(MXE_SYSTEM),msvc)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
52 $(error Cross-compiling to MSVC is not supported)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
53 endif
3013
bcc26ffe9a0f use variable for --host and --build configure arguments
John W. Eaton <jwe@octave.org>
parents: 3012
diff changeset
54 HOST_AND_BUILD_CONFIGURE_OPTIONS := \
bcc26ffe9a0f use variable for --host and --build configure arguments
John W. Eaton <jwe@octave.org>
parents: 3012
diff changeset
55 --host='$(TARGET)' --build='$(BUILD_SYSTEM)'
bcc26ffe9a0f use variable for --host and --build configure arguments
John W. Eaton <jwe@octave.org>
parents: 3012
diff changeset
56 endif
bcc26ffe9a0f use variable for --host and --build configure arguments
John W. Eaton <jwe@octave.org>
parents: 3012
diff changeset
57
3018
051574ceb3fc Update Makefile for native mingw compiling so pkg-config knows where its pc files should be.
John Donoghue <john.donoghue@ieee.org>
parents: 3015
diff changeset
58 # are we doing a native mingw build ?
051574ceb3fc Update Makefile for native mingw compiling so pkg-config knows where its pc files should be.
John Donoghue <john.donoghue@ieee.org>
parents: 3015
diff changeset
59 ifeq ($(MXE_NATIVE_BUILD),yes)
051574ceb3fc Update Makefile for native mingw compiling so pkg-config knows where its pc files should be.
John Donoghue <john.donoghue@ieee.org>
parents: 3015
diff changeset
60 ifeq ($(MXE_SYSTEM),mingw)
051574ceb3fc Update Makefile for native mingw compiling so pkg-config knows where its pc files should be.
John Donoghue <john.donoghue@ieee.org>
parents: 3015
diff changeset
61 MXE_NATIVE_MINGW_BUILD := yes
051574ceb3fc Update Makefile for native mingw compiling so pkg-config knows where its pc files should be.
John Donoghue <john.donoghue@ieee.org>
parents: 3015
diff changeset
62 endif
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
63 ifeq ($(MXE_SYSTEM),msvc)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
64 MXE_NATIVE_MINGW_BUILD := yes
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
65 endif
3018
051574ceb3fc Update Makefile for native mingw compiling so pkg-config knows where its pc files should be.
John Donoghue <john.donoghue@ieee.org>
parents: 3015
diff changeset
66 endif
051574ceb3fc Update Makefile for native mingw compiling so pkg-config knows where its pc files should be.
John Donoghue <john.donoghue@ieee.org>
parents: 3015
diff changeset
67
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
68 # These can't be chosen arbitrarily. The way things are configured now,
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
69 # GCC expects to find cross-compiler include files in $(PREFIX)/$(TARGET).
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
70 # and it's not clear to me how to change that.
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
71 BUILD_TOOLS_PREFIX := $(PWD)/usr
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
72 HOST_PREFIX := $(PWD)/usr/$(TARGET)
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
73
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
74 # At least one package uses --with instead of --enable.
2855
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
75 ifeq ($(BUILD_SHARED),yes)
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
76 ifeq ($(BUILD_STATIC),yes)
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
77 ENABLE_SHARED_OR_STATIC := --enable-shared --enable-static
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
78 WITH_SHARED_OR_STATIC := --with-shared --with-static
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
79 else
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
80 ENABLE_SHARED_OR_STATIC := --enable-shared --disable-static
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
81 WITH_SHARED_OR_STATIC := --with-shared --without-static
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
82 endif
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
83 else
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
84 ENABLE_SHARED_OR_STATIC := --disable-shared --enable-static
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
85 WITH_SHARED_OR_STATIC := --without-shared --with-static
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
86 endif
47558e958113 Allow static/shared libraries to be configured in top-level Makefile.
John W. Eaton <jwe@octave.org>
parents: 2778
diff changeset
87
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
88 ifeq ($(USE_PIC_FLAG),yes)
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
89 MXE_CC_PICFLAG := -fPIC
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
90 MXE_CXX_PICFLAG := -fPIC
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
91 MXE_F77_PICFLAG := -fPIC
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
92 endif
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
93
206
c82301af7b7f disable parallel builds by default and document in the README how to enable parallelization
Volker Grabsch <vog@notjusthosting.com>
parents: 197
diff changeset
94 JOBS := 1
2696
fe58e4975380 replace sourceforge mirror
Mark Brand <mabrand@mabrand.nl>
parents: 2475
diff changeset
95 SOURCEFORGE_MIRROR := freefr.dl.sourceforge.net
2727
e474975121d6 add tertiary fallback for unavailable package files
Tony Theodore <tonyt@logyst.com>
parents: 2697
diff changeset
96 PKG_MIRROR := s3.amazonaws.com/mxe-pkg
2730
38054572b13f add package cdn fallback
Tony Theodore <tonyt@logyst.com>
parents: 2729
diff changeset
97 PKG_CDN := d1yihgixbnrglp.cloudfront.net
114
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
98
3044
eb1a22446662 substitute SHELL
John W. Eaton <jwe@octave.org>
parents: 3043
diff changeset
99 SHELL := @SHELL@
2380
f89dd4c9e49f Portability fix: Define $(PWD) before $(SHELL)
Volker Grabsch <vog@notjusthosting.com>
parents: 2379
diff changeset
100
2369
4f5f4af84b12 Improve order of entries in main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2368
diff changeset
101 INSTALL := $(shell ginstall --help >/dev/null 2>&1 && echo g)install
4f5f4af84b12 Improve order of entries in main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2368
diff changeset
102 PATCH := $(shell gpatch --help >/dev/null 2>&1 && echo g)patch
4f5f4af84b12 Improve order of entries in main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2368
diff changeset
103 SED := $(shell gsed --help >/dev/null 2>&1 && echo g)sed
2524
422cb29ca669 Makefile: add wget portability variable - $(WGET)
Tony Theodore <tonyt@logyst.com>
parents: 2500
diff changeset
104 WGET := wget --no-check-certificate \
422cb29ca669 Makefile: add wget portability variable - $(WGET)
Tony Theodore <tonyt@logyst.com>
parents: 2500
diff changeset
105 --user-agent=$(shell wget --version | \
422cb29ca669 Makefile: add wget portability variable - $(WGET)
Tony Theodore <tonyt@logyst.com>
parents: 2500
diff changeset
106 $(SED) -n 's,GNU \(Wget\) \([0-9.]*\).*,\1/\2,p')
2369
4f5f4af84b12 Improve order of entries in main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2368
diff changeset
107
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
108 REQUIREMENTS := bash bzip2 $(MAKE) openssl $(PATCH) $(PERL) \
2991
07a5901747ae drop intltoolize as dependency (along with dropping scons and yasm in previous changeset)
John W. Eaton <jwe@octave.org>
parents: 2990
diff changeset
109 $(SED) unzip wget xz
2369
4f5f4af84b12 Improve order of entries in main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2368
diff changeset
110
3046
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
111 ifeq ($(MXE_NATIVE_MINGW_BUILD),yes)
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
112 REQUIREMENTS += bsdcpio
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
113 endif
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
114
2971
7145a94e4f4e build autoconf, automake, libtool, and cmake instead of expecting them to exist
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
115 LIBTOOL := libtool
7145a94e4f4e build autoconf, automake, libtool, and cmake instead of expecting them to exist
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
116 LIBTOOLIZE := libtoolize
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
117
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
118 ## Build tools are tools that we need to build everything else.
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
119 ## They run on the build system. Some, like gcc and binutils may
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
120 ## generate output that runs on the host system (TARGET in MXE terms).
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
121 ALL_BUILD_TOOLS := $(patsubst src/%.mk, %, $(wildcard src/build-*.mk))
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
122 BUILD_COMPILER_TOOLS := build-gcc build-binutils
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
123 BUILD_TOOLS := $(ALL_BUILD_TOOLS)
3029
2849bea3711f disable building flex for native mingw
John W. Eaton <jwe@octave.org>
parents: 3018
diff changeset
124 # Building flex for native mingw fails, so disable it.
2849bea3711f disable building flex for native mingw
John W. Eaton <jwe@octave.org>
parents: 3018
diff changeset
125 ifeq ($(MXE_NATIVE_MINGW_BUILD),yes)
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
126 REQUIREMENTS += flex
3029
2849bea3711f disable building flex for native mingw
John W. Eaton <jwe@octave.org>
parents: 3018
diff changeset
127 BUILD_TOOLS := $(filter-out build-flex, $(BUILD_TOOLS))
2849bea3711f disable building flex for native mingw
John W. Eaton <jwe@octave.org>
parents: 3018
diff changeset
128 endif
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
129 ifeq ($(USE_SYSTEM_GCC),yes)
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
130 BUILD_TOOLS := $(filter-out $(BUILD_COMPILER_TOOLS), $(BUILD_TOOLS))
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
131 endif
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
132 ifneq ($(MXE_SYSTEM),msvc)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
133 BUILD_TOOLS := $(filter-out build-msvctools, $(BUILD_TOOLS))
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
134 endif
2971
7145a94e4f4e build autoconf, automake, libtool, and cmake instead of expecting them to exist
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
135
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
136 STAMP_DIR := $(PWD)/installed-packages
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
137 MSYS_INFO_DIR := $(PWD)/msys-info
704
93f1be1d2089 use glibtoolize instead of libtoolize where appropriate (by Tony Theodore)
Volker Grabsch <vog@notjusthosting.com>
parents: 699
diff changeset
138 LOG_DIR := $(PWD)/log
93f1be1d2089 use glibtoolize instead of libtoolize where appropriate (by Tony Theodore)
Volker Grabsch <vog@notjusthosting.com>
parents: 699
diff changeset
139 TIMESTAMP := $(shell date +%Y%m%d_%H%M%S)
93f1be1d2089 use glibtoolize instead of libtoolize where appropriate (by Tony Theodore)
Volker Grabsch <vog@notjusthosting.com>
parents: 699
diff changeset
140 PKG_DIR := $(PWD)/pkg
93f1be1d2089 use glibtoolize instead of libtoolize where appropriate (by Tony Theodore)
Volker Grabsch <vog@notjusthosting.com>
parents: 699
diff changeset
141 TMP_DIR = $(PWD)/tmp-$(1)
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
142 TOP_DIR := $(PWD)
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
143 MAKEFILE := $(TOP_DIR)/Makefile
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
144 PKGS := $(filter-out $(ALL_BUILD_TOOLS), $(shell $(SED) -n 's/^.* id="\([^"]*\)-package">.*$$/\1/p' '$(TOP_DIR)/index.html'))
3042
ace9dd211c99 for native mingw builds, add $(HOST_PREFIX)/bin to PATH
John W. Eaton <jwe@octave.org>
parents: 3040
diff changeset
145
ace9dd211c99 for native mingw builds, add $(HOST_PREFIX)/bin to PATH
John W. Eaton <jwe@octave.org>
parents: 3040
diff changeset
146 ifeq ($(MXE_NATIVE_MINGW_BUILD),yes)
ace9dd211c99 for native mingw builds, add $(HOST_PREFIX)/bin to PATH
John W. Eaton <jwe@octave.org>
parents: 3040
diff changeset
147 PATH := $(HOST_PREFIX)/bin:$(PATH)
ace9dd211c99 for native mingw builds, add $(HOST_PREFIX)/bin to PATH
John W. Eaton <jwe@octave.org>
parents: 3040
diff changeset
148 endif
ace9dd211c99 for native mingw builds, add $(HOST_PREFIX)/bin to PATH
John W. Eaton <jwe@octave.org>
parents: 3040
diff changeset
149 PATH := $(BUILD_TOOLS_PREFIX)/bin:$(PATH)
1398
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
150
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
151 CONFIGURE_CPPFLAGS := CPPFLAGS='-I$(HOST_PREFIX)/include'
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
152 CONFIGURE_LDFLAGS := LDFLAGS='-L$(HOST_PREFIX)/lib'
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
153 CONFIGURE_POST_HOOK := true
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2858
diff changeset
154
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
155 ifeq ($(MXE_NATIVE_BUILD),yes)
3031
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
156 MXE_TOOL_PREFIX :=
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
157 ifeq ($(MXE_SYSTEM),msvc)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
158 MXE_AR := ar
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
159 MXE_RANLIB := ranlib
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
160 MXE_CC := clgcc
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
161 MXE_CXX := clg++
3076
b39e8dc859f7 [MSVC] enable gmplib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3068
diff changeset
162 MXE_F77 := clgfortran
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
163 MXE_DLLTOOL := true
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
164 MXE_NM := nm
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
165 MXE_STRIP := true
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
166 MXE_WINDRES := windres
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
167 MXE_PKG_CONFIG := pkg-config
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
168 MXE_QMAKE := qmake
3087
3663f6300abf [MSVC] enable FFTW compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3080
diff changeset
169 # Although the Fortran compiler is internally gfortran, we still
3663f6300abf [MSVC] enable FFTW compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3080
diff changeset
170 # want to make it look like non-GNU compiler, otherwise libtool is
3663f6300abf [MSVC] enable FFTW compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3080
diff changeset
171 # not playing nicely and trips over different variable values for
3663f6300abf [MSVC] enable FFTW compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3080
diff changeset
172 # different configuration tags.
3063
3b4f71898e4b [MSVC] Force use of -O2 for CFLAGS and CXXFLAGS.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3062
diff changeset
173 HOST_AND_BUILD_CONFIGURE_OPTIONS := \
3080
c0222ce8760d [MSVC] enable MSVC compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3079
diff changeset
174 CC='$(MXE_CC)' CXX='$(MXE_CXX)' F77='$(MXE_F77)' DLLTOOL='$(MXE_DLLTOOL)' CCAS='gcc' \
3087
3663f6300abf [MSVC] enable FFTW compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3080
diff changeset
175 CFLAGS='-O2' CXXFLAGS='-O2' ac_cv_f77_compiler_gnu=no
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
176 else
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
177 MXE_AR := ar
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
178 MXE_RANLIB := ranlib
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
179 MXE_CC := gcc
3076
b39e8dc859f7 [MSVC] enable gmplib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3068
diff changeset
180 MXE_CCAS := gcc
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
181 MXE_CXX := g++
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
182 MXE_F77 := gfortran
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
183 MXE_DLLTOOL := dlltool
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
184 MXE_NM := nm
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
185 MXE_STRIP := strip
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
186 ifeq ($(MXE_SYSTEM),mingw)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
187 MXE_WINDRES := windres
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
188 else
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
189 MXE_WINDRES := true
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
190 endif
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
191 MXE_PKG_CONFIG := pkg-config
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
192 MXE_QMAKE := qmake
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
193 endif
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
194 else
3031
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
195 MXE_TOOL_PREFIX := $(TARGET)-
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
196 MXE_AR := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)ar'
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
197 MXE_RANLIB := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)ranlib'
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
198 MXE_CC := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)gcc'
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
199 MXE_CXX := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)g++'
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
200 MXE_F77 := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)gfortran'
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
201 MXE_DLLTOOL := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)dlltool'
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
202 MXE_NM := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)nm'
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
203 MXE_STRIP := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)strip'
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
204 ifeq ($(MXE_SYSTEM),mingw)
3031
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
205 MXE_WINDRES := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)windres'
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
206 else
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
207 MXE_WINDRES := true
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
208 endif
3031
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
209 MXE_PKG_CONFIG := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)pkg-config'
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3029
diff changeset
210 MXE_QMAKE := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)qmake'
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
211 endif
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
212
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
213 ifeq ($(MXE_SYSTEM),mingw)
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
214 MAKE_SHARED_FROM_STATIC_OPTIONS := --windowsdll
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
215 endif
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
216
3039
17d6d363b54d don't quote HOST_BINDIR, HOST_LIBDIR, and HOST_INCDIR definitions
John W. Eaton <jwe@octave.org>
parents: 3036
diff changeset
217 HOST_BINDIR := $(HOST_PREFIX)/bin
17d6d363b54d don't quote HOST_BINDIR, HOST_LIBDIR, and HOST_INCDIR definitions
John W. Eaton <jwe@octave.org>
parents: 3036
diff changeset
218 HOST_LIBDIR := $(HOST_PREFIX)/lib
17d6d363b54d don't quote HOST_BINDIR, HOST_LIBDIR, and HOST_INCDIR definitions
John W. Eaton <jwe@octave.org>
parents: 3036
diff changeset
219 HOST_INCDIR := $(HOST_PREFIX)/include
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
220
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
221 ifeq ($(MXE_SYSTEM),mingw)
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
222 ifneq ($(MXE_NATIVE_BUILD),yes)
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
223 MSYS_BASE_URL := http://sourceforge.net/projects/mingw/files/MSYS/Base
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
224 MSYS_BASE_VER := 1.0.13
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
225 MSYS_BASE_DIR := $(TOP_DIR)/msys-base
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
226 MSYS_BASE_PACKAGES := $(addprefix msys-,bash coreutils diffutils file findutils gawk grep gzip less libiconv libintl libmagic make msys-core regex sed tar termcap)
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
227
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
228 NOTEPAD_BASE_DIR := $(TOP_DIR)/notepad++
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
229 endif
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
230 else ifneq ($(MXE_SYSTEM),msvc)
3014
b6c7244a2f66 Use HOST_BINDIR, HOST_LIBDIR, and HOST_INCDIR instead of MXE_BINDIR, MXE_LIBDIR, and MXE_INCDIR. Attempt to use these variables consistently instead of using $(HOST_PREFIX)/bin, $(HOST_PREFIX)/lib, and $(HOST_PREFIX)/include
John W. Eaton <jwe@octave.org>
parents: 3013
diff changeset
231 LD_LIBRARY_PATH := '$(HOST_LIBDIR)'
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
232 export LD_LIBRARY_PATH
3014
b6c7244a2f66 Use HOST_BINDIR, HOST_LIBDIR, and HOST_INCDIR instead of MXE_BINDIR, MXE_LIBDIR, and MXE_INCDIR. Attempt to use these variables consistently instead of using $(HOST_PREFIX)/bin, $(HOST_PREFIX)/lib, and $(HOST_PREFIX)/include
John W. Eaton <jwe@octave.org>
parents: 3013
diff changeset
233 MXE_CPPFLAGS := '-I$(HOST_INCDIR)'
b6c7244a2f66 Use HOST_BINDIR, HOST_LIBDIR, and HOST_INCDIR instead of MXE_BINDIR, MXE_LIBDIR, and MXE_INCDIR. Attempt to use these variables consistently instead of using $(HOST_PREFIX)/bin, $(HOST_PREFIX)/lib, and $(HOST_PREFIX)/include
John W. Eaton <jwe@octave.org>
parents: 3013
diff changeset
234 MXE_LDFLAGS := '-L$(HOST_LIBDIR)'
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
235 endif
2964
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
236
3006
dabfd7db980c use cp for ln on mingw native builds
John W. Eaton <jwe@octave.org>
parents: 3005
diff changeset
237 LN := ln
dabfd7db980c use cp for ln on mingw native builds
John W. Eaton <jwe@octave.org>
parents: 3005
diff changeset
238 LN_S := $(LN) -s
dabfd7db980c use cp for ln on mingw native builds
John W. Eaton <jwe@octave.org>
parents: 3005
diff changeset
239 LN_SF := $(LN_S) -f
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
240 ifeq ($(MXE_NATIVE_BUILD),yes)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
241 ifeq ($(MXE_SYSTEM),mingw)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
242 LN := cp
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
243 LN_S := $(LN)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
244 LN_SF := $(LN_S)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
245 endif
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
246 ifeq ($(MXE_SYSTEM),msvc)
3006
dabfd7db980c use cp for ln on mingw native builds
John W. Eaton <jwe@octave.org>
parents: 3005
diff changeset
247 LN := cp
dabfd7db980c use cp for ln on mingw native builds
John W. Eaton <jwe@octave.org>
parents: 3005
diff changeset
248 LN_S := $(LN)
dabfd7db980c use cp for ln on mingw native builds
John W. Eaton <jwe@octave.org>
parents: 3005
diff changeset
249 LN_SF := $(LN_S)
dabfd7db980c use cp for ln on mingw native builds
John W. Eaton <jwe@octave.org>
parents: 3005
diff changeset
250 endif
dabfd7db980c use cp for ln on mingw native builds
John W. Eaton <jwe@octave.org>
parents: 3005
diff changeset
251 endif
dabfd7db980c use cp for ln on mingw native builds
John W. Eaton <jwe@octave.org>
parents: 3005
diff changeset
252
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
253 LIBRARY_PREFIX :=
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
254 LIBRARY_SUFFIX :=
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
255
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
256 ifeq ($(MXE_SYSTEM),msvc)
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
257 CL_VERSION := $(shell cl -? 2>&1 | $(SED) -n -e 's/.*Compiler Version \([0-9]\+\).*/\1/p')
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
258 MSVC_VERSION := $(if $(filter 17,$(CL_VERSION)),110, \
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
259 $(if $(filter 16,$(CL_VERSION)),100, \
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
260 $(if $(filter 15,$(CL_VERSION)),90)))
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
261 LIBRARY_PREFIX := vc$(strip $(MSVC_VERSION))-lib
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
262 CONFIGURE_POST_HOOK := lt-postproc -p '$(LIBRARY_PREFIX)' -s '$(LIBRARY_SUFFIX)'
3062
4c047285ea8a Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3061
diff changeset
263 MAKE_SHARED_FROM_STATIC_OPTIONS := --windowsdll --msvc --libprefix '$(LIBRARY_PREFIX)' --libsuffix '$(LIBRARY_SUFFIX)'
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
264 endif
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
265
2958
04791633efbc Octave Forge package sources and build script
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
266 OCTAVE_FORGE_BASE_URL := 'http://sourceforge.net/projects/octave/files/Octave Forge Packages/Individual Package Releases'
04791633efbc Octave Forge package sources and build script
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
267 OCTAVE_FORGE_PACKAGES := $(addprefix of-,miscellaneous struct optim specfun general signal communications image io statistics control)
04791633efbc Octave Forge package sources and build script
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
268
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
269 MAKE_SHARED_FROM_STATIC := \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
270 $(TOP_DIR)/tools/make-shared-from-static $(MAKE_SHARED_FROM_STATIC_OPTIONS)
2858
7c6b29399d05 New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents: 2856
diff changeset
271
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
272 CMAKE_TOOLCHAIN_FILE := $(HOST_PREFIX)/share/cmake/mxe-conf.cmake
1663
9577f70222f8 add cmake toolchain file and simplify build rules of relevant packages
Tony Theodore <tonyt@logyst.com>
parents: 1555
diff changeset
273
1074
4f4354ddd6ae really unexport the troublesome environment variables, rather than just setting them to empty strings
Volker Grabsch <vog@notjusthosting.com>
parents: 826
diff changeset
274 # unexport any environment variables that might cause trouble
1206
686a80e66ce1 add more environment variables to the blacklist: CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH LIBRARY_PATH
Volker Grabsch <vog@notjusthosting.com>
parents: 1201
diff changeset
275 unexport AR CC CFLAGS C_INCLUDE_PATH CPATH CPLUS_INCLUDE_PATH CPP
686a80e66ce1 add more environment variables to the blacklist: CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH LIBRARY_PATH
Volker Grabsch <vog@notjusthosting.com>
parents: 1201
diff changeset
276 unexport CPPFLAGS CROSS CXX CXXCPP CXXFLAGS EXEEXT EXTRA_CFLAGS
686a80e66ce1 add more environment variables to the blacklist: CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH LIBRARY_PATH
Volker Grabsch <vog@notjusthosting.com>
parents: 1201
diff changeset
277 unexport EXTRA_LDFLAGS LD LDFLAGS LIBRARY_PATH LIBS NM
1504
dfa937baa17b improved pkg-config wrapper and its documentation
Volker Grabsch <vog@notjusthosting.com>
parents: 1466
diff changeset
278 unexport OBJC_INCLUDE_PATH PKG_CONFIG QMAKESPEC RANLIB STRIP
287
92ac81dea92d bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents: 285
diff changeset
279
264
01aa6a0e1c9e new macro SHORT_PKG_VERSION which assists in creating download URLs
Volker Grabsch <vog@notjusthosting.com>
parents: 259
diff changeset
280 SHORT_PKG_VERSION = \
01aa6a0e1c9e new macro SHORT_PKG_VERSION which assists in creating download URLs
Volker Grabsch <vog@notjusthosting.com>
parents: 259
diff changeset
281 $(word 1,$(subst ., ,$($(1)_VERSION))).$(word 2,$(subst ., ,$($(1)_VERSION)))
01aa6a0e1c9e new macro SHORT_PKG_VERSION which assists in creating download URLs
Volker Grabsch <vog@notjusthosting.com>
parents: 259
diff changeset
282
3046
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
283 ifeq ($(MXE_NATIVE_MINGW_BUILD),yes)
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
284 UNPACK_ARCHIVE = \
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
285 $(if $(filter %rupdate-1.1.2.tar.gz, $(1)),bsdcpio -id < '$(1)', \
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
286 $(if $(filter %.tgz, $(1)),tar xzf '$(1)', \
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
287 $(if $(filter %.tar.gz, $(1)),tar xzf '$(1)', \
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
288 $(if $(filter %.tar.bz2, $(1)),tar xjf '$(1)', \
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
289 $(if $(filter %.tar.lzma,$(1)),xz -dc -F lzma '$(1)' | tar xf -, \
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
290 $(if $(filter %.tar.xz,$(1)),xz -dc '$(1)' | tar xf -, \
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
291 $(if $(filter %.zip, $(1)),unzip -q '$(1)', \
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
292 $(error Unknown archive format for $(2): $(1)))))))))
3046
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
293 else
120
4edf6a519683 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 119
diff changeset
294 UNPACK_ARCHIVE = \
1101
28abe875c217 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 1095
diff changeset
295 $(if $(filter %.tgz, $(1)),tar xzf '$(1)', \
28abe875c217 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 1095
diff changeset
296 $(if $(filter %.tar.gz, $(1)),tar xzf '$(1)', \
28abe875c217 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 1095
diff changeset
297 $(if $(filter %.tar.bz2, $(1)),tar xjf '$(1)', \
1136
cf87e39ecc2c improved portability invoking tar with stdin
Mark Brand <mabrand@mabrand.nl>
parents: 1132
diff changeset
298 $(if $(filter %.tar.lzma,$(1)),xz -dc -F lzma '$(1)' | tar xf -, \
1555
1669134dcd03 unpack .tar.xz archives
Mark Brand <mabrand@mabrand.nl>
parents: 1519
diff changeset
299 $(if $(filter %.tar.xz,$(1)),xz -dc '$(1)' | tar xf -, \
1101
28abe875c217 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 1095
diff changeset
300 $(if $(filter %.zip, $(1)),unzip -q '$(1)', \
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
301 $(error Unknown archive format for $(2): $(1))))))))
3046
f23cc822f52d Makefile.in updates for native mingw qrupdate untar
John Donoghue <john.donoghue@ieee.org>
parents: 3045
diff changeset
302 endif
114
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
303
215
898425550c29 new macro UNPACK_PKG_ARCHIVE for build rules (This is useful in connection with download-only packages)
Volker Grabsch <vog@notjusthosting.com>
parents: 214
diff changeset
304 UNPACK_PKG_ARCHIVE = \
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
305 $(if $(value $(1)_FILE),$(call UNPACK_ARCHIVE,$(PKG_DIR)/$($(1)_FILE)),true)
215
898425550c29 new macro UNPACK_PKG_ARCHIVE for build rules (This is useful in connection with download-only packages)
Volker Grabsch <vog@notjusthosting.com>
parents: 214
diff changeset
306
306
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
307 PKG_CHECKSUM = \
473
b0cc6cc3c1fc improved status output
Volker Grabsch <vog@notjusthosting.com>
parents: 461
diff changeset
308 openssl sha1 '$(PKG_DIR)/$($(1)_FILE)' 2>/dev/null | $(SED) -n 's,^.*\([0-9a-f]\{40\}\)$$,\1,p'
306
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
309
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
310 CHECK_PKG_ARCHIVE = \
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
311 [ -z "$($(1)_CHECKSUM)" -o '$($(1)_CHECKSUM)' == "`$$(call PKG_CHECKSUM,$(1))`" ]
306
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
312
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
313 DOWNLOAD_PKG_ARCHIVE = \
1159
782fbc148784 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 1136
diff changeset
314 mkdir -p '$(PKG_DIR)' && \
306
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
315 $(if $($(1)_URL_2), \
2730
38054572b13f add package cdn fallback
Tony Theodore <tonyt@logyst.com>
parents: 2729
diff changeset
316 ( $(WGET) -T 30 -t 3 -O- '$($(1)_URL)' || \
38054572b13f add package cdn fallback
Tony Theodore <tonyt@logyst.com>
parents: 2729
diff changeset
317 $(WGET) -O- '$($(1)_URL_2)' || \
38054572b13f add package cdn fallback
Tony Theodore <tonyt@logyst.com>
parents: 2729
diff changeset
318 $(WGET) -O- '$(PKG_MIRROR)/$($(1)_FILE)' || \
38054572b13f add package cdn fallback
Tony Theodore <tonyt@logyst.com>
parents: 2729
diff changeset
319 $(WGET) -O- '$(PKG_CDN)/$($(1)_FILE)' ), \
38054572b13f add package cdn fallback
Tony Theodore <tonyt@logyst.com>
parents: 2729
diff changeset
320 ( $(WGET) -O- '$($(1)_URL)' || \
38054572b13f add package cdn fallback
Tony Theodore <tonyt@logyst.com>
parents: 2729
diff changeset
321 $(WGET) -O- '$(PKG_MIRROR)/$($(1)_FILE)' || \
38054572b13f add package cdn fallback
Tony Theodore <tonyt@logyst.com>
parents: 2729
diff changeset
322 $(WGET) -O- '$(PKG_CDN)/$($(1)_FILE)' )) \
1438
698e4de6d9a6 implemented $(PKG)_FIX_GZIP for GitWeb snapshots and similar issues
Volker Grabsch <vog@notjusthosting.com>
parents: 1437
diff changeset
323 $(if $($(1)_FIX_GZIP), \
698e4de6d9a6 implemented $(PKG)_FIX_GZIP for GitWeb snapshots and similar issues
Volker Grabsch <vog@notjusthosting.com>
parents: 1437
diff changeset
324 | gzip -d | gzip -9n, \
698e4de6d9a6 implemented $(PKG)_FIX_GZIP for GitWeb snapshots and similar issues
Volker Grabsch <vog@notjusthosting.com>
parents: 1437
diff changeset
325 ) \
2729
6c492e126140 cleanup after failed download
Tony Theodore <tonyt@logyst.com>
parents: 2728
diff changeset
326 > '$(PKG_DIR)/$($(1)_FILE)' || rm -f '$(PKG_DIR)/$($(1)_FILE)'
306
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
327
2500
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
328 ifeq ($(IGNORE_SETTINGS),yes)
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
329 $(info [ignore settings.mk])
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
330 else ifeq ($(wildcard $(PWD)/settings.mk),$(PWD)/settings.mk)
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
331 include $(PWD)/settings.mk
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
332 else
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
333 $(info [create settings.mk])
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
334 $(shell { \
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
335 echo '#JOBS = $(JOBS)'; \
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
336 echo '#PKGS ='; \
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
337 } >'$(PWD)/settings.mk')
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
338 endif
8db5a297f243 Add support for a local settings file settings.mk
Volker Grabsch <vog@notjusthosting.com>
parents: 2475
diff changeset
339
114
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
340 .PHONY: all
3050
5e8414a77b7d rules to rebuild Makefile and configure
John W. Eaton <jwe@octave.org>
parents: 3049
diff changeset
341 all: configure Makefile octave
3036
1427f8d3a0af make octave be the default target; new target, all-packages
John W. Eaton <jwe@octave.org>
parents: 3031
diff changeset
342
1427f8d3a0af make octave be the default target; new target, all-packages
John W. Eaton <jwe@octave.org>
parents: 3031
diff changeset
343 .PHONY: all-packages
1427f8d3a0af make octave be the default target; new target, all-packages
John W. Eaton <jwe@octave.org>
parents: 3031
diff changeset
344 all-packages: $(PKGS)
114
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
345
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
346 $(PKGS): $(BUILD_TOOLS) cmake-toolchain-file.stamp
2971
7145a94e4f4e build autoconf, automake, libtool, and cmake instead of expecting them to exist
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
347
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2858
diff changeset
348 .PHONY: msys-base
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2858
diff changeset
349 msys-base: $(MSYS_BASE_PACKAGES)
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2858
diff changeset
350
2958
04791633efbc Octave Forge package sources and build script
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
351 .PHONY: octave-forge-packages
04791633efbc Octave Forge package sources and build script
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
352 octave-forge-packages: $(OCTAVE_FORGE_PACKAGES)
04791633efbc Octave Forge package sources and build script
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
353
3050
5e8414a77b7d rules to rebuild Makefile and configure
John W. Eaton <jwe@octave.org>
parents: 3049
diff changeset
354 configure: configure.ac
5e8414a77b7d rules to rebuild Makefile and configure
John W. Eaton <jwe@octave.org>
parents: 3049
diff changeset
355 autoconf
5e8414a77b7d rules to rebuild Makefile and configure
John W. Eaton <jwe@octave.org>
parents: 3049
diff changeset
356
5e8414a77b7d rules to rebuild Makefile and configure
John W. Eaton <jwe@octave.org>
parents: 3049
diff changeset
357 config.status: configure
5e8414a77b7d rules to rebuild Makefile and configure
John W. Eaton <jwe@octave.org>
parents: 3049
diff changeset
358 $(SHELL) ./config.status --recheck
5e8414a77b7d rules to rebuild Makefile and configure
John W. Eaton <jwe@octave.org>
parents: 3049
diff changeset
359
5e8414a77b7d rules to rebuild Makefile and configure
John W. Eaton <jwe@octave.org>
parents: 3049
diff changeset
360 Makefile: Makefile.in config.status
5e8414a77b7d rules to rebuild Makefile and configure
John W. Eaton <jwe@octave.org>
parents: 3049
diff changeset
361 $(SHELL) ./config.status Makefile
5e8414a77b7d rules to rebuild Makefile and configure
John W. Eaton <jwe@octave.org>
parents: 3049
diff changeset
362
1398
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
363 .PHONY: check-requirements
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
364 define CHECK_REQUIREMENT
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
365 @if ! $(1) --help &>/dev/null; then \
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
366 echo; \
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
367 echo 'Missing requirement: $(1)'; \
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
368 echo; \
2353
99516e73b368 Move doc/index.html -> index.html
Volker Grabsch <vog@notjusthosting.com>
parents: 2350
diff changeset
369 echo 'Please have a look at "index.html" to ensure'; \
1398
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
370 echo 'that your system meets all requirements.'; \
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
371 echo; \
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
372 exit 1; \
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
373 fi
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
374
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
375 endef
2287
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
376 define CHECK_REQUIREMENT_VERSION
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
377 @if ! $(1) --version | head -1 | grep ' \($(2)\)$$' >/dev/null; then \
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
378 echo; \
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
379 echo 'Wrong version of requirement: $(1)'; \
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
380 echo; \
2353
99516e73b368 Move doc/index.html -> index.html
Volker Grabsch <vog@notjusthosting.com>
parents: 2350
diff changeset
381 echo 'Please have a look at "index.html" to ensure'; \
2287
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
382 echo 'that your system meets all requirements.'; \
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
383 echo; \
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
384 exit 1; \
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
385 fi
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
386
e9eed43704a2 Check for required versions of Autoconf and Automake
Volker Grabsch <vog@notjusthosting.com>
parents: 2153
diff changeset
387 endef
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
388 check-requirements: $(STAMP_DIR)/check-requirements
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
389 $(STAMP_DIR)/check-requirements: $(MAKEFILE)
1398
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
390 @echo '[check requirements]'
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
391 $(foreach REQUIREMENT,$(REQUIREMENTS),$(call CHECK_REQUIREMENT,$(REQUIREMENT)))
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
392 @[ -d '$(STAMP_DIR)' ] || mkdir -p '$(STAMP_DIR)'
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
393 @if test "$(USE_SYSTEM_GCC)" = yes; then \
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
394 $(INSTALL) -d '$(BUILD_TOOLS_PREFIX)/bin' ; \
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
395 $(INSTALL) -m 755 tools/config.guess '$(BUILD_TOOLS_PREFIX)/bin/config.guess' ; \
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
396 $(INSTALL) -m 755 tools/config.sub '$(BUILD_TOOLS_PREFIX)/bin/config.sub' ; \
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2991
diff changeset
397 fi
1403
90d846d2b3c9 check requirements only at the first time and after each change to the main Makefile (which possibly changed the list of requirements)
Volker Grabsch <vog@notjusthosting.com>
parents: 1399
diff changeset
398 @touch '$@'
1398
c6aaf7d9c746 check most of the requirements in advance
Volker Grabsch <vog@notjusthosting.com>
parents: 1397
diff changeset
399
2350
2691d175df4e Improve performance of loading main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2349
diff changeset
400 define newline
2691d175df4e Improve performance of loading main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2349
diff changeset
401
2691d175df4e Improve performance of loading main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2349
diff changeset
402
2349
f48c5b085a38 Move $(PKG)_VERSION and $(PKG)_WEBSITE from src/*.mk into doc/index.html
Volker Grabsch <vog@notjusthosting.com>
parents: 2348
diff changeset
403 endef
2350
2691d175df4e Improve performance of loading main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2349
diff changeset
404 $(eval $(subst #,$(newline),$(shell \
2691d175df4e Improve performance of loading main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2349
diff changeset
405 $(SED) -n \
2359
1726cefccf0c Fix trailing space after version number
Volker Grabsch <vog@notjusthosting.com>
parents: 2357
diff changeset
406 's/^.* id="\([A-Za-z0-9_+-]*\)-version">\([^<]*\)<.*$$/\1_VERSION := \2#/p' \
2353
99516e73b368 Move doc/index.html -> index.html
Volker Grabsch <vog@notjusthosting.com>
parents: 2350
diff changeset
407 '$(TOP_DIR)/index.html' \
2350
2691d175df4e Improve performance of loading main Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 2349
diff changeset
408 )))
2349
f48c5b085a38 Move $(PKG)_VERSION and $(PKG)_WEBSITE from src/*.mk into doc/index.html
Volker Grabsch <vog@notjusthosting.com>
parents: 2348
diff changeset
409
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
410 include $(patsubst %,$(TOP_DIR)/src/%.mk,$(ALL_BUILD_TOOLS))
2375
2023ebb23822 Load only *.mk files of packages mentioned in index.html
Volker Grabsch <vog@notjusthosting.com>
parents: 2370
diff changeset
411 include $(patsubst %,$(TOP_DIR)/src/%.mk,$(PKGS))
2346
8746e2f1c758 Improve coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 2345
diff changeset
412
394
bb2b329f85d3 new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents: 392
diff changeset
413 .PHONY: download
2971
7145a94e4f4e build autoconf, automake, libtool, and cmake instead of expecting them to exist
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
414 download: $(addprefix download-,$(PKGS)) $(addprefix download-,$(BUILD_TOOLS))
394
bb2b329f85d3 new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents: 392
diff changeset
415
114
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
416 define PKG_RULE
394
bb2b329f85d3 new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents: 392
diff changeset
417 .PHONY: download-$(1)
429
2fa394d22e1d bugfix and simplification of "make download"
Volker Grabsch <vog@notjusthosting.com>
parents: 428
diff changeset
418 download-$(1): $(addprefix download-,$($(1)_DEPS))
310
5c5e254fa32b bugfix in handling checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 306
diff changeset
419 if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \
5c5e254fa32b bugfix in handling checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 306
diff changeset
420 $(call DOWNLOAD_PKG_ARCHIVE,$(1)); \
5c5e254fa32b bugfix in handling checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 306
diff changeset
421 $(call CHECK_PKG_ARCHIVE,$(1)) || { echo 'Wrong checksum!'; exit 1; }; \
430
5d2c64680021 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 429
diff changeset
422 fi
394
bb2b329f85d3 new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents: 392
diff changeset
423
bb2b329f85d3 new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents: 392
diff changeset
424 .PHONY: $(1)
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
425 $(1): $(STAMP_DIR)/$(1)
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
426 $(STAMP_DIR)/$(1): $(TOP_DIR)/src/$(1).mk \
394
bb2b329f85d3 new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents: 392
diff changeset
427 $(wildcard $(TOP_DIR)/src/$(1)-*.patch) \
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
428 $(wildcard $(TOP_DIR)/src/$(MXE_SYSTEM)-$(1)-*.patch) \
778
f8c2ff4cf740 bugfix: add test scripts as dependency files, and put them into the distribution tarball
Volker Grabsch <vog@notjusthosting.com>
parents: 738
diff changeset
429 $(wildcard $(TOP_DIR)/src/$(1)-test*) \
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
430 $(shell test -d $(TOPDIR)/src/$(1) && find $(TOPDIR)/src/$(1) -type f) \
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
431 $(addprefix $(STAMP_DIR)/,$($(1)_DEPS)) \
1399
6b28a4f27b8c bugfix in the integration of "make check-requirements"
Volker Grabsch <vog@notjusthosting.com>
parents: 1398
diff changeset
432 | check-requirements
604
95aeaeacaf9c improved layout of the log/ directory
Volker Grabsch <vog@notjusthosting.com>
parents: 596
diff changeset
433 @[ -d '$(LOG_DIR)/$(TIMESTAMP)' ] || mkdir -p '$(LOG_DIR)/$(TIMESTAMP)'
431
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
434 @if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
435 echo '[download] $(1)'; \
3003
7d692ab680ab Change makefile download and build rules to log to symbolic link file instead of log/timestamp/file.
John Donoghue <john.donoghue@ieee.org>
parents: 2997
diff changeset
436 touch '$(LOG_DIR)/$(TIMESTAMP)/$(1)-download'; \
1397
b33871ee26a3 improved coding style: make use of the "-f" option of "ln"
Volker Grabsch <vog@notjusthosting.com>
parents: 1396
diff changeset
437 ln -sf '$(TIMESTAMP)/$(1)-download' '$(LOG_DIR)/$(1)-download'; \
3003
7d692ab680ab Change makefile download and build rules to log to symbolic link file instead of log/timestamp/file.
John Donoghue <john.donoghue@ieee.org>
parents: 2997
diff changeset
438 ($(call DOWNLOAD_PKG_ARCHIVE,$(1))) &> '$(LOG_DIR)/$(1)-download'; \
431
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
439 if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
440 echo; \
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
441 echo 'Wrong checksum of package $(1)!'; \
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
442 echo '------------------------------------------------------------'; \
595
f4b50cf506c6 keep separate download logs in log/PKG-download
Volker Grabsch <vog@notjusthosting.com>
parents: 594
diff changeset
443 tail -n 10 '$(LOG_DIR)/$(1)-download' | $(SED) -n '/./p'; \
431
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
444 echo '------------------------------------------------------------'; \
595
f4b50cf506c6 keep separate download logs in log/PKG-download
Volker Grabsch <vog@notjusthosting.com>
parents: 594
diff changeset
445 echo '[log] $(LOG_DIR)/$(1)-download'; \
431
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
446 echo; \
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
447 exit 1; \
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
448 fi; \
430
5d2c64680021 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 429
diff changeset
449 fi
434
7fdb6628d83a improved output: don't show "[build]" for download-only packages
Volker Grabsch <vog@notjusthosting.com>
parents: 431
diff changeset
450 $(if $(value $(1)_BUILD),
7fdb6628d83a improved output: don't show "[build]" for download-only packages
Volker Grabsch <vog@notjusthosting.com>
parents: 431
diff changeset
451 @echo '[build] $(1)'
7fdb6628d83a improved output: don't show "[build]" for download-only packages
Volker Grabsch <vog@notjusthosting.com>
parents: 431
diff changeset
452 ,)
1396
296b81e392cf portability fix for MSYS
Volker Grabsch <vog@notjusthosting.com>
parents: 1296
diff changeset
453 @touch '$(LOG_DIR)/$(TIMESTAMP)/$(1)'
1397
b33871ee26a3 improved coding style: make use of the "-f" option of "ln"
Volker Grabsch <vog@notjusthosting.com>
parents: 1396
diff changeset
454 @ln -sf '$(TIMESTAMP)/$(1)' '$(LOG_DIR)/$(1)'
3003
7d692ab680ab Change makefile download and build rules to log to symbolic link file instead of log/timestamp/file.
John Donoghue <john.donoghue@ieee.org>
parents: 2997
diff changeset
455 @if ! (time $(MAKE) -f '$(MAKEFILE)' 'build-only-$(1)') &> '$(LOG_DIR)/$(1)'; then \
431
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
456 echo; \
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
457 echo 'Failed to build package $(1)!'; \
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
458 echo '------------------------------------------------------------'; \
594
2a325441b1ab put log files into a separate sub directory log/, separate from usr/, surviving a "make clean"
Volker Grabsch <vog@notjusthosting.com>
parents: 593
diff changeset
459 tail -n 10 '$(LOG_DIR)/$(1)' | $(SED) -n '/./p'; \
431
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
460 echo '------------------------------------------------------------'; \
594
2a325441b1ab put log files into a separate sub directory log/, separate from usr/, surviving a "make clean"
Volker Grabsch <vog@notjusthosting.com>
parents: 593
diff changeset
461 echo '[log] $(LOG_DIR)/$(1)'; \
431
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
462 echo; \
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
463 exit 1; \
e77981de8c92 highlevel output of the download/build process, put also download actions into the log file
Volker Grabsch <vog@notjusthosting.com>
parents: 430
diff changeset
464 fi
435
80c86e6f7ca6 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 434
diff changeset
465 @echo '[done] $(1)'
428
951e2a6d1e69 create a separate build log file "usr/log-PKG" for each package build
Volker Grabsch <vog@notjusthosting.com>
parents: 427
diff changeset
466
951e2a6d1e69 create a separate build log file "usr/log-PKG" for each package build
Volker Grabsch <vog@notjusthosting.com>
parents: 427
diff changeset
467 .PHONY: build-only-$(1)
2742
9276054dea28 Makefile: pass PKG variable to build rules
Tony Theodore <tonyt@logyst.com>
parents: 2730
diff changeset
468 build-only-$(1): PKG = $(1)
428
951e2a6d1e69 create a separate build log file "usr/log-PKG" for each package build
Volker Grabsch <vog@notjusthosting.com>
parents: 427
diff changeset
469 build-only-$(1):
214
e1c566cd7a5e allow packages without a BUILD section (This will be used for download-only packages such as gcc-g++.)
Volker Grabsch <vog@notjusthosting.com>
parents: 213
diff changeset
470 $(if $(value $(1)_BUILD),
e1c566cd7a5e allow packages without a BUILD section (This will be used for download-only packages such as gcc-g++.)
Volker Grabsch <vog@notjusthosting.com>
parents: 213
diff changeset
471 rm -rf '$(2)'
e1c566cd7a5e allow packages without a BUILD section (This will be used for download-only packages such as gcc-g++.)
Volker Grabsch <vog@notjusthosting.com>
parents: 213
diff changeset
472 mkdir -p '$(2)'
215
898425550c29 new macro UNPACK_PKG_ARCHIVE for build rules (This is useful in connection with download-only packages)
Volker Grabsch <vog@notjusthosting.com>
parents: 214
diff changeset
473 cd '$(2)' && $(call UNPACK_PKG_ARCHIVE,$(1))
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
474 test ! -d '$(TOP_DIR)/src/$(1)' || cp -a '$(TOP_DIR)/src/$(1)' '$(2)'
214
e1c566cd7a5e allow packages without a BUILD section (This will be used for download-only packages such as gcc-g++.)
Volker Grabsch <vog@notjusthosting.com>
parents: 213
diff changeset
475 cd '$(2)/$($(1)_SUBDIR)'
391
8349a6576cac automatically apply patches "src/PKG-*.patch" which are provided with a "src/PKG.mk" file
Volker Grabsch <vog@notjusthosting.com>
parents: 378
diff changeset
476 $(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/$(1)-*.patch)),
1132
d4ccfc3cfdd4 bugfix: use GNU Patch under FreeBSD (by Tony Theodore)
Volker Grabsch <vog@notjusthosting.com>
parents: 1101
diff changeset
477 (cd '$(2)/$($(1)_SUBDIR)' && $(PATCH) -p1 -u) < $(PKG_PATCH))
3079
fd2f3cb4c360 Remove hard-coded reference to msvc for patch application.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3076
diff changeset
478 $(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/$(MXE_SYSTEM)-$(1)-*.patch)),
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
479 (cd '$(2)/$($(1)_SUBDIR)' && $(PATCH) -p1 -u) < $(PKG_PATCH))
657
b1d03b91eb1e test program for package sdl
Volker Grabsch <vog@notjusthosting.com>
parents: 641
diff changeset
480 $$(call $(1)_BUILD,$(2)/$($(1)_SUBDIR),$(TOP_DIR)/src/$(1)-test)
1979
9e3cc5c56804 log the total disk usage of the temporary build directory after each successful build
Volker Grabsch <vog@notjusthosting.com>
parents: 1847
diff changeset
481 (du -k -d 0 '$(2)' 2>/dev/null || du -k --max-depth 0 '$(2)') | $(SED) -n 's/^\(\S*\).*/du: \1 KiB/p'
214
e1c566cd7a5e allow packages without a BUILD section (This will be used for download-only packages such as gcc-g++.)
Volker Grabsch <vog@notjusthosting.com>
parents: 213
diff changeset
482 rm -rfv '$(2)'
e1c566cd7a5e allow packages without a BUILD section (This will be used for download-only packages such as gcc-g++.)
Volker Grabsch <vog@notjusthosting.com>
parents: 213
diff changeset
483 ,)
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
484 [ -d '$(STAMP_DIR)' ] || mkdir -p '$(STAMP_DIR)'
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
485 touch '$(STAMP_DIR)/$(1)'
114
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
486 endef
403
825505ea3855 improved variable naming in the Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 401
diff changeset
487 $(foreach PKG,$(PKGS),$(eval $(call PKG_RULE,$(PKG),$(call TMP_DIR,$(PKG)))))
2971
7145a94e4f4e build autoconf, automake, libtool, and cmake instead of expecting them to exist
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
488 $(foreach TOOL,$(BUILD_TOOLS),$(eval $(call PKG_RULE,$(TOOL),$(call TMP_DIR,$(TOOL)))))
114
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
489
119
ff34f15ec142 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 114
diff changeset
490 .PHONY: clean
ff34f15ec142 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 114
diff changeset
491 clean:
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
492 rm -rf $(call TMP_DIR,*) $(BUILD_TOOLS_PREFIX)
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
493 rm -rf $(STAMP_DIR) $(MSYS_INFO_DIR) $(LOG_DIR)
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
494 rm -rf $(MSYS_BASE_DIR) $(NOTEPAD_BASE_DIR)
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 3009
diff changeset
495 rm -rf native-tools cross-tools octave gnuplot
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
496 rm -f Makefile cmake-toolchain-file.stamp
119
ff34f15ec142 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 114
diff changeset
497
226
c07a36f3ea80 new target "make clean-pkg" to remove all unused package files (handy after a successful "make update")
Volker Grabsch <vog@notjusthosting.com>
parents: 215
diff changeset
498 .PHONY: clean-pkg
c07a36f3ea80 new target "make clean-pkg" to remove all unused package files (handy after a successful "make update")
Volker Grabsch <vog@notjusthosting.com>
parents: 215
diff changeset
499 clean-pkg:
c07a36f3ea80 new target "make clean-pkg" to remove all unused package files (handy after a successful "make update")
Volker Grabsch <vog@notjusthosting.com>
parents: 215
diff changeset
500 rm -f $(patsubst %,'%', \
c07a36f3ea80 new target "make clean-pkg" to remove all unused package files (handy after a successful "make update")
Volker Grabsch <vog@notjusthosting.com>
parents: 215
diff changeset
501 $(filter-out \
403
825505ea3855 improved variable naming in the Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 401
diff changeset
502 $(foreach PKG,$(PKGS),$(PKG_DIR)/$($(PKG)_FILE)), \
226
c07a36f3ea80 new target "make clean-pkg" to remove all unused package files (handy after a successful "make update")
Volker Grabsch <vog@notjusthosting.com>
parents: 215
diff changeset
503 $(wildcard $(PKG_DIR)/*)))
c07a36f3ea80 new target "make clean-pkg" to remove all unused package files (handy after a successful "make update")
Volker Grabsch <vog@notjusthosting.com>
parents: 215
diff changeset
504
119
ff34f15ec142 improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 114
diff changeset
505 .PHONY: update
114
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
506 define UPDATE
306
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
507 $(if $(2),
448
e9afec55fd6b improved version recognition, enable the notation of ignored (bad) package versions
Volker Grabsch <vog@notjusthosting.com>
parents: 443
diff changeset
508 $(if $(filter $(2),$($(1)_IGNORE)),
461
c489fb1015e2 improved output style of "make update" again
Volker Grabsch <vog@notjusthosting.com>
parents: 454
diff changeset
509 $(info IGNORED $(1) $(2)),
448
e9afec55fd6b improved version recognition, enable the notation of ignored (bad) package versions
Volker Grabsch <vog@notjusthosting.com>
parents: 443
diff changeset
510 $(if $(filter $(2),$($(1)_VERSION)),
461
c489fb1015e2 improved output style of "make update" again
Volker Grabsch <vog@notjusthosting.com>
parents: 454
diff changeset
511 $(info . $(1) $(2)),
477
ffca44340844 improved output of "make update"
Volker Grabsch <vog@notjusthosting.com>
parents: 473
diff changeset
512 $(info NEW $(1) $($(1)_VERSION) --> $(2))
2353
99516e73b368 Move doc/index.html -> index.html
Volker Grabsch <vog@notjusthosting.com>
parents: 2350
diff changeset
513 $(SED) -i 's/\( id="$(1)-version"\)>[^<]*/\1>$(2)/' '$(TOP_DIR)/index.html'
517
80db96994441 improved "make update": revert a package's version number when there were download problem with the new version
Volker Grabsch <vog@notjusthosting.com>
parents: 511
diff changeset
514 $(MAKE) -f '$(MAKEFILE)' 'update-checksum-$(1)' \
2353
99516e73b368 Move doc/index.html -> index.html
Volker Grabsch <vog@notjusthosting.com>
parents: 2350
diff changeset
515 || { $(SED) -i 's/\( id="$(1)-version"\)>[^<]*/\1>$($(1)_VERSION)/' '$(TOP_DIR)/index.html'; \
519
99a330c048df bugfix for "make update": avoid silent package update failures
Volker Grabsch <vog@notjusthosting.com>
parents: 517
diff changeset
516 exit 1; })),
560
185e73877b08 improved error message for "make update"
Volker Grabsch <vog@notjusthosting.com>
parents: 545
diff changeset
517 $(error Unable to update version number of package $(1)))
114
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
518
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
519 endef
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
520 update:
403
825505ea3855 improved variable naming in the Makefile
Volker Grabsch <vog@notjusthosting.com>
parents: 401
diff changeset
521 $(foreach PKG,$(PKGS),$(call UPDATE,$(PKG),$(shell $($(PKG)_UPDATE))))
114
771b6c26008d completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
522
306
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
523 update-checksum-%:
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
524 $(call DOWNLOAD_PKG_ARCHIVE,$*)
2348
5ada143a0517 Improve coding style
Volker Grabsch <vog@notjusthosting.com>
parents: 2346
diff changeset
525 $(SED) -i 's/^\([^ ]*_CHECKSUM *:=\).*/\1 '"`$(call PKG_CHECKSUM,$*)`"'/' '$(TOP_DIR)/src/$*.mk'
306
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 305
diff changeset
526
2357
5a0c2bf69e55 Add new command "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2356
diff changeset
527 cleanup-style:
5a0c2bf69e55 Add new command "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2356
diff changeset
528 @$(foreach FILE,$(wildcard $(addprefix $(TOP_DIR)/,Makefile index.html CNAME src/*.mk src/*test.* tools/*)),\
2368
5e6e989cb349 Improve "make cleanup-style" to touch only files that have to be fixed
Volker Grabsch <vog@notjusthosting.com>
parents: 2359
diff changeset
529 $(SED) ' \
2357
5a0c2bf69e55 Add new command "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2356
diff changeset
530 s/\r//g; \
5a0c2bf69e55 Add new command "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2356
diff changeset
531 s/[ \t]\+$$//; \
5a0c2bf69e55 Add new command "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2356
diff changeset
532 s,^#!/bin/bash$$,#!/usr/bin/env bash,; \
5a0c2bf69e55 Add new command "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2356
diff changeset
533 $(if $(filter %Makefile,$(FILE)),,\
5a0c2bf69e55 Add new command "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2356
diff changeset
534 s/\t/ /g; \
5a0c2bf69e55 Add new command "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2356
diff changeset
535 ) \
2368
5e6e989cb349 Improve "make cleanup-style" to touch only files that have to be fixed
Volker Grabsch <vog@notjusthosting.com>
parents: 2359
diff changeset
536 ' < $(FILE) > $(TOP_DIR)/tmp-cleanup-style; \
5e6e989cb349 Improve "make cleanup-style" to touch only files that have to be fixed
Volker Grabsch <vog@notjusthosting.com>
parents: 2359
diff changeset
537 diff -u $(FILE) $(TOP_DIR)/tmp-cleanup-style >/dev/null \
5e6e989cb349 Improve "make cleanup-style" to touch only files that have to be fixed
Volker Grabsch <vog@notjusthosting.com>
parents: 2359
diff changeset
538 || { echo '[cleanup] $(FILE)'; \
5e6e989cb349 Improve "make cleanup-style" to touch only files that have to be fixed
Volker Grabsch <vog@notjusthosting.com>
parents: 2359
diff changeset
539 cp $(TOP_DIR)/tmp-cleanup-style $(FILE); }; \
5e6e989cb349 Improve "make cleanup-style" to touch only files that have to be fixed
Volker Grabsch <vog@notjusthosting.com>
parents: 2359
diff changeset
540 rm -f $(TOP_DIR)/tmp-cleanup-style; \
2357
5a0c2bf69e55 Add new command "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2356
diff changeset
541 )
5a0c2bf69e55 Add new command "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2356
diff changeset
542
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
543 define build-cmake-toolchain-file
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
544 # create the CMake toolchain file
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
545 [ -d '$(dir $(CMAKE_TOOLCHAIN_FILE))' ] || mkdir -p '$(dir $(CMAKE_TOOLCHAIN_FILE))'
3061
f8299bb6c872 Initial support for native MSVC compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3050
diff changeset
546 (if [ $(MXE_SYSTEM) = mingw -o $(MXE_SYSTEM) = msvc ]; then \
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
547 echo 'set(CMAKE_SYSTEM_NAME Windows)'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
548 echo 'set(MSYS 1)'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
549 fi; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
550 if [ $(BUILD_SHARED) = yes ]; then \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
551 echo 'set(BUILD_SHARED_LIBS ON)'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
552 else \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
553 echo 'set(BUILD_SHARED_LIBS OFF)'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
554 fi; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
555 if [ $(BUILD_STATIC) = yes ]; then \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
556 echo 'set(BUILD_STATIC_LIBS ON)'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
557 else \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
558 echo 'set(BUILD_STATIC_LIBS OFF)'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
559 fi; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
560 echo 'set(CMAKE_BUILD_TYPE Release)'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
561 echo 'set(CMAKE_FIND_ROOT_PATH $(HOST_PREFIX))'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
562 echo 'set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
563 echo 'set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
564 echo 'set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
565 echo 'set(CMAKE_C_COMPILER $(MXE_CC))'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
566 echo 'set(CMAKE_CXX_COMPILER $(MXE_CXX))'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
567 echo 'set(CMAKE_Fortran_COMPILER $(MXE_F77))'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
568 echo 'set(CMAKE_RC_COMPILER $(MXE_WINDRES))'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
569 echo 'set(PKG_CONFIG_EXECUTABLE $(MXE_PKG_CONFIG))'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
570 echo 'set(QT_QMAKE_EXECUTABLE $(MXE_QMAKE))'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
571 echo 'set(CMAKE_INSTALL_PREFIX $(HOST_PREFIX) CACHE PATH "Installation Prefix")'; \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
572 echo 'set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug|Release|RelWithDebInfo|MinSizeRel")') \
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
573 > '$(CMAKE_TOOLCHAIN_FILE)'
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
574 endef
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
575
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
576 cmake-toolchain-file.stamp:
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
577 $(build-cmake-toolchain-file)
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
578 touch cmake-toolchain-file.stamp
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3046
diff changeset
579
3045
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
580 # Files to distribute
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
581 include dist-files.mk
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
582
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
583 PACKAGE_VERSION := @PACKAGE_VERSION@
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
584 PACKAGE_TARNAME := @PACKAGE_TARNAME@
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
585
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
586 distdir := $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
587
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
588 .PHONY: dist
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
589 dist:
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
590 rm -rf $(distdir)
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
591 mkdir $(distdir)
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
592 tar cf - $(DIST_FILES) | ( cd $(distdir) ; tar xpf - )
4558fcd35fbb dist target and list of files to distribute
John W. Eaton <jwe@octave.org>
parents: 3044
diff changeset
593 tar czf $(distdir).tar.gz $(distdir)