Mercurial > mxe-octave
annotate Makefile @ 394:bb2b329f85d3
new command "make download"
author | Volker Grabsch <vog@notjusthosting.com> |
---|---|
date | Tue, 16 Jun 2009 21:57:25 +0200 |
parents | 7231888a5658 |
children | 3bfb1390ce96 |
rev | line source |
---|---|
123
9fedbab70063
improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents:
122
diff
changeset
|
1 # MinGW cross compiling environment |
371
e8f5952f877a
mention doc/index.html in the Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
364
diff
changeset
|
2 # see doc/index.html or doc/README for further information |
123
9fedbab70063
improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents:
122
diff
changeset
|
3 |
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
|
4 JOBS := 1 |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
5 TARGET := i386-mingw32msvc |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
6 SOURCEFORGE_MIRROR := kent.dl.sourceforge.net |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
7 |
316
06137f1f9b9e
increased version number to 2.6
Volker Grabsch <vog@notjusthosting.com>
parents:
311
diff
changeset
|
8 VERSION := 2.6 |
306
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
9 PREFIX := $(PWD)/usr |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
10 PKG_DIR := $(PWD)/pkg |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
11 TMP_DIR = $(PWD)/tmp-$(1) |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
12 MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
13 TOP_DIR := $(patsubst %/,%,$(dir $(MAKEFILE))) |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
14 PATH := $(PREFIX)/bin:$(PATH) |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
15 SHELL := bash |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
16 SED := $(shell gsed --help >/dev/null 2>&1 && echo g)sed |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
17 INSTALL := $(shell ginstall --help >/dev/null 2>&1 && echo g)install |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
18 |
287
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
19 # unset any environment variables which might cause trouble |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
20 AR = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
21 CC = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
22 CFLAGS = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
23 CPP = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
24 CPPFLAGS = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
25 CROSS = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
26 CXX = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
27 CXXCPP = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
28 CXXFLAGS = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
29 EXEEXT = |
378
a2b5d6e4d117
bugfix: unset the EXTRA_* environment variables which causes trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
371
diff
changeset
|
30 EXTRA_CFLAGS = |
a2b5d6e4d117
bugfix: unset the EXTRA_* environment variables which causes trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
371
diff
changeset
|
31 EXTRA_LDFLAGS = |
287
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
32 LD = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
33 LDFLAGS = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
34 LIBS = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
35 NM = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
36 PKG_CONFIG = |
364
b8cd5199077e
bugfix: unset the PKG_CONFIG_PATH environment variable which causes trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
359
diff
changeset
|
37 PKG_CONFIG_PATH = |
287
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
38 RANLIB = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
39 STRIP = |
92ac81dea92d
bugfix: unset any environment variables which might cause trouble
Volker Grabsch <vog@notjusthosting.com>
parents:
285
diff
changeset
|
40 |
264
01aa6a0e1c9e
new macro SHORT_PKG_VERSION which assists in creating download URLs
Volker Grabsch <vog@notjusthosting.com>
parents:
259
diff
changeset
|
41 SHORT_PKG_VERSION = \ |
01aa6a0e1c9e
new macro SHORT_PKG_VERSION which assists in creating download URLs
Volker Grabsch <vog@notjusthosting.com>
parents:
259
diff
changeset
|
42 $(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
|
43 |
213
faeb91c793f3
find the src/*.mk and doc/ files even when called from another directory, e.g. via "make -f /path/to/mingw_cross_env/Makefile"
Volker Grabsch <vog@notjusthosting.com>
parents:
212
diff
changeset
|
44 PKG_RULES := $(patsubst $(TOP_DIR)/src/%.mk,%,$(wildcard $(TOP_DIR)/src/*.mk)) |
faeb91c793f3
find the src/*.mk and doc/ files even when called from another directory, e.g. via "make -f /path/to/mingw_cross_env/Makefile"
Volker Grabsch <vog@notjusthosting.com>
parents:
212
diff
changeset
|
45 include $(TOP_DIR)/src/*.mk |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
46 |
120
4edf6a519683
improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents:
119
diff
changeset
|
47 UNPACK_ARCHIVE = \ |
144
aafad5b5de5f
bugfix: support the .tgz archive extension in addition to .tar.gz
Volker Grabsch <vog@notjusthosting.com>
parents:
135
diff
changeset
|
48 $(if $(filter %.tgz, $(1)),tar xvzf '$(1)', \ |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
49 $(if $(filter %.tar.gz, $(1)),tar xvzf '$(1)', \ |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
50 $(if $(filter %.tar.bz2,$(1)),tar xvjf '$(1)', \ |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
51 $(if $(filter %.zip, $(1)),unzip '$(1)', \ |
144
aafad5b5de5f
bugfix: support the .tgz archive extension in addition to .tar.gz
Volker Grabsch <vog@notjusthosting.com>
parents:
135
diff
changeset
|
52 $(error Unknown archive format: $(1)))))) |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
53 |
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
|
54 UNPACK_PKG_ARCHIVE = \ |
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
|
55 $(call UNPACK_ARCHIVE,$(PKG_DIR)/$($(1)_FILE)) |
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
|
56 |
306
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
57 PKG_CHECKSUM = \ |
311
ce0d27e7993f
use "openssl sha1 ..." instead of "sha1sum -b ..."
Volker Grabsch <vog@notjusthosting.com>
parents:
310
diff
changeset
|
58 openssl sha1 '$(PKG_DIR)/$($(1)_FILE)' | $(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
|
59 |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
60 CHECK_PKG_ARCHIVE = \ |
311
ce0d27e7993f
use "openssl sha1 ..." instead of "sha1sum -b ..."
Volker Grabsch <vog@notjusthosting.com>
parents:
310
diff
changeset
|
61 [ '$($(1)_CHECKSUM)' == "`$$(call PKG_CHECKSUM,$(1))`" ] |
306
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
62 |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
63 DOWNLOAD_PKG_ARCHIVE = \ |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
64 $(if $($(1)_URL_2), \ |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
65 wget -T 30 -t 3 -c -O '$(PKG_DIR)/$($(1)_FILE)' '$($(1)_URL)' \ |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
66 || wget -c -O '$(PKG_DIR)/$($(1)_FILE)' '$($(1)_URL_2)', \ |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
67 wget -c -O '$(PKG_DIR)/$($(1)_FILE)' '$($(1)_URL)') |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
68 |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
69 .PHONY: all |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
70 all: $(PKG_RULES) |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
71 |
394
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
72 .PHONY: download |
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
73 download: $(addprefix download-,$(PKG_RULES)) |
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
74 |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
75 define PKG_RULE |
394
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
76 .PHONY: download-$(1) |
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
77 download-$(1): $(TOP_DIR)/src/$(1).mk $(addprefix download-,$($(1)_DEPS)) |
134
d24e76675835
bugfix: use -d instead of -z to check for a directory
Volker Grabsch <vog@notjusthosting.com>
parents:
131
diff
changeset
|
78 [ -d '$(PKG_DIR)' ] || mkdir -p '$(PKG_DIR)' |
310
5c5e254fa32b
bugfix in handling checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
306
diff
changeset
|
79 if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \ |
5c5e254fa32b
bugfix in handling checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
306
diff
changeset
|
80 $(call DOWNLOAD_PKG_ARCHIVE,$(1)); \ |
5c5e254fa32b
bugfix in handling checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
306
diff
changeset
|
81 $(call CHECK_PKG_ARCHIVE,$(1)) || { echo 'Wrong checksum!'; exit 1; }; \ |
5c5e254fa32b
bugfix in handling checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
306
diff
changeset
|
82 fi |
394
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
83 |
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
84 .PHONY: $(1) |
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
85 $(1): $(PREFIX)/installed-$(1) |
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
86 $(PREFIX)/installed-$(1): $(TOP_DIR)/src/$(1).mk \ |
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
87 download-$(1) \ |
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
88 $(wildcard $(TOP_DIR)/src/$(1)-*.patch) \ |
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
89 $(addprefix $(PREFIX)/installed-,$($(1)_DEPS)) |
bb2b329f85d3
new command "make download"
Volker Grabsch <vog@notjusthosting.com>
parents:
392
diff
changeset
|
90 [ -d '$(PREFIX)' ] || mkdir -p '$(PREFIX)' |
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
|
91 $(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
|
92 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
|
93 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
|
94 cd '$(2)' && $(call UNPACK_PKG_ARCHIVE,$(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
|
95 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
|
96 $(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/$(1)-*.patch)), |
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
|
97 (cd '$(2)/$($(1)_SUBDIR)' && patch -p1) < $(PKG_PATCH)) |
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
|
98 $$(call $(1)_BUILD,$(2)/$($(1)_SUBDIR)) |
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
|
99 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
|
100 ,) |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
101 touch '$$@' |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
102 endef |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
103 $(foreach PKG,$(PKG_RULES),$(eval $(call PKG_RULE,$(PKG),$(call TMP_DIR,$(PKG))))) |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
104 |
122
daa21345aa2a
implemented 'make strip'
Volker Grabsch <vog@notjusthosting.com>
parents:
121
diff
changeset
|
105 .PHONY: strip |
daa21345aa2a
implemented 'make strip'
Volker Grabsch <vog@notjusthosting.com>
parents:
121
diff
changeset
|
106 strip: |
daa21345aa2a
implemented 'make strip'
Volker Grabsch <vog@notjusthosting.com>
parents:
121
diff
changeset
|
107 rm -rf \ |
256 | 108 '$(PREFIX)/include' \ |
109 '$(PREFIX)/info' \ | |
110 '$(PREFIX)/lib/libiberty.a' \ | |
111 '$(PREFIX)/man' \ | |
112 '$(PREFIX)/share' \ | |
259
3221273ea6cb
remove also the etc/ directory on "make strip"
Volker Grabsch <vog@notjusthosting.com>
parents:
256
diff
changeset
|
113 '$(PREFIX)/$(TARGET)/etc' \ |
256 | 114 '$(PREFIX)/$(TARGET)/doc' \ |
115 '$(PREFIX)/$(TARGET)/info' \ | |
116 '$(PREFIX)/$(TARGET)/lib'/*.def \ | |
117 '$(PREFIX)/$(TARGET)/man' \ | |
118 '$(PREFIX)/$(TARGET)/sbin' \ | |
119 '$(PREFIX)/$(TARGET)/share' | |
299
9f5fdae25d77
portability fix for MacOS X: use more common options for the "strip" command
Volker Grabsch <vog@notjusthosting.com>
parents:
297
diff
changeset
|
120 -strip -Sx \ |
256 | 121 '$(PREFIX)/bin'/* \ |
122 '$(PREFIX)/libexec/gcc/$(TARGET)'/*/* \ | |
123 '$(PREFIX)/$(TARGET)/bin'/* | |
299
9f5fdae25d77
portability fix for MacOS X: use more common options for the "strip" command
Volker Grabsch <vog@notjusthosting.com>
parents:
297
diff
changeset
|
124 -$(TARGET)-strip -S \ |
256 | 125 '$(PREFIX)/lib/gcc/$(TARGET)'/*/*.a \ |
126 '$(PREFIX)/lib/gcc/$(TARGET)'/*/*.o \ | |
127 '$(PREFIX)/$(TARGET)/lib'/*.a \ | |
128 '$(PREFIX)/$(TARGET)/lib'/*.o | |
122
daa21345aa2a
implemented 'make strip'
Volker Grabsch <vog@notjusthosting.com>
parents:
121
diff
changeset
|
129 |
119
ff34f15ec142
improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents:
114
diff
changeset
|
130 .PHONY: clean |
ff34f15ec142
improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents:
114
diff
changeset
|
131 clean: |
ff34f15ec142
improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents:
114
diff
changeset
|
132 rm -rf $(call TMP_DIR,*) $(PREFIX)/* |
ff34f15ec142
improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents:
114
diff
changeset
|
133 |
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
|
134 .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
|
135 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
|
136 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
|
137 $(filter-out \ |
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
|
138 $(foreach PKG,$(PKG_RULES),$(PKG_DIR)/$($(PKG)_FILE)), \ |
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
|
139 $(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
|
140 |
119
ff34f15ec142
improved coding style
Volker Grabsch <vog@notjusthosting.com>
parents:
114
diff
changeset
|
141 .PHONY: update |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
142 define UPDATE |
306
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
143 $(if $(2), |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
144 $(info $(1): $(2)) |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
145 $(if $(filter $(2),$($(1)_VERSION)), |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
146 , |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
147 $(SED) 's/^\([^ ]*_VERSION *:=\).*/\1 $(2)/' -i '$(TOP_DIR)/src/$(1).mk' |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
148 $(MAKE) -f '$(MAKEFILE)' 'update-checksum-$(1)'), |
130
d7e4464a369d
show status information during 'make update'
Volker Grabsch <vog@notjusthosting.com>
parents:
123
diff
changeset
|
149 $(error Unable to update version number: $(1))) |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
150 |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
151 endef |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
152 update: |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
153 $(foreach PKG,$(PKG_RULES),$(call UPDATE,$(PKG),$(shell $($(PKG)_UPDATE)))) |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
154 |
306
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
155 update-checksum-%: |
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
156 $(call DOWNLOAD_PKG_ARCHIVE,$*) |
319
9a9cffd8a015
bugfix in the "update-checksum-%" target which is internally used by "make update"
Volker Grabsch <vog@notjusthosting.com>
parents:
316
diff
changeset
|
157 $(SED) 's/^\([^ ]*_CHECKSUM *:=\).*/\1 '"`$(call PKG_CHECKSUM,$*)`"'/' -i '$(TOP_DIR)/src/$*.mk' |
306
85ffa9259036
validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents:
305
diff
changeset
|
158 |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
159 .PHONY: dist |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
160 dist: |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
161 rm -rf 'mingw_cross_env-$(VERSION)' |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
162 mkdir 'mingw_cross_env-$(VERSION)' |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
163 mkdir 'mingw_cross_env-$(VERSION)/doc' |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
164 mkdir 'mingw_cross_env-$(VERSION)/src' |
213
faeb91c793f3
find the src/*.mk and doc/ files even when called from another directory, e.g. via "make -f /path/to/mingw_cross_env/Makefile"
Volker Grabsch <vog@notjusthosting.com>
parents:
212
diff
changeset
|
165 (cd '$(TOP_DIR)' && hg log -v --style changelog) >'mingw_cross_env-$(VERSION)/doc/ChangeLog' |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
166 ( \ |
353
94ba675f6705
renamed doc/README.html to doc/index.html
Volker Grabsch <vog@notjusthosting.com>
parents:
319
diff
changeset
|
167 $(SED) -n '1,/<!-- begin of package list -->/ p' '$(TOP_DIR)/doc/index.html' && \ |
278
6b9ea2440ba5
merge text documentation and website into an HTML documentation
Volker Grabsch <vog@notjusthosting.com>
parents:
275
diff
changeset
|
168 ($(foreach PKG,$(PKG_RULES), \ |
6b9ea2440ba5
merge text documentation and website into an HTML documentation
Volker Grabsch <vog@notjusthosting.com>
parents:
275
diff
changeset
|
169 echo ' <tr><td><a href="$($(PKG)_WEBSITE)">$(PKG)</a></td><td>$($(PKG)_VERSION)</td></tr>';)) && \ |
353
94ba675f6705
renamed doc/README.html to doc/index.html
Volker Grabsch <vog@notjusthosting.com>
parents:
319
diff
changeset
|
170 $(SED) -n '/<!-- end of package list -->/,$$ p' '$(TOP_DIR)/doc/index.html' \ |
359
e9fbffc4f48a
introduce placeholders for version number and target in the tutorial
Volker Grabsch <vog@notjusthosting.com>
parents:
353
diff
changeset
|
171 ) \ |
e9fbffc4f48a
introduce placeholders for version number and target in the tutorial
Volker Grabsch <vog@notjusthosting.com>
parents:
353
diff
changeset
|
172 | $(SED) 's,\(<span class="version">\)[^<]*\(</span>\),\1$(VERSION)\2,g' \ |
e9fbffc4f48a
introduce placeholders for version number and target in the tutorial
Volker Grabsch <vog@notjusthosting.com>
parents:
353
diff
changeset
|
173 | $(SED) 's,\(<span class="target">\)[^<]*\(</span>\),\1$(TARGET)\2,g' \ |
e9fbffc4f48a
introduce placeholders for version number and target in the tutorial
Volker Grabsch <vog@notjusthosting.com>
parents:
353
diff
changeset
|
174 >'$(TOP_DIR)/index.html' |
392
7231888a5658
screenshots for the docs (by Hans Bezemer)
Volker Grabsch <vog@notjusthosting.com>
parents:
391
diff
changeset
|
175 cp -p '$(TOP_DIR)/index.html' 'mingw_cross_env-$(VERSION)/doc/' |
7231888a5658
screenshots for the docs (by Hans Bezemer)
Volker Grabsch <vog@notjusthosting.com>
parents:
391
diff
changeset
|
176 cp -p '$(TOP_DIR)/doc'/screenshot-* 'mingw_cross_env-$(VERSION)/doc/' |
353
94ba675f6705
renamed doc/README.html to doc/index.html
Volker Grabsch <vog@notjusthosting.com>
parents:
319
diff
changeset
|
177 cd 'mingw_cross_env-$(VERSION)/doc' && lynx -dump -width 75 -nolist -force_html index.html >README |
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
|
178 cp -p '$(TOP_DIR)/Makefile' 'mingw_cross_env-$(VERSION)/' |
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
|
179 cp -p '$(TOP_DIR)/src'/*.mk 'mingw_cross_env-$(VERSION)/src/' |
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
|
180 cp -p '$(TOP_DIR)/src'/*.patch 'mingw_cross_env-$(VERSION)/src/' |
114
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
181 tar cvf - 'mingw_cross_env-$(VERSION)' | gzip -9 >'mingw_cross_env-$(VERSION).tar.gz' |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
182 rm -rf 'mingw_cross_env-$(VERSION)' |
771b6c26008d
completely rewritten from scratch as Makefile
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
183 |