1 | # $Id: Makefile 985 2004-01-11 22:52:03Z bird $
|
---|
2 | #
|
---|
3 | # Top level makefile.
|
---|
4 | #
|
---|
5 | # InnoTek Systemberatung GmbHconfidential
|
---|
6 | #
|
---|
7 | # Copyright (c) 2003 InnoTek Systemberatung GmbH
|
---|
8 | # Author: knut st. osmundsen <bird@anduin.net>
|
---|
9 | #
|
---|
10 | # All Rights Reserved
|
---|
11 | #
|
---|
12 |
|
---|
13 |
|
---|
14 | ###############################################################################
|
---|
15 | ## Global Variables
|
---|
16 | ## (D = no drive)
|
---|
17 | ###############################################################################
|
---|
18 | PWD := $(shell pwd)
|
---|
19 | PWDD := $(shell pwd|sed 's/^[a-zA-Z]://')
|
---|
20 | MAKEFILE = $(PWD)/Makefile
|
---|
21 |
|
---|
22 | ifndef BUILD_MODE
|
---|
23 | export BUILD_MODE=DEBUG
|
---|
24 | endif
|
---|
25 |
|
---|
26 | ifndef PATH_TOP
|
---|
27 | export PATH_TOP := $(PWD)
|
---|
28 | endif
|
---|
29 | ifndef PATH_TOPD
|
---|
30 | export PATH_TOPD := $(PWDD)
|
---|
31 | endif
|
---|
32 |
|
---|
33 |
|
---|
34 | export PATH_BIN = $(PATH_TOP)/bin/$(BUILD_PLATFORM)/$(BUILD_MODE)
|
---|
35 | export PATH_BIND = $(PATH_TOPD)/bin/$(BUILD_PLATFORM)/$(BUILD_MODE)
|
---|
36 | export PATH_OBJ = $(PATH_TOP)/obj/$(BUILD_PLATFORM)/$(BUILD_MODE)
|
---|
37 | export PATH_OBJD = $(PATH_TOPD)/obj/$(BUILD_PLATFORM)/$(BUILD_MODE)
|
---|
38 | export PATH_BUILTTOOLS = $(PATH_OBJ)/builttools
|
---|
39 | export PATH_BUILTTOOLSD= $(PATH_OBJD)/builttools
|
---|
40 | PATH_BUILTTOOLS_TMP = $(PATH_OBJ)/builttools.tmp
|
---|
41 | PATH_BUILTTOOLS_TMPD = $(PATH_OBJD)/builttools.tmp
|
---|
42 |
|
---|
43 | # Debug info or not (when ever we feel like passing down such options).
|
---|
44 | # Several ways to do this it seems.
|
---|
45 | ifeq "$(BUILD_MODE)" "RELEASE"
|
---|
46 | BUILD_DEBUGINFO = -s
|
---|
47 | BUILD_ENABLE_SYMBOLS = --disable-symbols
|
---|
48 | BUILD_OPTIMIZE = -O2 -mcpu=pentium -mpreferred-stack-boundary=2 -malign-strings=0 -falign-loops=2 -falign-jumps=2 -falign-functions=2
|
---|
49 | else
|
---|
50 | BUILD_OPTIMIZE = -O0
|
---|
51 | BUILD_DEBUGINFO = -g
|
---|
52 | BUILD_ENABLE_SYMBOLS = --enable-symbols
|
---|
53 | endif
|
---|
54 |
|
---|
55 |
|
---|
56 | # Version and CVS defines
|
---|
57 | export GCC_VERSION ?= 3.2.2
|
---|
58 | export GCC_VERSION_SHORT ?= 3022
|
---|
59 | export GCC_CVS_VENDOR ?= GNU
|
---|
60 | export GCC_CVS_REL ?= GCC_3-2-2
|
---|
61 | export BINUTILS_VERSION ?= 2.14
|
---|
62 | export BINUTILS_VERSION_SHORT ?= 214
|
---|
63 | export BINUTILS_CVS_VENDOR ?= GNU
|
---|
64 | export BINUTILS_CVS_REL ?= BINUTILS_2-14
|
---|
65 | export EMX_VERSION ?= 0.9d-fix04
|
---|
66 | export EMX_VERSION_SHORT ?= 9d04
|
---|
67 | export EMX_CVS_VENDOR ?= EMX
|
---|
68 | export EMX_CVS_REL ?= EMX_0-9D-FIX04
|
---|
69 |
|
---|
70 | # innotek version and timestamp
|
---|
71 | export INNOTEK_VERSION ?= (Innotek Build $(shell date '+%Y-%m-%d %H:%M'))
|
---|
72 |
|
---|
73 |
|
---|
74 | #
|
---|
75 | # For builds on Linux Host builds we do the environment setup here.
|
---|
76 | # This is essentially a mimicking of what we do on OS/2.
|
---|
77 | #
|
---|
78 | ifndef BUILD_PLATFORM
|
---|
79 | ifeq "$(shell uname -s)" "Linux"
|
---|
80 | export BUILD_PLATFORM ?= LINUX
|
---|
81 | export BUILD_PROJECT ?= GCCOS2
|
---|
82 | export SH ?= /bin/sh
|
---|
83 | export ASH ?= /bin/ash
|
---|
84 | export BASH ?= /bin/bash
|
---|
85 | export AWK ?= /bin/gawk
|
---|
86 | export GAWK ?= /bin/gawk
|
---|
87 | export CONFIG_SHELL ?= $(SH)
|
---|
88 | export MAKESHELL ?= $(SH)
|
---|
89 | export PATH_EMX ?= /usr
|
---|
90 | export PATH_EMXPGCC ?= /usr
|
---|
91 | export TMP ?= /tmp
|
---|
92 | export TMPDIR ?= /tmp
|
---|
93 | endif
|
---|
94 | endif
|
---|
95 |
|
---|
96 |
|
---|
97 |
|
---|
98 | # Misc Helpers
|
---|
99 | ALL_PREFIX = $(PATH_BIND)/$(GCC_VERSION)/usr
|
---|
100 | TOOL_CVS_DIFF_TREE = -cvs diff -R -N -w -u -r
|
---|
101 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
102 | NICE = nice -i
|
---|
103 | else
|
---|
104 | NICE =
|
---|
105 | endif
|
---|
106 |
|
---|
107 |
|
---|
108 |
|
---|
109 |
|
---|
110 | ###############################################################################
|
---|
111 | ###############################################################################
|
---|
112 | ###############################################################################
|
---|
113 | ###############################################################################
|
---|
114 | #
|
---|
115 | # M a i n R u l e z
|
---|
116 | #
|
---|
117 | ###############################################################################
|
---|
118 | ###############################################################################
|
---|
119 | ###############################################################################
|
---|
120 | ###############################################################################
|
---|
121 | all:
|
---|
122 | mkdir -p $(PATH_OBJ)
|
---|
123 | $(NICE) $(MAKE) $(MAKEOPT) -j 1 -C . all-logged 2>&1 | $(UNIXROOT)/usr/bin/tee $(PATH_OBJ)/build-`date +"%Y%m%d-%H%M%S"`.log
|
---|
124 |
|
---|
125 | all-logged: \
|
---|
126 | all-banner-start \
|
---|
127 | all-env \
|
---|
128 | all-sanity \
|
---|
129 | all-preload \
|
---|
130 | all-versionstamps \
|
---|
131 | all-symlinks \
|
---|
132 | \
|
---|
133 | all-stage1 \
|
---|
134 | all-stage2 \
|
---|
135 | \
|
---|
136 | all-install \
|
---|
137 | \
|
---|
138 | all-symlinks-unlink
|
---|
139 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
140 | @echo "+ Make Ended Successfully: $(shell date)"
|
---|
141 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
142 |
|
---|
143 | #
|
---|
144 | # banners
|
---|
145 | #
|
---|
146 |
|
---|
147 | all-banner-start:
|
---|
148 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
149 | @echo "+ Make started: $(shell date)"
|
---|
150 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
151 |
|
---|
152 | all-banner-stage1:
|
---|
153 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
154 | @echo "+ Stage 1 - starting: $(shell date)"
|
---|
155 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
156 |
|
---|
157 | all-banner-stage2:
|
---|
158 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
159 | @echo "+ Stage 2 - starting: $(shell date)"
|
---|
160 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
161 |
|
---|
162 | all-banner-builttools-initial:
|
---|
163 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
164 | @echo "+ Initializing builttools tree"
|
---|
165 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
166 |
|
---|
167 | all-banner-builttools-stage2:
|
---|
168 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
169 | @echo "+ Copying stage2 builttools"
|
---|
170 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
171 |
|
---|
172 | all-banner-install:
|
---|
173 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
174 | @echo "+ Install - starting: $(shell date)"
|
---|
175 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
176 |
|
---|
177 | all-banner-install-done:
|
---|
178 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
179 | @echo "+ Install - done: $(shell date)"
|
---|
180 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
181 |
|
---|
182 | all-banner-symlinks-start:
|
---|
183 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
184 | @echo "+ symlinks - staring: $(shell date)"
|
---|
185 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
186 |
|
---|
187 | all-banner-symlinks-done:
|
---|
188 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
189 | @echo "+ symlinks - done: $(shell date)"
|
---|
190 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
191 |
|
---|
192 | all-banner-symlinks-unlink-start:
|
---|
193 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
194 | @echo "+ symlinks unlinking - staring: $(shell date)"
|
---|
195 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
196 |
|
---|
197 | all-banner-symlinks-unlink-done:
|
---|
198 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
199 | @echo "+ symlinks unlinking - done: $(shell date)"
|
---|
200 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
201 |
|
---|
202 |
|
---|
203 | #
|
---|
204 | # Sanity and environment dumps - to make it easier to figure out make bugs.
|
---|
205 | #
|
---|
206 |
|
---|
207 | all-env:
|
---|
208 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
209 | @echo "Variables:"
|
---|
210 | @echo " PWD = $(PWD)"
|
---|
211 | @echo " PWDD = $(PWDD)"
|
---|
212 | @echo " PATH_TOP = $(PATH_TOP)"
|
---|
213 | @echo " PATH_TOPD = $(PATH_TOPD)"
|
---|
214 | @echo " PATH_OBJ = $(PATH_OBJ)"
|
---|
215 | @echo " PATH_OBJD = $(PATH_OBJD)"
|
---|
216 | @echo " PATH_BIN = $(PATH_BIN)"
|
---|
217 | @echo " PATH_BIND = $(PATH_BIND)"
|
---|
218 | @echo " ALL_PREFIX = $(ALL_PREFIX)"
|
---|
219 | @echo " PATH_EMXPGCC = $(PATH_EMXPGCC)"
|
---|
220 | @echo " PATH_EMX = $(PATH_EMX)"
|
---|
221 | @echo " BUILD_MODE = $(BUILD_MODE)"
|
---|
222 | @echo " BUILD_PLATFORM = $(BUILD_PLATFORM)"
|
---|
223 | @echo " BUILD_PROJECT = $(BUILD_PROJECT)"
|
---|
224 | @echo " GCC_VERSION = $(GCC_VERSION)"
|
---|
225 | @echo " GCC_VERSION_SHORT = $(GCC_VERSION_SHORT)"
|
---|
226 | @echo " GCC_CVS_VENDOR = $(GCC_CVS_VENDOR)"
|
---|
227 | @echo " GCC_CVS_REL = $(GCC_CVS_REL)"
|
---|
228 | @echo " BINUTILS_VERSION = $(BINUTILS_VERSION)"
|
---|
229 | @echo " BINUTILS_VERSION_SHORT = $(BINUTILS_VERSION_SHORT)"
|
---|
230 | @echo " BINUTILS_CVS_VENDOR = $(BINUTILS_CVS_VENDOR)"
|
---|
231 | @echo " BINUTILS_CVS_REL = $(BINUTILS_CVS_REL)"
|
---|
232 | @echo " EMX_VERSION = $(EMX_VERSION)"
|
---|
233 | @echo " EMX_VERSION_SHORT = $(EMX_VERSION_SHORT)"
|
---|
234 | @echo " EMX_CVS_VENDOR = $(EMX_CVS_VENDOR)"
|
---|
235 | @echo " EMX_CVS_REL = $(EMX_CVS_REL)"
|
---|
236 | @echo " MAKEFILE = $(MAKEFILE)"
|
---|
237 | @echo " UNIXROOT = $(UNIXROOT)"
|
---|
238 | @echo " AC_PREFIX = $(AC_PREFIX)"
|
---|
239 | @echo " AC_MACRODIR = $(AC_MACRODIR)"
|
---|
240 | @echo " HOSTNAME = $(HOSTNAME)"
|
---|
241 | @echo " USER = $(USER)"
|
---|
242 | @echo " LOGNAME = $(LOGNAME)"
|
---|
243 | @echo " TMP = $(TMP)"
|
---|
244 | @echo " TMPDIR = $(TMPDIR)"
|
---|
245 | @echo " USER = $(USER)"
|
---|
246 | @echo " AWK = $(AWK)"
|
---|
247 | @echo " GAWK = $(GAWK)"
|
---|
248 | @echo " SH = $(SH)"
|
---|
249 | @echo " ASH = $(ASH)"
|
---|
250 | @echo " BASH = $(BASH)"
|
---|
251 | @echo " CONFIG_SHELL = $(CONFIG_SHELL)"
|
---|
252 | @echo " MAKESHELL = $(MAKESHELL)"
|
---|
253 | @echo " EMXSHELL = $(EMXSHELL)"
|
---|
254 | @echo " SHELL = $(SHELL)"
|
---|
255 | @echo " MAKE = $(MAKE)"
|
---|
256 | @echo " MAKEOPT = $(MAKEOPT)"
|
---|
257 | @echo " PATH = $(PATH)"
|
---|
258 | @echo " C_INCLUDE_PATH = $(C_INCLUDE_PATH)"
|
---|
259 | @echo " CPLUS_INCLUDE_PATH = $(CPLUS_INCLUDE_PATH)"
|
---|
260 | @echo " OBJC_INCLUDE_PATH = $(OBJC_INCLUDE_PATH)"
|
---|
261 | @echo " LIBRARY_PATH = $(LIBRARY_PATH)"
|
---|
262 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
263 | @echo "Content of PATH_OBJ:"
|
---|
264 | -ls -la $(PATH_OBJ)/
|
---|
265 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
266 | @echo "Content of PATH_BIN:"
|
---|
267 | -ls -la $(PATH_BIN)/
|
---|
268 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
269 |
|
---|
270 |
|
---|
271 | all-sanity:
|
---|
272 | @echo -n "Checking build environment sanity... "
|
---|
273 | @if [ "x$(BUILD_PROJECT)" != "xGCCOS2" ]; then \
|
---|
274 | echo ""; echo "Error: BUILD_PROJECT is wrong or isn't defined!"; \
|
---|
275 | exit 8; \
|
---|
276 | fi
|
---|
277 | @if [ "x$(BUILD_PLATFORM)" != "xOS2" -a "x$(BUILD_PLATFORM)" != "xLINUX" ]; then \
|
---|
278 | echo ""; echo "Error: BUILD_PLATFORM is wrong or isn't defined!"; \
|
---|
279 | exit 8; \
|
---|
280 | fi
|
---|
281 | @if [ "x$(BUILD_PLATFORM)" = "xOS2" -a "x$(UNIXROOT)" = "x" ]; then \
|
---|
282 | echo ""; echo "Error: UNIXROOT isn't defined!"; \
|
---|
283 | exit 8; \
|
---|
284 | fi
|
---|
285 | @if [ "x$(BUILD_PLATFORM)" != "xOS2" -a "x$(UNIXROOT)" != "x" ]; then \
|
---|
286 | echo ""; echo "Error: UNIXROOT is defined!"; \
|
---|
287 | exit 8; \
|
---|
288 | fi
|
---|
289 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
290 | @if gcc --version | grep -qe ".*[3]\.[2-9]\.[0-9]"; then \
|
---|
291 | true; \
|
---|
292 | else \
|
---|
293 | echo ""; echo "Warning: GCC v3.2.x or higher is recommended!"; \
|
---|
294 | fi
|
---|
295 | @if ar --version | grep -qe ".*2\.11\.[2-9]" -e ".*[2]\.1[2-9]\.[0-9]*"; then \
|
---|
296 | true; \
|
---|
297 | else \
|
---|
298 | echo ""; echo "Warning: AR v2.11.2 or higher is recommended!"; \
|
---|
299 | fi
|
---|
300 | endif
|
---|
301 | @echo "ok"
|
---|
302 |
|
---|
303 |
|
---|
304 | #
|
---|
305 | # Preload tools we commonly use this speeds up stuff.
|
---|
306 | #
|
---|
307 | PRELOADED_TOOLS = bin/sh.exe bin/echo.exe bin/true.exe usr/bin/test.exe usr/bin/expr.exe \
|
---|
308 | usr/bin/gawk.exe usr/bin/sed.exe bin/rm.exe bin/cat.exe bin/cp.exe
|
---|
309 |
|
---|
310 | all-preload:
|
---|
311 | @echo "Preloading tools:"
|
---|
312 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
313 | @for tool in $(PRELOADED_TOOLS); do \
|
---|
314 | echo -n " $$tool"; \
|
---|
315 | emxload -e $(UNIXROOT)/$$tool; \
|
---|
316 | done
|
---|
317 | emxload -e gcc.exe g++.exe ld.exe as.exe ar.exe ld.exe
|
---|
318 | endif
|
---|
319 | @echo ""
|
---|
320 |
|
---|
321 | all-preload-unload:
|
---|
322 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
323 | emxload -qw
|
---|
324 | endif
|
---|
325 |
|
---|
326 |
|
---|
327 | #
|
---|
328 | # Version stamping/branding.
|
---|
329 | # Update various version strings which are printed from the tools to tell
|
---|
330 | # the build date and that's our built. This helps us tell releases apart.
|
---|
331 | #
|
---|
332 | # IMPORTANT! Take care not to commit the changed files
|
---|
333 | # (TODO! Try make these changes to non-cvs backed files. (long-term-goal))
|
---|
334 | .PHONY: all-versionstamps
|
---|
335 | all-versionstamps: $(PATH_OBJ)/.ts.versionstamped
|
---|
336 | $(PATH_OBJ)/.ts.versionstamped:
|
---|
337 | echo '#define INNOTEK_VERSION "$(INNOTEK_VERSION)"' > include/innotekversion.h
|
---|
338 | $(MAKE) $(MAKEOPT) -j 1 -f $(MAKEFILE) "INNOTEK_VERSION=$(INNOTEK_VERSION)" gcc-versionstamps binutils-versionstamps emx-versionstamps
|
---|
339 | mkdir -p $(@D)
|
---|
340 | touch $@
|
---|
341 |
|
---|
342 |
|
---|
343 | #
|
---|
344 | # Stages
|
---|
345 | # A rebuild with the new toolsuite is usually required when there is ABI
|
---|
346 | # changes and other vital changes done to the tools.
|
---|
347 | #
|
---|
348 |
|
---|
349 | all-stage1: $(PATH_OBJ)/.all-stage1
|
---|
350 | $(PATH_OBJ)/.all-stage1:
|
---|
351 | $(MAKE) $(MAKEOPT) -j 1 -f $(MAKEFILE) all-stage1-it
|
---|
352 | echo "$(@F)" > $(PATH_OBJ)/.last-stage
|
---|
353 | touch $@
|
---|
354 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
355 | @echo "+ Stage 1 - done: $(shell date)"
|
---|
356 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
357 |
|
---|
358 | all-stage1-it: \
|
---|
359 | all-banner-stage1 \
|
---|
360 | all-builttools-initial \
|
---|
361 | all-binutils \
|
---|
362 | all-gcc \
|
---|
363 | all-emx
|
---|
364 |
|
---|
365 |
|
---|
366 | all-stage2: $(PATH_OBJ)/.all-stage2
|
---|
367 | $(PATH_OBJ)/.all-stage2: \
|
---|
368 | $(PATH_OBJ)/.all-stage2.save-stage1
|
---|
369 | $(MAKE) $(MAKEOPT) -j 1 -f $(MAKEFILE) all-stage2-it
|
---|
370 | echo "$(@F)" > $(PATH_OBJ)/.last-stage
|
---|
371 | touch $@
|
---|
372 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
373 | @echo "+ Stage 2 - done: $(shell date)"
|
---|
374 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
375 |
|
---|
376 | $(PATH_OBJ)/.all-stage2.save-stage1:
|
---|
377 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
378 | @echo "+ Saving Stage 1 - Starting: $(shell date)"
|
---|
379 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
380 | $(MAKE) $(MAKEOPT) -j 1 -f $(MAKEFILE) all-preload-unload
|
---|
381 | $(MAKE) $(MAKEOPT) -j 1 -f $(MAKEFILE) all-builttools-stage2
|
---|
382 | rm -Rf $(PATH_OBJ)/stage1
|
---|
383 | mkdir -p $(PATH_OBJ)/stage1
|
---|
384 | if [ -d $(PATH_OBJ)/gcc ] ; then mv $(PATH_OBJ)/gcc $(PATH_OBJ)/stage1/gcc; fi
|
---|
385 | if [ -d $(PATH_OBJ)/emx ] ; then mv $(PATH_OBJ)/emx $(PATH_OBJ)/stage1/emx; fi
|
---|
386 | if [ -d $(PATH_TOP)/src/emx/out ] ; then mv $(PATH_TOP)/src/emx/out $(PATH_OBJ)/stage1/emx_out; fi
|
---|
387 | $(MAKE) $(MAKEOPT) -j 1 -f $(MAKEFILE) all-preload
|
---|
388 | touch $@
|
---|
389 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
390 | @echo "+ Saving Stage 1 - done: $(shell date)"
|
---|
391 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
---|
392 |
|
---|
393 | all-stage2-it: \
|
---|
394 | all-banner-stage2 \
|
---|
395 | all-binutils \
|
---|
396 | all-gcc \
|
---|
397 | all-emx
|
---|
398 |
|
---|
399 |
|
---|
400 | #
|
---|
401 | # Install to bin tree makeing it ready for packing.
|
---|
402 | #
|
---|
403 | all-install: \
|
---|
404 | all-banner-install \
|
---|
405 | gcc-install \
|
---|
406 | emx-install \
|
---|
407 | misc-install \
|
---|
408 | all-banner-install-done \
|
---|
409 |
|
---|
410 |
|
---|
411 | #
|
---|
412 | # Generate all the diffs we have to supply.
|
---|
413 | #
|
---|
414 | all-diff: \
|
---|
415 | gcc-diff \
|
---|
416 | binutils-diff \
|
---|
417 | emx-diff \
|
---|
418 |
|
---|
419 |
|
---|
420 |
|
---|
421 |
|
---|
422 |
|
---|
423 |
|
---|
424 | ###############################################################################
|
---|
425 | ###############################################################################
|
---|
426 | ###############################################################################
|
---|
427 | #
|
---|
428 | # B u i l t T o o l s
|
---|
429 | #
|
---|
430 | ###############################################################################
|
---|
431 | ###############################################################################
|
---|
432 | ###############################################################################
|
---|
433 | .PHONY: all-builttools-initial all-builttools-dirs all-builttools-clean all-builttools-stage2
|
---|
434 |
|
---|
435 | all-builttools-initial: \
|
---|
436 | all-banner-builttools-initial \
|
---|
437 | all-builttools-clean \
|
---|
438 | all-builttools-dirs \
|
---|
439 | $(PATH_BUILTTOOLS)/bin/dllar.cmd \
|
---|
440 | $(PATH_BUILTTOOLS)/omfhack/ar.exe \
|
---|
441 | $(PATH_BUILTTOOLS)/omfhack/realar.exe \
|
---|
442 | $(PATH_BUILTTOOLS)/omfhack/ranlib.exe
|
---|
443 |
|
---|
444 | all-builttools-clean: \
|
---|
445 | all-preload-unload
|
---|
446 | rm -Rf $(PATH_BUILTTOOLS)
|
---|
447 |
|
---|
448 | all-builttools-dirs:
|
---|
449 | mkdir -p $(PATH_BUILTTOOLS)/bin $(PATH_BUILTTOOLS)/lib $(PATH_BUILTTOOLS)/include $(PATH_BUILTTOOLS)/omfhack
|
---|
450 |
|
---|
451 | $(PATH_BUILTTOOLS)/bin/dllar.cmd $(PATH_BUILTTOOLS_TMP)/bin/dllar.cmd: $(PATH_TOP)/src/misc/dllar.cmd
|
---|
452 | cp $< $@
|
---|
453 | $(PATH_BUILTTOOLS)/omfhack/ranlib.exe $(PATH_BUILTTOOLS_TMP)/omfhack/ranlib.exe: $(PATH_TOP)/tools/bin/true.exe
|
---|
454 | cp $< $@
|
---|
455 | $(PATH_BUILTTOOLS)/omfhack/ar.exe: $(PATH_EMXPGCC)/bin/emxomfar.exe
|
---|
456 | cp $< $@
|
---|
457 | $(PATH_BUILTTOOLS_TMP)/omfhack/ar.exe: $(PATH_BUILTTOOLS_TMP)/bin/emxomfar.exe
|
---|
458 | cp $< $@
|
---|
459 | $(PATH_BUILTTOOLS)/omfhack/realar.exe $(PATH_BUILTTOOLS_TMP)/omfhack/realar.exe: $(PATH_EMXPGCC)/bin/ar.exe
|
---|
460 | cp $< $@
|
---|
461 | $(PATH_BUILTTOOLS_TMP)/omfhack:
|
---|
462 | mkdir -p $@
|
---|
463 |
|
---|
464 | all-builttools-stage2: \
|
---|
465 | all-banner-builttools-stage2 \
|
---|
466 | gcc-builttools-stage2 \
|
---|
467 | emx-builttools-stage2 \
|
---|
468 | all-builttools-stage2-libs \
|
---|
469 | $(PATH_BUILTTOOLS_TMP)/bin/dllar.cmd \
|
---|
470 | $(PATH_BUILTTOOLS_TMP)/omfhack \
|
---|
471 | $(PATH_BUILTTOOLS_TMP)/omfhack/ar.exe \
|
---|
472 | $(PATH_BUILTTOOLS_TMP)/omfhack/realar.exe \
|
---|
473 | $(PATH_BUILTTOOLS_TMP)/omfhack/ranlib.exe \
|
---|
474 | all-builttools-clean
|
---|
475 | mv -f $(PATH_BUILTTOOLS_TMP) $(PATH_BUILTTOOLS)
|
---|
476 |
|
---|
477 | all-builttools-stage2-libs:
|
---|
478 | -for aoutlib in `find $(PATH_BUILTTOOLS_TMP) -name "*.a" | sed -e 's/\.a$$//' `; \
|
---|
479 | do \
|
---|
480 | if [ ! -f $(aoutlib).lib ]; then \
|
---|
481 | echo " $${aoutlib}"; \
|
---|
482 | $(PATH_BUILTTOOLS_TMP)/bin/emxomf.exe -p256 $${aoutlib}.a; \
|
---|
483 | fi;\
|
---|
484 | done
|
---|
485 |
|
---|
486 |
|
---|
487 | ###############################################################################
|
---|
488 | ###############################################################################
|
---|
489 | ###############################################################################
|
---|
490 | #
|
---|
491 | # S y m l i n k s
|
---|
492 | #
|
---|
493 | #
|
---|
494 | # We use symlinking of binutils stuff into the gcc tree so we can
|
---|
495 | # build everything in one go and take advantage of the gcc
|
---|
496 | # makesystem which will use the binutils we built when doing the
|
---|
497 | # gcc libraries and such.
|
---|
498 | #
|
---|
499 | # On OS/2 symlinks doesn't exist so, we'll copy the source trees.
|
---|
500 | # Copy because this will for directories work ok with cvs, moving
|
---|
501 | # directories would cause 'cvs update -d' to refetch stuff.
|
---|
502 | #
|
---|
503 | # IMPORTANT! Take care, the 'symlined' stuff will be removed at the
|
---|
504 | # end of the build. Remeber to do all-symlinks-unlink before a fresh
|
---|
505 | # build is started as the duplicated binutils things doesn't get
|
---|
506 | # updated by cvs.
|
---|
507 | #
|
---|
508 | #
|
---|
509 | #w##############################################################################
|
---|
510 | ###############################################################################
|
---|
511 | ###############################################################################
|
---|
512 | all-symlinks: \
|
---|
513 | all-banner-symlinks-start \
|
---|
514 | all-symlinks-binutils \
|
---|
515 | all-banner-symlinks-done
|
---|
516 |
|
---|
517 | all-symlinks-unlink: \
|
---|
518 | all-banner-symlinks-unlink-start \
|
---|
519 | all-symlinks-unlink-binutils \
|
---|
520 | all-banner-symlinks-unlink-done
|
---|
521 |
|
---|
522 |
|
---|
523 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
524 | TOOL_SYMLINK_FILE = cp -p
|
---|
525 | TOOL_SYMLINK_DIR = cp -pRf
|
---|
526 | TOOL_SYMLINK_MKDIR = mkdir
|
---|
527 | TOOL_UNSYMLINK_DIR = rm -Rf
|
---|
528 | else
|
---|
529 | TOOL_SYMLINK_FILE = ln -fs
|
---|
530 | TOOL_SYMLINK_DIR = ln -fs
|
---|
531 | TOOL_SYMLINK_MKDIR = true
|
---|
532 | TOOL_UNSYMLINK_DIR = rm
|
---|
533 | endif
|
---|
534 |
|
---|
535 | # ld is broken, so don't use it!
|
---|
536 | # ld \
|
---|
537 |
|
---|
538 | SYMLINKS_BINUTILS_TO_GCC_DIRS = \
|
---|
539 | bfd \
|
---|
540 | binutils \
|
---|
541 | etc \
|
---|
542 | gas \
|
---|
543 | gprof \
|
---|
544 | intl \
|
---|
545 | opcodes \
|
---|
546 | texinfo \
|
---|
547 | libiberty \
|
---|
548 | include/aout \
|
---|
549 | include/coff \
|
---|
550 | include/elf \
|
---|
551 | include/gdb \
|
---|
552 | include/mpw \
|
---|
553 | include/nlm \
|
---|
554 | include/opcode \
|
---|
555 | include/regs \
|
---|
556 |
|
---|
557 | SYMLINKS_BINUTILS_TO_GCC_FILES = \
|
---|
558 | include/alloca-conf.h \
|
---|
559 | include/ansidecl.h \
|
---|
560 | include/bfdlink.h \
|
---|
561 | include/bin-bugs.h \
|
---|
562 | include/bout.h \
|
---|
563 | include/ChangeLog \
|
---|
564 | include/COPYING \
|
---|
565 | include/demangle.h \
|
---|
566 | include/dis-asm.h \
|
---|
567 | include/dyn-string.h \
|
---|
568 | include/fibheap.h \
|
---|
569 | include/filenames.h \
|
---|
570 | include/floatformat.h \
|
---|
571 | include/fnmatch.h \
|
---|
572 | include/fopen-bin.h \
|
---|
573 | include/fopen-same.h \
|
---|
574 | include/fopen-vms.h \
|
---|
575 | include/gdbm.h \
|
---|
576 | include/getopt.h \
|
---|
577 | include/hashtab.h \
|
---|
578 | include/hp-symtab.h \
|
---|
579 | include/ieee.h \
|
---|
580 | include/libiberty.h \
|
---|
581 | include/MAINTAINERS \
|
---|
582 | include/md5.h \
|
---|
583 | include/oasys.h \
|
---|
584 | include/objalloc.h \
|
---|
585 | include/obstack.h \
|
---|
586 | include/os9k.h \
|
---|
587 | include/partition.h \
|
---|
588 | include/progress.h \
|
---|
589 | include/safe-ctype.h \
|
---|
590 | include/sort.h \
|
---|
591 | include/splay-tree.h \
|
---|
592 | include/symcat.h \
|
---|
593 | include/ternary.h \
|
---|
594 | include/xregex.h \
|
---|
595 | include/xregex2.h \
|
---|
596 | include/xtensa-config.h \
|
---|
597 | include/xtensa-isa-internal.h \
|
---|
598 | include/xtensa-isa.h \
|
---|
599 |
|
---|
600 |
|
---|
601 | # Symlink binutils stuff to gcc.
|
---|
602 | # Note the test should've been "! -e", but that doesn' work in ash... :/
|
---|
603 | all-symlinks-binutils:
|
---|
604 | for file in $(SYMLINKS_BINUTILS_TO_GCC_FILES); do \
|
---|
605 | if [ ! -f "$(PATH_TOP)/src/gcc/.symlinked.`echo $${file} | sed -e 's@/@_@g'`" ]; then \
|
---|
606 | echo symlinking file src/gcc/$${file} to src/binutils/$${file} ; \
|
---|
607 | if rm -f $(PATH_TOP)/src/gcc/$$file && \
|
---|
608 | $(TOOL_SYMLINK_FILE) $(PATH_TOP)/src/binutils/$$file $(PATH_TOP)/src/gcc/$$file && \
|
---|
609 | touch $(PATH_TOP)/src/gcc/.symlinked.`echo $${file} | sed -e 's@/@_@g'`; \
|
---|
610 | then true ; \
|
---|
611 | else exit 1; \
|
---|
612 | fi ; \
|
---|
613 | fi ; \
|
---|
614 | done
|
---|
615 | for dir in $(SYMLINKS_BINUTILS_TO_GCC_DIRS) ; do \
|
---|
616 | if [ ! -f "$(PATH_TOP)/src/gcc/.symlinked.`echo $${dir} | sed -e 's@/@_@g'`" ] ; then \
|
---|
617 | echo symlinking directory src/gcc/$${dir} to src/binutils/$${dir} ; \
|
---|
618 | if [ -d "$(PATH_TOP)/src/gcc/$$dir" ] ; then \
|
---|
619 | echo removing existing directory: $${dir} ; \
|
---|
620 | rm -Rf $(PATH_TOP)/src/gcc/$$dir ; \
|
---|
621 | fi ; \
|
---|
622 | if $(TOOL_SYMLINK_MKDIR) $(PATH_TOP)/src/gcc/$$dir && \
|
---|
623 | $(TOOL_SYMLINK_DIR) $(PATH_TOP)/src/binutils/$$dir $(PATH_TOP)/src/gcc/`echo $${dir}| sed -e '/\//!d' -e 's@\([a-zA-z0-9]*\)/.*@\1/@'` ; \
|
---|
624 | touch $(PATH_TOP)/src/gcc/.symlinked.`echo $${dir} | sed -e 's@/@_@g'` ; \
|
---|
625 | then true ; \
|
---|
626 | else exit 1; \
|
---|
627 | fi ; \
|
---|
628 | fi ; \
|
---|
629 | done
|
---|
630 | -ls -a1 src/gcc/.sym*
|
---|
631 |
|
---|
632 | all-symlinks-unlink-binutils:
|
---|
633 | for name in `ls src/gcc/.symlinked* | sed -e "s/.*\.symlinked.//" -e "s/_/\//g"`; do \
|
---|
634 | echo unlinking $${name} ; \
|
---|
635 | if [ -d "$(PATH_TOP)/src/gcc/$${name}" ] ; then \
|
---|
636 | rm -Rf $(PATH_TOP)/src/gcc/$${name} ; \
|
---|
637 | else \
|
---|
638 | rm -f $(PATH_TOP)/src/gcc/$${name} ; \
|
---|
639 | fi ; \
|
---|
640 | if [ ! -f "$(PATH_TOP)/src/gcc/$${name}" -a ! -d "$(PATH_TOP)/src/gcc/$${name}" ] ; then \
|
---|
641 | rm $(PATH_TOP)/src/gcc/.symlinked.`echo $${name} | sed -e 's@/@_@g'` ; \
|
---|
642 | else \
|
---|
643 | echo "unlink error: $(PATH_TOP)/src/gcc/$${name} exist" ; \
|
---|
644 | ls -l "$(PATH_TOP)/src/gcc/$${name}" ; \
|
---|
645 | exit 1; \
|
---|
646 | fi ; \
|
---|
647 | done
|
---|
648 | -ls -a1 src/gcc/.sym*
|
---|
649 |
|
---|
650 |
|
---|
651 | ###############################################################################
|
---|
652 | ###############################################################################
|
---|
653 | ###############################################################################
|
---|
654 | #
|
---|
655 | # G C C
|
---|
656 | #
|
---|
657 | ###############################################################################
|
---|
658 | ###############################################################################
|
---|
659 | ###############################################################################
|
---|
660 | all-gcc gcc: \
|
---|
661 | gcc-autoconf-refresh \
|
---|
662 | gcc-build
|
---|
663 | echo "Successfully build GCC."
|
---|
664 |
|
---|
665 |
|
---|
666 |
|
---|
667 | GCC_DIRS = \
|
---|
668 | gcc/libiberty \
|
---|
669 | gcc/zlib \
|
---|
670 | gcc/gcc \
|
---|
671 | gcc/libstdc++-v3 \
|
---|
672 | gcc/boehm-gc \
|
---|
673 | gcc/fastjar \
|
---|
674 | gcc/libf2c \
|
---|
675 | gcc/libf2c/libF77 \
|
---|
676 | gcc/libf2c/libI77 \
|
---|
677 | gcc/libf2c/libU77 \
|
---|
678 | gcc/libffi \
|
---|
679 | gcc/libjava \
|
---|
680 | gcc/libjava/libltdl \
|
---|
681 | gcc/libobjc \
|
---|
682 |
|
---|
683 | # Here is a problem, we can't regenerate binutils makefiles when symlinked into
|
---|
684 | # gcc. At least not yet. The result is messed up severely.
|
---|
685 | not_yet =\
|
---|
686 | gcc/bfd \
|
---|
687 | gcc/binutils \
|
---|
688 | gcc/gas \
|
---|
689 | gcc/gprof \
|
---|
690 | gcc/intl \
|
---|
691 | gcc/ld \
|
---|
692 | gcc/libiberty \
|
---|
693 | gcc/opcodes \
|
---|
694 |
|
---|
695 | GCC_CONFIGURE_DIRS = $(GCC_DIRS)
|
---|
696 |
|
---|
697 |
|
---|
698 | # configure.in/configure
|
---|
699 | .PHONY: gcc-autoconf-refresh gcc-autoconf-rerun gcc-autoconf-clean gcc-autoconf-remove
|
---|
700 | gcc-autoconf-refresh gcc-autoconf-rerun gcc-autoconf-clean gcc-autoconf-remove:
|
---|
701 | ifeq "$(BUILD_PLATFORM)" "LINUX"
|
---|
702 | -$(SH) $(PATH_TOP)/xfix.sh
|
---|
703 | endif
|
---|
704 | for dir in $(GCC_CONFIGURE_DIRS); do \
|
---|
705 | if $(MAKE) $(MAKEOPT) -j 1 $(@:gcc-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; then \
|
---|
706 | true; \
|
---|
707 | else \
|
---|
708 | exit 8; \
|
---|
709 | fi \
|
---|
710 | done
|
---|
711 |
|
---|
712 |
|
---|
713 | # build the components.
|
---|
714 | .PHONY: gcc-build gcc-install gcc-configure
|
---|
715 | gcc-build gcc-install gcc-configure:
|
---|
716 | mkdir -p $(PATH_OBJ)/gcc
|
---|
717 | $(MAKE) $(MAKEOPT) -j 1 -C $(PATH_OBJ)/gcc -f $(MAKEFILE) $@-it
|
---|
718 |
|
---|
719 |
|
---|
720 | # When changed directory
|
---|
721 | # We pass down BOOT_ flags for stage2+.
|
---|
722 | # Because strip is broken on OS/2 we pass -s for release build and -g for
|
---|
723 | # non release builds - This overrides some stuff in src/gcc/gcc/config/i386/t-emx!
|
---|
724 | # For the 2nd stage we need a hack for using the right specs when linking...
|
---|
725 | #SPEC_HACK = $(if $(wildchar $(PATH_OBJ)/.all-stage1),\
|
---|
726 | # -specs $(PATH_TOP)/src/emx/src/lib/libc.specs, \
|
---|
727 | # -specs $(PATH_TOP)/tools/x86.os2/gcc/staged/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs)
|
---|
728 | SPECS_HACK =
|
---|
729 | gcc-build-it: \
|
---|
730 | $(PATH_OBJ)/gcc/.ts.configured
|
---|
731 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
732 | unset GCCLOAD ; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc \
|
---|
733 | LIBGCC2_DEBUG_CFLAGS="$(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem " \
|
---|
734 | CFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem" \
|
---|
735 | CXXFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem" \
|
---|
736 | BOOT_CFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem" \
|
---|
737 | LDFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf" \
|
---|
738 | BOOT_LDFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf" \
|
---|
739 | bootstrap
|
---|
740 | else
|
---|
741 | $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc bootstrap
|
---|
742 | endif
|
---|
743 |
|
---|
744 | # configure it (invoked after directory change).
|
---|
745 | # We set CC to help configure finding it.
|
---|
746 | # We also set some LDFLAGS to get omf linking.
|
---|
747 | gcc-configure-it $(PATH_OBJ)/gcc/.ts.configured: $(PATH_TOP)/src/gcc/configure
|
---|
748 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
749 | $(ASH) -c " \
|
---|
750 | export CC=\"gcc.exe\" ; \
|
---|
751 | export LDFLAGS=\"$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf\" ; \
|
---|
752 | export BOOT_LDFLAGS=\"$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf\" ; \
|
---|
753 | $< \
|
---|
754 | --enable-clh \
|
---|
755 | --enable-threads=os2 \
|
---|
756 | --enable-shared=libgcc,bfd,opcodes \
|
---|
757 | --enable-nls \
|
---|
758 | --without-included-gettext \
|
---|
759 | --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
|
---|
760 | --prefix=/gcc \
|
---|
761 | --with-gnu-ld \
|
---|
762 | --with-gnu-as \
|
---|
763 | --disable-libgcj \
|
---|
764 | --enable-languages=c,c++ "
|
---|
765 | else
|
---|
766 | $(ASH) -c "$< \
|
---|
767 | --disable-clh \
|
---|
768 | --enable-shared=libgcc,bfd,opcodes \
|
---|
769 | --enable-nls \
|
---|
770 | --without-included-gettext \
|
---|
771 | --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
|
---|
772 | --prefix=/gcc \
|
---|
773 | --with-gnu-ld \
|
---|
774 | --with-gnu-as \
|
---|
775 | --disable-libgcj \
|
---|
776 | --enable-languages=c,c++ "
|
---|
777 | endif
|
---|
778 | touch $(PATH_OBJ)/gcc/.ts.configured
|
---|
779 | # TODO: Andy, on Linux --enable-clh result in linking errors.
|
---|
780 |
|
---|
781 | # Install the GCC build
|
---|
782 | # Repeating the prefix doesn't hurt anybody.
|
---|
783 | gcc-install-it:
|
---|
784 | $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
|
---|
785 |
|
---|
786 |
|
---|
787 |
|
---|
788 | # easy, update src/gcc/gcc/version.c
|
---|
789 | gcc-versionstamps:
|
---|
790 | @echo "Version stamping gcc..."
|
---|
791 | mv -f $(PATH_TOP)/src/gcc/gcc/version.c $(PATH_TOP)/src/gcc/gcc/version.tmp.c
|
---|
792 | sed -e '/version_string/s/\([0-9]\.[0-9]*\.[0-9]*\).*/\1 $(INNOTEK_VERSION)";/' \
|
---|
793 | $(PATH_TOP)/src/gcc/gcc/version.tmp.c > $(PATH_TOP)/src/gcc/gcc/version.c
|
---|
794 | rm -f $(PATH_TOP)/src/gcc/gcc/version.tmp.c
|
---|
795 |
|
---|
796 |
|
---|
797 | # Install to builttools directory.
|
---|
798 | ## WARNING! Another spec HACK!
|
---|
799 | gcc-builttools-stage2:
|
---|
800 | $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc prefix=$(PATH_BUILTTOOLS_TMPD) install
|
---|
801 | ## cp $(PATH_TOP)/src/emx/src/lib/libc.specs $(PATH_OBJ)/gcc/gcc/specs
|
---|
802 |
|
---|
803 |
|
---|
804 | # Generate diffs for GCC (v3.2.2) - part of packing a release.
|
---|
805 | .PHONY: gcc-diff $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff
|
---|
806 | gcc-diff: $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff
|
---|
807 | $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff:
|
---|
808 | mkdir -p $(@D)
|
---|
809 | $(TOOL_CVS_DIFF_TREE) $(GCC_CVS_REL) src/gcc > $@
|
---|
810 |
|
---|
811 |
|
---|
812 |
|
---|
813 | ##############################################################################
|
---|
814 | ###############################################################################
|
---|
815 | ###############################################################################
|
---|
816 | #
|
---|
817 | # G C C - O M F f o r D e B u G i n g
|
---|
818 | #
|
---|
819 | ###############################################################################
|
---|
820 | ###############################################################################
|
---|
821 | ###############################################################################
|
---|
822 | all-gccomf: gccomf
|
---|
823 | gccomf:
|
---|
824 | mkdir -p $(PATH_OBJ)/gccomf
|
---|
825 | $(NICE) $(MAKE) $(MAKEOPT) -C . gccomf-logged 2>&1 | $(UNIXROOT)/usr/bin/tee $(PATH_OBJ)/gccomf/build-`date +"%Y%m%d-%H%M%S"`.log
|
---|
826 |
|
---|
827 | gccomf-logged: \
|
---|
828 | gcc-autoconf-refresh \
|
---|
829 | gccomf-build
|
---|
830 | echo "Unbelievable!!! We just successfully completed a GCC OMF build!!!"
|
---|
831 |
|
---|
832 | # build the components.
|
---|
833 | .PHONY: gccomf-build gccomf-install gccomf-configure
|
---|
834 | gccomf-build gccomf-install gccomf-configure:
|
---|
835 | mkdir -p $(PATH_OBJ)/gccomf
|
---|
836 | $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gccomf -f $(MAKEFILE) $@-it
|
---|
837 |
|
---|
838 |
|
---|
839 | # Separate since we want the 'e' option
|
---|
840 | gccomf-shell:
|
---|
841 | mkdir -p $(PATH_OBJ)/gccomf
|
---|
842 | $(MAKE) $(MAKEOPT) -e -C $(PATH_OBJ)/gccomf -f $(MAKEFILE) $@-it
|
---|
843 | gccomf-shell-it:
|
---|
844 | chdir $(PATH_OBJ)/gccomf ; \
|
---|
845 | if test -d $(PATH_BUILTTOOLS)/omfhack; then mv -f $(PATH_BUILTTOOLS)/omfhack $(PATH_BUILTTOOLS)/omfhackbin; fi ; \
|
---|
846 | if test ! -d $(PATH_BUILTTOOLS)/omfhackbin; then echo "no omfhackbin"; exit 1; fi ; \
|
---|
847 | unset GCCLOAD; \
|
---|
848 | export GCC_OMF="real"; \
|
---|
849 | export LIBGCC2_DEBUG_CFLAGS="-g -Zhigh-mem -Zaout"; \
|
---|
850 | export CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
|
---|
851 | export CXXFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
|
---|
852 | export BOOT_CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
|
---|
853 | export LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024"; \
|
---|
854 | export BOOT_LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024"; \
|
---|
855 | $(subst \,/,$(COMSPEC)) ; \
|
---|
856 | mv -f $(PATH_BUILTTOOLS)/omfhackbin $(PATH_BUILTTOOLS)/omfhack
|
---|
857 |
|
---|
858 |
|
---|
859 | # When changed directory
|
---|
860 | # We pass down alot of flags here, but currently we don't use half of them as
|
---|
861 | # we're not booting the compiler.
|
---|
862 |
|
---|
863 | #OMFSPEC_HACK = $(if $(wildchar $(PATH_OBJ)/.all-stage1),\
|
---|
864 | # -specs $(PATH_TOP)/src/emx/src/lib/libc.specs, \
|
---|
865 | # -specs $(PATH_TOP)/tools/x86.os2/gcc/staged/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs)
|
---|
866 | OMFSPECS_HACK =
|
---|
867 | gccomf-build-it: \
|
---|
868 | $(PATH_OBJ)/gccomf/.ts.configured
|
---|
869 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
870 | if test -d $(PATH_BUILTTOOLS)/omfhack; then mv -f $(PATH_BUILTTOOLS)/omfhack $(PATH_BUILTTOOLS)/omfhackbin; fi
|
---|
871 | if test ! -d $(PATH_BUILTTOOLS)/omfhackbin; then echo "no omfhackbin"; exit 1; fi ; \
|
---|
872 | unset GCCLOAD ; export GCC_OMF="real" ; echo GCC_OMF=$$GCC_OMF; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gccomf \
|
---|
873 | LIBGCC2_DEBUG_CFLAGS="-g -Zhigh-mem -Zaout" \
|
---|
874 | CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
|
---|
875 | CXXFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
|
---|
876 | BOOT_CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
|
---|
877 | LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024" \
|
---|
878 | BOOT_LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024" \
|
---|
879 | -e all
|
---|
880 | mv -f $(PATH_BUILTTOOLS)/omfhackbin $(PATH_BUILTTOOLS)/omfhack
|
---|
881 | else
|
---|
882 | $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc all
|
---|
883 | endif
|
---|
884 |
|
---|
885 |
|
---|
886 | # configure it (invoked after directory change).
|
---|
887 | # We set CC to help configure finding it.
|
---|
888 | gccomf-configure-it $(PATH_OBJ)/gccomf/.ts.configured: $(PATH_TOP)/src/gcc/configure
|
---|
889 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
890 | $(ASH) -c " \
|
---|
891 | export CC=\"gcc.exe\" ; \
|
---|
892 | $< \
|
---|
893 | --enable-clh \
|
---|
894 | --enable-threads=os2 \
|
---|
895 | --enable-shared=libgcc,bfd,opcodes \
|
---|
896 | --disable-nls \
|
---|
897 | --without-included-gettext \
|
---|
898 | --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
|
---|
899 | --prefix=/gcc \
|
---|
900 | --with-gnu-ld \
|
---|
901 | --with-gnu-as \
|
---|
902 | --disable-libgcj \
|
---|
903 | --enable-languages=c,c++ "
|
---|
904 | else
|
---|
905 | $(ASH) -c "$< \
|
---|
906 | --disable-clh \
|
---|
907 | --enable-shared=libgcc,bfd,opcodes \
|
---|
908 | --disable-nls \
|
---|
909 | --without-included-gettext \
|
---|
910 | --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
|
---|
911 | --prefix=/gcc \
|
---|
912 | --with-gnu-ld \
|
---|
913 | --with-gnu-as \
|
---|
914 | --disable-libgcj \
|
---|
915 | --enable-languages=c,c++ "
|
---|
916 | endif
|
---|
917 | touch $(PATH_OBJ)/gccomf/.ts.configured
|
---|
918 | # TODO: Andy, on Linux --enable-clh result in linking errors.
|
---|
919 |
|
---|
920 | # Install the GCC build
|
---|
921 | # Repeating the prefix doesn't hurt anybody.
|
---|
922 | gccomf-install-it:
|
---|
923 | $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
|
---|
924 |
|
---|
925 |
|
---|
926 |
|
---|
927 |
|
---|
928 |
|
---|
929 | ###############################################################################
|
---|
930 | ###############################################################################
|
---|
931 | ###############################################################################
|
---|
932 | #
|
---|
933 | # B i n U t i l s
|
---|
934 | #
|
---|
935 | ###############################################################################
|
---|
936 | ###############################################################################
|
---|
937 | ###############################################################################
|
---|
938 |
|
---|
939 | BINUTILS_DIRS = \
|
---|
940 | binutils/bfd \
|
---|
941 | binutils/opcodes \
|
---|
942 | binutils/gas \
|
---|
943 | binutils/gprof \
|
---|
944 | binutils/binutils \
|
---|
945 | binutils/ld \
|
---|
946 |
|
---|
947 | BINUTILS_NOT_DIRS =\
|
---|
948 | binutils/etc \
|
---|
949 | binutils/libiberty \
|
---|
950 | binutils/intl \
|
---|
951 |
|
---|
952 |
|
---|
953 | BINUTILS_CONFIGURE_DIRS = $(BINUTILS_DIRS) $(BINUTILS_NOT_DIRS)
|
---|
954 |
|
---|
955 | all-binutils binutils:
|
---|
956 | echo "Binutils are build together with the other GNU Tools in GCC."
|
---|
957 | echo "Separate building of binutils is not configured."
|
---|
958 |
|
---|
959 | all-binutils214 binutils214: \
|
---|
960 | binutils-autoconf-refresh \
|
---|
961 | binutils-build
|
---|
962 | echo "Successfully build Binutils v2.14."
|
---|
963 |
|
---|
964 |
|
---|
965 |
|
---|
966 | # configure.in/configure
|
---|
967 | .PHONY: binutils-autoconf-refresh binutils-autoconf-rerun binutils-autoconf-clean binutils-autoconf-remove
|
---|
968 | binutils-autoconf-refresh binutils-autoconf-rerun binutils-autoconf-clean binutils-autoconf-remove:
|
---|
969 | ifeq "$(BUILD_PLATFORM)" "LINUX"
|
---|
970 | -$(SH) $(PATH_TOP)/xfix.sh
|
---|
971 | endif
|
---|
972 | for dir in $(BINUTILS_CONFIGURE_DIRS); do \
|
---|
973 | if $(MAKE) $(MAKEOPT) -j 1 $(@:binutils-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; then \
|
---|
974 | true; \
|
---|
975 | else \
|
---|
976 | exit 8; \
|
---|
977 | fi \
|
---|
978 | done
|
---|
979 |
|
---|
980 |
|
---|
981 | # build the components.
|
---|
982 | .PHONY: binutils-build binutils-install binutils-configure
|
---|
983 | binutils-build binutils-install binutils-configure:
|
---|
984 | mkdir -p $(PATH_OBJ)/binutils
|
---|
985 | $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/binutils -f $(MAKEFILE) $@-it
|
---|
986 |
|
---|
987 |
|
---|
988 | # When changed directory
|
---|
989 | binutils-build-it: \
|
---|
990 | $(PATH_OBJ)/binutils/.ts.configured
|
---|
991 | $(ASH) -c " unset GCCLOAD ; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/binutils "
|
---|
992 |
|
---|
993 | # configure it (invoked after directory change).
|
---|
994 | # We set CC to help configure finding it.
|
---|
995 | # And we reconfigure libiberty to the gcc one.
|
---|
996 | binutils-configure-it $(PATH_OBJ)/binutils/.ts.configured: $(PATH_TOP)/src/binutils/configure
|
---|
997 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
998 | $(ASH) -c " \
|
---|
999 | export CC=\"gcc.exe\" ; \
|
---|
1000 | $< \
|
---|
1001 | --enable-clh \
|
---|
1002 | --enable-threads=os2 \
|
---|
1003 | --enable-shared=libgcc,bfd,opcodes \
|
---|
1004 | --enable-nls \
|
---|
1005 | --without-included-gettext \
|
---|
1006 | --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
|
---|
1007 | --prefix=/gcc \
|
---|
1008 | --with-gnu-ld \
|
---|
1009 | --with-gnu-as \
|
---|
1010 | --disable-libgcj \
|
---|
1011 | --enable-languages=c,c++ "
|
---|
1012 | else
|
---|
1013 | $(ASH) -c "$< \
|
---|
1014 | --disable-clh \
|
---|
1015 | --enable-shared=libgcc,bfd,opcodes \
|
---|
1016 | --enable-nls \
|
---|
1017 | --without-included-gettext \
|
---|
1018 | --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
|
---|
1019 | --prefix=/gcc \
|
---|
1020 | --with-gnu-ld \
|
---|
1021 | --with-gnu-as \
|
---|
1022 | --disable-libgcj \
|
---|
1023 | --enable-languages=c,c++ "
|
---|
1024 | endif
|
---|
1025 | mkdir -p libiberty
|
---|
1026 | # Not any longer.
|
---|
1027 | # $(ASH) -c "cd libiberty && \
|
---|
1028 | # $(PATH_TOP)/src/gcc/libiberty/configure \
|
---|
1029 | # --prefix=$(ALL_PREFIX) "
|
---|
1030 | touch $(PATH_OBJ)/binutils/.ts.configured
|
---|
1031 |
|
---|
1032 |
|
---|
1033 | # Install the Binutils build
|
---|
1034 | # Repeating the prefix doesn't hurt anybody.
|
---|
1035 | binutils-install-it:
|
---|
1036 | $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
|
---|
1037 |
|
---|
1038 |
|
---|
1039 | # Not so easy, need to patch a few files.
|
---|
1040 | binutils-versionstamps:
|
---|
1041 | @echo "Version stamping binutils..."
|
---|
1042 | cp -f $(PATH_TOP)/src/binutils/binutils/version.c $(PATH_TOP)/src/binutils/binutils/version.tmp.c
|
---|
1043 | sed -e '/printf.*program_version/s/%s %s.*\\n/%s %s $(INNOTEK_VERSION)\\n/' \
|
---|
1044 | $(PATH_TOP)/src/binutils/binutils/version.tmp.c > $(PATH_TOP)/src/binutils/binutils/version.c
|
---|
1045 | rm -f $(PATH_TOP)/src/binutils/binutils/version.tmp.c
|
---|
1046 | if [ -f $(PATH_TOP)/src/gcc/binutils/version.c ]; then \
|
---|
1047 | cp -f $(PATH_TOP)/src/gcc/binutils/version.c $(PATH_TOP)/src/gcc/binutils/version.tmp.c && \
|
---|
1048 | sed -e '/printf.*program_version/s/%s %s.*\\n/%s %s $(INNOTEK_VERSION)\\n/' \
|
---|
1049 | $(PATH_TOP)/src/gcc/binutils/version.tmp.c > $(PATH_TOP)/src/gcc/binutils/version.c && \
|
---|
1050 | rm -f $(PATH_TOP)/src/gcc/binutils/version.tmp.c ; \
|
---|
1051 | fi
|
---|
1052 | @echo "Version stamping gas..."
|
---|
1053 | cp -f $(PATH_TOP)/src/binutils/gas/as.c $(PATH_TOP)/src/binutils/gas/as.tmp.c
|
---|
1054 | sed -e '/printf.*GNU.*assembler/s/%s.*\\n/%s $(INNOTEK_VERSION)\\n/' \
|
---|
1055 | -e '/fprintf.*GNU.*assembler.*version.*BFD.*/s/using BFD version %s.*/using BFD version %s $(INNOTEK_VERSION)"),/ ' \
|
---|
1056 | $(PATH_TOP)/src/binutils/gas/as.tmp.c > $(PATH_TOP)/src/binutils/gas/as.c
|
---|
1057 | rm -f $(PATH_TOP)/src/binutils/gas/as.tmp.c
|
---|
1058 | if [ -f $(PATH_TOP)/src/gcc/gas/as.c ]; then \
|
---|
1059 | cp -f $(PATH_TOP)/src/gcc/gas/as.c $(PATH_TOP)/src/gcc/gas/as.tmp.c && \
|
---|
1060 | sed -e '/printf.*GNU.*assembler/s/%s.*\\n/%s $(INNOTEK_VERSION)\\n/' \
|
---|
1061 | -e '/fprintf.*GNU.*assembler.*version.*BFD.*/s/using BFD version %s.*/using BFD version %s $(INNOTEK_VERSION)"),/ ' \
|
---|
1062 | $(PATH_TOP)/src/gcc/gas/as.tmp.c > $(PATH_TOP)/src/gcc/gas/as.c && \
|
---|
1063 | rm -f $(PATH_TOP)/src/gcc/gas/as.tmp.c ; \
|
---|
1064 | fi
|
---|
1065 | @echo "Version stamping ld..."
|
---|
1066 | cp -f $(PATH_TOP)/src/binutils/ld/ldver.c $(PATH_TOP)/src/binutils/ld/ldver.tmp.c
|
---|
1067 | sed -e '/fprintf.*GNU.*ld.*version/s/(with BFD %s).*/(with BFD %s) $(INNOTEK_VERSION)\\n"),/' \
|
---|
1068 | $(PATH_TOP)/src/binutils/ld/ldver.tmp.c > $(PATH_TOP)/src/binutils/ld/ldver.c
|
---|
1069 | rm -f $(PATH_TOP)/src/binutils/ld/ldver.tmp.c
|
---|
1070 | if [ -f $(PATH_TOP)/src/gcc/ld/ldver.c ]; then \
|
---|
1071 | cp -f $(PATH_TOP)/src/gcc/ld/ldver.c $(PATH_TOP)/src/gcc/ld/ldver.tmp.c && \
|
---|
1072 | sed -e '/fprintf.*GNU.*ld.*version/s/(with BFD %s).*/(with BFD %s) $(INNOTEK_VERSION)\\n"),/' \
|
---|
1073 | $(PATH_TOP)/src/gcc/ld/ldver.tmp.c > $(PATH_TOP)/src/gcc/ld/ldver.c && \
|
---|
1074 | rm -f $(PATH_TOP)/src/gcc/ld/ldver.tmp.c ; \
|
---|
1075 | fi
|
---|
1076 |
|
---|
1077 |
|
---|
1078 |
|
---|
1079 | # Generate diffs for Binutils (part of packing).
|
---|
1080 | .PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff
|
---|
1081 | binutils-diff: $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff
|
---|
1082 | $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff:
|
---|
1083 | mkdir -p $(@D)
|
---|
1084 | $(TOOL_CVS_DIFF_TREE) $(BINUTILS_CVS_REL) src/binutils > $@
|
---|
1085 |
|
---|
1086 |
|
---|
1087 |
|
---|
1088 |
|
---|
1089 |
|
---|
1090 |
|
---|
1091 |
|
---|
1092 |
|
---|
1093 | ###############################################################################
|
---|
1094 | ###############################################################################
|
---|
1095 | ###############################################################################
|
---|
1096 | #
|
---|
1097 | # E M X
|
---|
1098 | #
|
---|
1099 | ###############################################################################
|
---|
1100 | ###############################################################################
|
---|
1101 | ###############################################################################
|
---|
1102 | all-emx emx: \
|
---|
1103 | emx-build
|
---|
1104 | @echo "Successfully build EMX."
|
---|
1105 |
|
---|
1106 | # Some helpers.
|
---|
1107 | # TODO: Change OUT and INS to the right ones. Currently not possible as
|
---|
1108 | # doing such breaks the rules generating.
|
---|
1109 | EMX_MODE = dbg
|
---|
1110 | ifeq "$(BUILD_MODE)" "RELEASE"
|
---|
1111 | EMX_MODE = opt
|
---|
1112 | endif
|
---|
1113 | EMX_OUT = out/
|
---|
1114 | EMX_INS = out/install/
|
---|
1115 | #EMX_OUT = $(PATH_OBJ)/emx/
|
---|
1116 | #EMX_INS = $(ALL_PREFIX)/
|
---|
1117 | EMX_MASM = $(PATH_TOP)/tools/x86.os2/masm/v6.0/binp/ml.exe
|
---|
1118 | EMX_DEFINES = OUT=$(EMX_OUT) INS=$(EMX_INS) MODE=$(EMX_MODE) "ASM=$(EMX_MASM) -c"
|
---|
1119 |
|
---|
1120 | # build the components. (directory changer rules)
|
---|
1121 | .PHONY: emx-build emx-install emx-configure
|
---|
1122 | emx-build emx-install emx-configure:
|
---|
1123 | mkdir -p $(PATH_OBJ)/emx
|
---|
1124 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx -f $(MAKEFILE) $@-it
|
---|
1125 |
|
---|
1126 | # This is the configure equivalent.
|
---|
1127 | emx-configure-it:
|
---|
1128 | @echo ...
|
---|
1129 |
|
---|
1130 | # make handle issue here. Make portions at the time.
|
---|
1131 | emx-build-it:
|
---|
1132 | $(MAKE) $(MAKEOPT) -j 1 -C $(PATH_TOP)/src/emx $(EMX_DEFINES) tools
|
---|
1133 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) os2
|
---|
1134 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libc
|
---|
1135 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) app
|
---|
1136 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) alias
|
---|
1137 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) regexp
|
---|
1138 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libc-dll
|
---|
1139 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libsocket libdl
|
---|
1140 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libs
|
---|
1141 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) all
|
---|
1142 |
|
---|
1143 | emx-install-it:
|
---|
1144 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) INS=$(ALL_PREFIX)/ install
|
---|
1145 |
|
---|
1146 |
|
---|
1147 | # We pass down the INNOTEK_VERSION define when building EMX.
|
---|
1148 | emx-versionstamps:
|
---|
1149 | @echo "Version stamping EMX... nothing to do"
|
---|
1150 |
|
---|
1151 | # Install the compiled emx stuff to builttools.
|
---|
1152 | ##emx-builttools-stage2: emx-builttools-stage2-specs
|
---|
1153 | emx-builttools-stage2:
|
---|
1154 | $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) INS=$(PATH_BUILTTOOLS_TMP)/ install
|
---|
1155 |
|
---|
1156 | ## bird: for now we will just replace the specs with the constantly updated libc specs.
|
---|
1157 | emx-builttools-stage2-specs:
|
---|
1158 | ## -mv -f $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs \
|
---|
1159 | ## $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/emxspecs
|
---|
1160 | ## cp $(PATH_TOP)/src/emx/src/lib/libc.specs \
|
---|
1161 | ## $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs
|
---|
1162 |
|
---|
1163 |
|
---|
1164 | # Generate diffs for Binutils (part of packing).
|
---|
1165 | .PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
|
---|
1166 | emx-diff: $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
|
---|
1167 | $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff:
|
---|
1168 | mkdir -p $(@D)
|
---|
1169 | $(TOOL_CVS_DIFF_TREE) $(EMX_CVS_REL) src/emx > $@
|
---|
1170 |
|
---|
1171 |
|
---|
1172 |
|
---|
1173 |
|
---|
1174 |
|
---|
1175 | ###############################################################################
|
---|
1176 | ###############################################################################
|
---|
1177 | ###############################################################################
|
---|
1178 | #
|
---|
1179 | # P A C K I N G
|
---|
1180 | #
|
---|
1181 | ###############################################################################
|
---|
1182 | ###############################################################################
|
---|
1183 | ###############################################################################
|
---|
1184 | packing: \
|
---|
1185 | packing-all \
|
---|
1186 | packing-doc \
|
---|
1187 | packing-libc \
|
---|
1188 | packing-core \
|
---|
1189 | packing-dbg \
|
---|
1190 | packing-prf \
|
---|
1191 |
|
---|
1192 | ZIPFLAGS=-rX9
|
---|
1193 | ZIPBASE=$(PATH_BIN)/GCC-$(GCC_VERSION)-beta3fix1
|
---|
1194 |
|
---|
1195 | packing-all:
|
---|
1196 | rm -f $(ZIPBASE).zip
|
---|
1197 | cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE).zip *
|
---|
1198 |
|
---|
1199 | packing-doc:
|
---|
1200 | rm -f $(ZIPBASE)-doc.zip
|
---|
1201 | cd $(ALL_PREFIX)/..; zip $(ZIPFLAGS) $(ZIPBASE)-doc.zip usr/doc/GCC-$(GCC_VERSION)/*
|
---|
1202 |
|
---|
1203 | packing-libc:
|
---|
1204 | rm -f $(PATH_BIN)/libc.zip
|
---|
1205 | cd $(ALL_PREFIX)/lib; zip $(ZIPFLAGS) $(PATH_BIN)/libc.zip libc*.dll gcc*.dll
|
---|
1206 |
|
---|
1207 | packing-core:
|
---|
1208 | rm -f $(ZIPBASE)-core.zip
|
---|
1209 | cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-core.zip * -x \*.dbg -x \*.map -x \*_p.\* -x \*.elh -x \*.prf -x \*.lib -x usr/lib/dbg/\* -x \*.lib
|
---|
1210 | cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-core.zip usr/lib/libc*dbg usr/lib/end.lib
|
---|
1211 |
|
---|
1212 | packing-dbg:
|
---|
1213 | rm -f $(ZIPBASE)-dbg.zip
|
---|
1214 | cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-dbg.zip . -i \*.dbg -i \*.map -i \*.elh -i \*.sym -i usr/lib/dbg/\*
|
---|
1215 |
|
---|
1216 | packing-prf:
|
---|
1217 | rm -f $(ZIPBASE)-prf.zip
|
---|
1218 | cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-prf.zip . -i \*_p.\* -i \*.prf
|
---|
1219 |
|
---|
1220 | packing-src: \
|
---|
1221 | packing-src-gcc \
|
---|
1222 | packing-src-binutils \
|
---|
1223 | packing-src-emx \
|
---|
1224 |
|
---|
1225 | packing-src-gcc:
|
---|
1226 | rm -f $(ZIPBASE)-src-GCC.zip
|
---|
1227 | zip $(ZIPFLAGS) $(ZIPBASE)-src-GCC.zip src/gcc -x \*CVS\*
|
---|
1228 |
|
---|
1229 | packing-src-binutils:
|
---|
1230 | rm -f $(ZIPBASE)-src-binutils.zip
|
---|
1231 | zip $(ZIPFLAGS) $(ZIPBASE)-src-binutils.zip src/binutils -x \*CVS\*
|
---|
1232 |
|
---|
1233 | packing-src-emx:
|
---|
1234 | rm -f $(ZIPBASE)-src-emx.zip
|
---|
1235 | zip $(subst r,,$(ZIPFLAGS)) $(ZIPBASE)-src-emx.zip src/emx/* -x \*CVS\* -x \*testcase\* -x \*out\*
|
---|
1236 | zip $(ZIPFLAGS) $(ZIPBASE)-src-emx.zip src/emx/src/* src/emx/include/* src/emx/src/bsd/* -x \*CVS\*
|
---|
1237 |
|
---|
1238 |
|
---|
1239 |
|
---|
1240 | ###############################################################################
|
---|
1241 | ###############################################################################
|
---|
1242 | ###############################################################################
|
---|
1243 | #
|
---|
1244 | # M I S C
|
---|
1245 | #
|
---|
1246 | ###############################################################################
|
---|
1247 | ###############################################################################
|
---|
1248 | ###############################################################################
|
---|
1249 |
|
---|
1250 | misc-install:
|
---|
1251 | mkdir -p $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
|
---|
1252 | mkdir -p $(ALL_PREFIX)/lib
|
---|
1253 | mkdir -p $(ALL_PREFIX)/bin
|
---|
1254 | cp $(PATH_TOP)/doc/ReleaseNotes.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
|
---|
1255 | cp $(PATH_TOP)/doc/MailingLists.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
|
---|
1256 | cp $(PATH_TOP)/doc/Install.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
|
---|
1257 | cp $(PATH_TOP)/doc/Licenses.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
|
---|
1258 | cp $(PATH_TOP)/doc/COPYING.LIB $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
|
---|
1259 | cp $(PATH_TOP)/doc/COPYING $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
|
---|
1260 | cp $(PATH_TOP)/ChangeLog $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)/ChangeLog.os2
|
---|
1261 | cp $(PATH_TOP)/src/install/MakeOmfLibs.cmd $(ALL_PREFIX)/lib
|
---|
1262 | cp $(PATH_TOP)/src/misc/dllar.cmd $(ALL_PREFIX)/bin
|
---|
1263 | cp $(PATH_TOP)/src/misc/gccenv.cmd $(ALL_PREFIX)/bin
|
---|
1264 | ar cr $(ALL_PREFIX)/lib/m.a
|
---|
1265 |
|
---|
1266 |
|
---|
1267 | dejagnu:
|
---|
1268 | # nothing to make at the moment, it's just a all install stuff it seems.
|
---|
1269 |
|
---|
1270 | requires_autoconf_2_52_DEJAGNU_CONFIGURE_DIRS = \
|
---|
1271 | src/misc/dejagnu \
|
---|
1272 | src/misc/dejagnu/contrib/bluegnu2.0.3 \
|
---|
1273 | src/misc/dejagnu/contrib/bluegnu2.0.3/doc \
|
---|
1274 | src/misc/dejagnu/contrib/bluegnu2.0.3/example \
|
---|
1275 | src/misc/dejagnu/contrib/bluegnu2.0.3/example/calc \
|
---|
1276 | src/misc/dejagnu/contrib/bluegnu2.0.3/testsuite \
|
---|
1277 | src/misc/dejagnu/example/calc \
|
---|
1278 | src/misc/dejagnu/example/hello
|
---|
1279 |
|
---|
1280 | .PHONY: dejagnu-autoconf-refresh dejagnu-autoconf-rerun dejagnu-autoconf-clean dejagnu-autoconf-remove
|
---|
1281 | dejagnu-autoconf-refresh dejagnu-autoconf-rerun dejagnu-autoconf-clean dejagnu-autoconf-remove:
|
---|
1282 | ifeq "$(BUILD_PLATFORM)" "LINUX"
|
---|
1283 | -$(SH) $(PATH_TOP)/xfix.sh
|
---|
1284 | endif
|
---|
1285 | for dir in $(DEJAGNU_CONFIGURE_DIRS); do \
|
---|
1286 | if $(MAKE) $(MAKEOPT) -j 1 $(@:dejagnu-autoconf-%=%) -f $(PWD)/config.gmk -C $$dir ; then \
|
---|
1287 | true; \
|
---|
1288 | else \
|
---|
1289 | exit 8; \
|
---|
1290 | fi \
|
---|
1291 | done
|
---|
1292 |
|
---|
1293 |
|
---|
1294 |
|
---|
1295 | #
|
---|
1296 | # Expect
|
---|
1297 | #
|
---|
1298 |
|
---|
1299 | expect:
|
---|
1300 |
|
---|
1301 |
|
---|
1302 | # build the components.
|
---|
1303 | .PHONY: expect-build expect-install expect-configure
|
---|
1304 | expect-build expect-install expect-configure:
|
---|
1305 | mkdir -p $(PATH_OBJ)/misc/expect
|
---|
1306 | $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/misc/expect -f $(MAKEFILE) $@-it
|
---|
1307 |
|
---|
1308 |
|
---|
1309 | # When changed directory
|
---|
1310 | expect-build-it: \
|
---|
1311 | $(PATH_OBJ)/misc/expect/.ts.configured
|
---|
1312 | $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/misc/expect
|
---|
1313 |
|
---|
1314 | # configure it (invoked after directory change).
|
---|
1315 | # We set CC to help configure finding it.
|
---|
1316 | # And we reconfigure libiberty to the gcc one.
|
---|
1317 | expect-configure-it $(PATH_OBJ)/misc/expect/.ts.configured: $(PATH_TOP)/src/misc/expect/configure
|
---|
1318 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
---|
1319 | $(ASH) -c " \
|
---|
1320 | export CC=\"gcc.exe\" ; \
|
---|
1321 | $< \
|
---|
1322 | --disable-shared \
|
---|
1323 | --host=i386-pc-os2-emx \
|
---|
1324 | --with-tclconfig=$(UNIXROOT)/usr/lib \
|
---|
1325 | --with-tclinclude=$(UNIXROOT)/usr/lib/tcl8.0/include \
|
---|
1326 | --enable-gcc \
|
---|
1327 | $(BUILD_ENABLE_SYMBOLS) \
|
---|
1328 | --prefix=$(PATH_BUILTTOOLSD) "
|
---|
1329 | else
|
---|
1330 | $(ASH) -c " \
|
---|
1331 | $< \
|
---|
1332 | --enable-gcc \
|
---|
1333 | $(BUILD_ENABLE_SYMBOLS) \
|
---|
1334 | --prefix=$(PATH_BUILTTOOLSD) "
|
---|
1335 | endif
|
---|
1336 | touch $(PATH_OBJ)/misc/expect/.ts.configured
|
---|
1337 |
|
---|
1338 |
|
---|
1339 | # install to builttools (if anywhere!)
|
---|
1340 | expect-install-it:
|
---|
1341 | $(MAKE) $(MAKEOPT) prefix=$(PATH_BUILTTOOLSD) install
|
---|
1342 |
|
---|
1343 |
|
---|
1344 |
|
---|
1345 | EXPECT_CONFIGURE_DIRS = \
|
---|
1346 | src/misc/expect
|
---|
1347 | # skipping testsuite for now as it requires some .m4 files we don't have.
|
---|
1348 | #src/misc/expect/testsuite
|
---|
1349 |
|
---|
1350 | .PHONY: expect-autoconf-refresh expect-autoconf-rerun expect-autoconf-clean expect-autoconf-remove
|
---|
1351 | expect-autoconf-refresh expect-autoconf-rerun expect-autoconf-clean expect-autoconf-remove:
|
---|
1352 | ifeq "$(BUILD_PLATFORM)" "LINUX"
|
---|
1353 | -$(SH) $(PATH_TOP)/xfix.sh
|
---|
1354 | endif
|
---|
1355 | for dir in $(EXPECT_CONFIGURE_DIRS); do \
|
---|
1356 | if $(MAKE) $(MAKEOPT) -j 1 $(@:expect-autoconf-%=%) -f $(PWD)/config.gmk -C $$dir ; then \
|
---|
1357 | true; \
|
---|
1358 | else \
|
---|
1359 | exit 8; \
|
---|
1360 | fi \
|
---|
1361 | done
|
---|
1362 |
|
---|
1363 |
|
---|
1364 |
|
---|
1365 | #
|
---|
1366 | # Checkout rule
|
---|
1367 | #
|
---|
1368 | checkout update:
|
---|
1369 | cvs -q update -d 2>&1 | tee up.log
|
---|
1370 |
|
---|
1371 | # DO NOT DELETE
|
---|