source: trunk/Makefile@ 1120

Last change on this file since 1120 was 1108, checked in by bird, 22 years ago

removed intl. Fixed emx build (regexp target is dead). Corrected sed preload.

  • Property cvs2svn:cvs-rev set to 1.62
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 44.8 KB
Line 
1# $Id: Makefile 1108 2004-01-29 20:14:51Z 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###############################################################################
18PWD := $(shell pwd)
19PWDD := $(shell pwd|sed 's/^[a-zA-Z]://')
20MAKEFILE = $(PWD)/Makefile
21
22ifndef BUILD_MODE
23export BUILD_MODE=DEBUG
24endif
25
26ifndef PATH_TOP
27export PATH_TOP := $(PWD)
28endif
29ifndef PATH_TOPD
30export PATH_TOPD := $(PWDD)
31endif
32
33
34export PATH_BIN = $(PATH_TOP)/bin/$(BUILD_PLATFORM)/$(BUILD_MODE)
35export PATH_BIND = $(PATH_TOPD)/bin/$(BUILD_PLATFORM)/$(BUILD_MODE)
36export PATH_OBJ = $(PATH_TOP)/obj/$(BUILD_PLATFORM)/$(BUILD_MODE)
37export PATH_OBJD = $(PATH_TOPD)/obj/$(BUILD_PLATFORM)/$(BUILD_MODE)
38export PATH_BUILTTOOLS = $(PATH_OBJ)/builttools
39export PATH_BUILTTOOLSD= $(PATH_OBJD)/builttools
40PATH_BUILTTOOLS_TMP = $(PATH_OBJ)/builttools.tmp
41PATH_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.
45ifeq "$(BUILD_MODE)" "RELEASE"
46BUILD_DEBUGINFO = -s
47BUILD_ENABLE_SYMBOLS = --disable-symbols
48BUILD_OPTIMIZE = -O2 -mcpu=pentium -mpreferred-stack-boundary=2 -malign-strings=0 -falign-loops=2 -falign-jumps=2 -falign-functions=2
49else
50BUILD_OPTIMIZE = -O0
51BUILD_DEBUGINFO = -g
52BUILD_ENABLE_SYMBOLS = --enable-symbols
53endif
54
55
56# Version and CVS defines
57export GCC_VERSION ?= 3.2.2
58export GCC_VERSION_SHORT ?= 3022
59export GCC_CVS_VENDOR ?= GNU
60export GCC_CVS_REL ?= GCC_3-2-2
61export BINUTILS_VERSION ?= 2.14
62export BINUTILS_VERSION_SHORT ?= 214
63export BINUTILS_CVS_VENDOR ?= GNU
64export BINUTILS_CVS_REL ?= BINUTILS_2-14
65export EMX_VERSION ?= 0.9d-fix04
66export EMX_VERSION_SHORT ?= 9d04
67export EMX_CVS_VENDOR ?= EMX
68export EMX_CVS_REL ?= EMX_0-9D-FIX04
69
70# innotek version and timestamp
71export 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#
78ifndef BUILD_PLATFORM
79ifeq "$(shell uname -s)" "Linux"
80export BUILD_PLATFORM ?= LINUX
81export BUILD_PROJECT ?= GCCOS2
82export SH ?= /bin/sh
83export ASH ?= /bin/ash
84export BASH ?= /bin/bash
85export AWK ?= /bin/gawk
86export GAWK ?= /bin/gawk
87export CONFIG_SHELL ?= $(SH)
88export MAKESHELL ?= $(SH)
89export PATH_EMX ?= /usr
90export PATH_EMXPGCC ?= /usr
91export TMP ?= /tmp
92export TMPDIR ?= /tmp
93endif
94endif
95
96
97
98# Misc Helpers
99ALL_PREFIX = $(PATH_BIND)/$(GCC_VERSION)/usr
100TOOL_CVS_DIFF_TREE = -cvs diff -R -N -w -u -r
101ifeq "$(BUILD_PLATFORM)" "OS2"
102NICE = nice -i
103else
104NICE =
105endif
106
107
108
109
110###############################################################################
111###############################################################################
112###############################################################################
113###############################################################################
114#
115# M a i n R u l e z
116#
117###############################################################################
118###############################################################################
119###############################################################################
120###############################################################################
121all:
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
125all-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
147all-banner-start:
148 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
149 @echo "+ Make started: $(shell date)"
150 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
151
152all-banner-stage1:
153 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
154 @echo "+ Stage 1 - starting: $(shell date)"
155 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
156
157all-banner-stage2:
158 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
159 @echo "+ Stage 2 - starting: $(shell date)"
160 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
161
162all-banner-builttools-initial:
163 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
164 @echo "+ Initializing builttools tree"
165 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
166
167all-banner-builttools-stage2:
168 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
169 @echo "+ Copying stage2 builttools"
170 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
171
172all-banner-install:
173 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
174 @echo "+ Install - starting: $(shell date)"
175 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
176
177all-banner-install-done:
178 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
179 @echo "+ Install - done: $(shell date)"
180 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
181
182all-banner-symlinks-start:
183 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
184 @echo "+ symlinks - staring: $(shell date)"
185 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
186
187all-banner-symlinks-done:
188 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
189 @echo "+ symlinks - done: $(shell date)"
190 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
191
192all-banner-symlinks-unlink-start:
193 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
194 @echo "+ symlinks unlinking - staring: $(shell date)"
195 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
196
197all-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
207all-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
271all-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
289ifeq "$(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
300endif
301 @echo "ok"
302
303
304#
305# Preload tools we commonly use this speeds up stuff.
306#
307PRELOADED_TOOLS = bin/sh.exe bin/echo.exe bin/true.exe usr/bin/test.exe usr/bin/expr.exe \
308 usr/bin/gawk.exe bin/sed.exe bin/rm.exe bin/cat.exe bin/cp.exe
309
310all-preload:
311 @echo "Preloading tools:"
312ifeq "$(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
318endif
319 @echo ""
320
321all-preload-unload:
322ifeq "$(BUILD_PLATFORM)" "OS2"
323 emxload -qw
324endif
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
335all-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
349all-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
358all-stage1-it: \
359 all-banner-stage1 \
360 all-builttools-initial \
361 all-binutils \
362 all-gcc \
363 all-emx
364
365
366all-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
393all-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#
403all-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#
414all-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
435all-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
444all-builttools-clean: \
445 all-preload-unload
446 rm -Rf $(PATH_BUILTTOOLS)
447
448all-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
464all-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
477all-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###############################################################################
512all-symlinks: \
513 all-banner-symlinks-start \
514 all-symlinks-binutils \
515 all-banner-symlinks-done
516
517all-symlinks-unlink: \
518 all-banner-symlinks-unlink-start \
519 all-symlinks-unlink-binutils \
520 all-banner-symlinks-unlink-done
521
522
523ifeq "$(BUILD_PLATFORM)" "OS2"
524TOOL_SYMLINK_FILE = cp -p
525TOOL_SYMLINK_DIR = cp -pRf
526TOOL_SYMLINK_MKDIR = mkdir
527TOOL_UNSYMLINK_DIR = rm -Rf
528else
529TOOL_SYMLINK_FILE = ln -fs
530TOOL_SYMLINK_DIR = ln -fs
531TOOL_SYMLINK_MKDIR = true
532TOOL_UNSYMLINK_DIR = rm
533endif
534
535# ld is broken, so don't use it!
536# ld \
537
538SYMLINKS_BINUTILS_TO_GCC_DIRS = \
539bfd \
540binutils \
541etc \
542gas \
543gprof \
544intl \
545opcodes \
546texinfo \
547libiberty \
548include/aout \
549include/coff \
550include/elf \
551include/gdb \
552include/mpw \
553include/nlm \
554include/opcode \
555include/regs \
556
557SYMLINKS_BINUTILS_TO_GCC_FILES = \
558include/alloca-conf.h \
559include/ansidecl.h \
560include/bfdlink.h \
561include/bin-bugs.h \
562include/bout.h \
563include/ChangeLog \
564include/COPYING \
565include/demangle.h \
566include/dis-asm.h \
567include/dyn-string.h \
568include/fibheap.h \
569include/filenames.h \
570include/floatformat.h \
571include/fnmatch.h \
572include/fopen-bin.h \
573include/fopen-same.h \
574include/fopen-vms.h \
575include/gdbm.h \
576include/getopt.h \
577include/hashtab.h \
578include/hp-symtab.h \
579include/ieee.h \
580include/libiberty.h \
581include/MAINTAINERS \
582include/md5.h \
583include/oasys.h \
584include/objalloc.h \
585include/obstack.h \
586include/os9k.h \
587include/partition.h \
588include/progress.h \
589include/safe-ctype.h \
590include/sort.h \
591include/splay-tree.h \
592include/symcat.h \
593include/ternary.h \
594include/xregex.h \
595include/xregex2.h \
596include/xtensa-config.h \
597include/xtensa-isa-internal.h \
598include/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... :/
603all-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
632all-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###############################################################################
660all-gcc gcc: \
661 gcc-autoconf-refresh \
662 gcc-build
663 echo "Successfully build GCC."
664
665
666
667GCC_DIRS = \
668gcc/libiberty \
669gcc/zlib \
670gcc/gcc \
671gcc/libstdc++-v3 \
672gcc/boehm-gc \
673gcc/fastjar \
674gcc/libf2c \
675gcc/libf2c/libF77 \
676gcc/libf2c/libI77 \
677gcc/libf2c/libU77 \
678gcc/libffi \
679gcc/libjava \
680gcc/libjava/libltdl \
681gcc/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.
685not_yet =\
686gcc/bfd \
687gcc/binutils \
688gcc/gas \
689gcc/gprof \
690gcc/ld \
691gcc/libiberty \
692gcc/opcodes
693#gcc/intl
694
695GCC_CONFIGURE_DIRS = $(GCC_DIRS)
696
697
698# configure.in/configure
699.PHONY: gcc-autoconf-refresh gcc-autoconf-rerun gcc-autoconf-clean gcc-autoconf-remove
700gcc-autoconf-refresh gcc-autoconf-rerun gcc-autoconf-clean gcc-autoconf-remove:
701ifeq "$(BUILD_PLATFORM)" "LINUX"
702 -$(SH) $(PATH_TOP)/xfix.sh
703endif
704 for dir in $(GCC_CONFIGURE_DIRS); do \
705 echo $$dir; \
706 if $(MAKE) $(MAKEOPT) -j 1 $(@:gcc-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; then \
707 true; \
708 else \
709 exit 8; \
710 fi \
711 done
712
713
714# build the components.
715.PHONY: gcc-build gcc-install gcc-configure
716gcc-build gcc-install gcc-configure:
717 mkdir -p $(PATH_OBJ)/gcc
718 $(MAKE) $(MAKEOPT) -j 1 -C $(PATH_OBJ)/gcc -f $(MAKEFILE) $@-it
719
720
721# When changed directory
722# We pass down BOOT_ flags for stage2+.
723# Because strip is broken on OS/2 we pass -s for release build and -g for
724# non release builds - This overrides some stuff in src/gcc/gcc/config/i386/t-emx!
725# For the 2nd stage we need a hack for using the right specs when linking...
726#SPEC_HACK = $(if $(wildchar $(PATH_OBJ)/.all-stage1),\
727# -specs $(PATH_TOP)/src/emx/src/lib/libc.specs, \
728# -specs $(PATH_TOP)/tools/x86.os2/gcc/staged/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs)
729SPECS_HACK =
730gcc-build-it: \
731 $(PATH_OBJ)/gcc/.ts.configured
732ifeq "$(BUILD_PLATFORM)" "OS2"
733 unset GCCLOAD ; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc \
734 LIBGCC2_DEBUG_CFLAGS="$(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem " \
735 CFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem" \
736 CXXFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem" \
737 BOOT_CFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem" \
738 LDFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf" \
739 BOOT_LDFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf" \
740 bootstrap
741else
742 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc bootstrap
743endif
744
745# configure it (invoked after directory change).
746# We set CC to help configure finding it.
747# We also set some LDFLAGS to get omf linking.
748gcc-configure-it $(PATH_OBJ)/gcc/.ts.configured: $(PATH_TOP)/src/gcc/configure
749ifeq "$(BUILD_PLATFORM)" "OS2"
750 $(ASH) -c " \
751 export CC=\"gcc.exe\" ; \
752 export LDFLAGS=\"$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf\" ; \
753 export BOOT_LDFLAGS=\"$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf\" ; \
754 $< \
755 --enable-clh \
756 --enable-threads=os2 \
757 --enable-shared=libgcc,bfd,opcodes \
758 --enable-nls \
759 --without-included-gettext \
760 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
761 --prefix=/gcc \
762 --with-gnu-ld \
763 --with-gnu-as \
764 --disable-libgcj \
765 --enable-languages=c,c++ "
766else
767 $(ASH) -c "$< \
768 --disable-clh \
769 --enable-shared=libgcc,bfd,opcodes \
770 --enable-nls \
771 --without-included-gettext \
772 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
773 --prefix=/gcc \
774 --with-gnu-ld \
775 --with-gnu-as \
776 --disable-libgcj \
777 --enable-languages=c,c++ "
778endif
779 touch $(PATH_OBJ)/gcc/.ts.configured
780# TODO: Andy, on Linux --enable-clh result in linking errors.
781
782# Install the GCC build
783# Repeating the prefix doesn't hurt anybody.
784gcc-install-it:
785 $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
786
787
788
789# easy, update src/gcc/gcc/version.c
790gcc-versionstamps:
791 @echo "Version stamping gcc..."
792 mv -f $(PATH_TOP)/src/gcc/gcc/version.c $(PATH_TOP)/src/gcc/gcc/version.tmp.c
793 sed -e '/version_string/s/\([0-9]\.[0-9]*\.[0-9]*\).*/\1 $(INNOTEK_VERSION)";/' \
794 $(PATH_TOP)/src/gcc/gcc/version.tmp.c > $(PATH_TOP)/src/gcc/gcc/version.c
795 rm -f $(PATH_TOP)/src/gcc/gcc/version.tmp.c
796
797
798# Install to builttools directory.
799## WARNING! Another spec HACK!
800gcc-builttools-stage2:
801 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc prefix=$(PATH_BUILTTOOLS_TMPD) install
802## cp $(PATH_TOP)/src/emx/src/lib/libc.specs $(PATH_OBJ)/gcc/gcc/specs
803
804
805# Generate diffs for GCC (v3.2.2) - part of packing a release.
806.PHONY: gcc-diff $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff
807gcc-diff: $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff
808$(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff:
809 mkdir -p $(@D)
810 $(TOOL_CVS_DIFF_TREE) $(GCC_CVS_REL) src/gcc > $@
811
812
813
814##############################################################################
815###############################################################################
816###############################################################################
817#
818# G C C - O M F f o r D e B u G i n g
819#
820###############################################################################
821###############################################################################
822###############################################################################
823all-gccomf: gccomf
824gccomf:
825 mkdir -p $(PATH_OBJ)/gccomf
826 $(NICE) $(MAKE) $(MAKEOPT) -C . gccomf-logged 2>&1 | $(UNIXROOT)/usr/bin/tee $(PATH_OBJ)/gccomf/build-`date +"%Y%m%d-%H%M%S"`.log
827
828gccomf-logged: \
829 gcc-autoconf-refresh \
830 gccomf-build
831 echo "Unbelievable!!! We just successfully completed a GCC OMF build!!!"
832
833# build the components.
834.PHONY: gccomf-build gccomf-install gccomf-configure
835gccomf-build gccomf-install gccomf-configure:
836 mkdir -p $(PATH_OBJ)/gccomf
837 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gccomf -f $(MAKEFILE) $@-it
838
839
840# Separate since we want the 'e' option
841gccomf-shell:
842 mkdir -p $(PATH_OBJ)/gccomf
843 $(MAKE) $(MAKEOPT) -e -C $(PATH_OBJ)/gccomf -f $(MAKEFILE) $@-it
844gccomf-shell-it:
845 chdir $(PATH_OBJ)/gccomf ; \
846 if test -d $(PATH_BUILTTOOLS)/omfhack; then mv -f $(PATH_BUILTTOOLS)/omfhack $(PATH_BUILTTOOLS)/omfhackbin; fi ; \
847 if test ! -d $(PATH_BUILTTOOLS)/omfhackbin; then echo "no omfhackbin"; exit 1; fi ; \
848 unset GCCLOAD; \
849 export GCC_OMF="real"; \
850 export LIBGCC2_DEBUG_CFLAGS="-g -Zhigh-mem -Zaout"; \
851 export CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
852 export CXXFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
853 export BOOT_CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
854 export LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024"; \
855 export BOOT_LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024"; \
856 $(subst \,/,$(COMSPEC)) ; \
857 mv -f $(PATH_BUILTTOOLS)/omfhackbin $(PATH_BUILTTOOLS)/omfhack
858
859
860# When changed directory
861# We pass down alot of flags here, but currently we don't use half of them as
862# we're not booting the compiler.
863
864#OMFSPEC_HACK = $(if $(wildchar $(PATH_OBJ)/.all-stage1),\
865# -specs $(PATH_TOP)/src/emx/src/lib/libc.specs, \
866# -specs $(PATH_TOP)/tools/x86.os2/gcc/staged/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs)
867OMFSPECS_HACK =
868gccomf-build-it: \
869 $(PATH_OBJ)/gccomf/.ts.configured
870ifeq "$(BUILD_PLATFORM)" "OS2"
871 if test -d $(PATH_BUILTTOOLS)/omfhack; then mv -f $(PATH_BUILTTOOLS)/omfhack $(PATH_BUILTTOOLS)/omfhackbin; fi
872 if test ! -d $(PATH_BUILTTOOLS)/omfhackbin; then echo "no omfhackbin"; exit 1; fi ; \
873 unset GCCLOAD ; export GCC_OMF="real" ; echo GCC_OMF=$$GCC_OMF; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gccomf \
874 LIBGCC2_DEBUG_CFLAGS="-g -Zhigh-mem -Zaout" \
875 CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
876 CXXFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
877 BOOT_CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
878 LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024" \
879 BOOT_LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024" \
880 -e all
881 mv -f $(PATH_BUILTTOOLS)/omfhackbin $(PATH_BUILTTOOLS)/omfhack
882else
883 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc all
884endif
885
886
887# configure it (invoked after directory change).
888# We set CC to help configure finding it.
889gccomf-configure-it $(PATH_OBJ)/gccomf/.ts.configured: $(PATH_TOP)/src/gcc/configure
890ifeq "$(BUILD_PLATFORM)" "OS2"
891 $(ASH) -c " \
892 export CC=\"gcc.exe\" ; \
893 $< \
894 --enable-clh \
895 --enable-threads=os2 \
896 --enable-shared=libgcc,bfd,opcodes \
897 --disable-nls \
898 --without-included-gettext \
899 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
900 --prefix=/gcc \
901 --with-gnu-ld \
902 --with-gnu-as \
903 --disable-libgcj \
904 --enable-languages=c,c++ "
905else
906 $(ASH) -c "$< \
907 --disable-clh \
908 --enable-shared=libgcc,bfd,opcodes \
909 --disable-nls \
910 --without-included-gettext \
911 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
912 --prefix=/gcc \
913 --with-gnu-ld \
914 --with-gnu-as \
915 --disable-libgcj \
916 --enable-languages=c,c++ "
917endif
918 touch $(PATH_OBJ)/gccomf/.ts.configured
919# TODO: Andy, on Linux --enable-clh result in linking errors.
920
921# Install the GCC build
922# Repeating the prefix doesn't hurt anybody.
923gccomf-install-it:
924 $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
925
926
927
928
929
930###############################################################################
931###############################################################################
932###############################################################################
933#
934# B i n U t i l s
935#
936###############################################################################
937###############################################################################
938###############################################################################
939
940BINUTILS_DIRS = \
941binutils/bfd \
942binutils/opcodes \
943binutils/gas \
944binutils/gprof \
945binutils/binutils \
946binutils/ld \
947
948BINUTILS_NOT_DIRS =\
949binutils/etc \
950binutils/libiberty
951#binutils/intl
952
953
954BINUTILS_CONFIGURE_DIRS = $(BINUTILS_DIRS) $(BINUTILS_NOT_DIRS)
955
956all-binutils binutils:
957 echo "Binutils are build together with the other GNU Tools in GCC."
958 echo "Separate building of binutils is not configured."
959
960all-binutils214 binutils214: \
961 binutils-autoconf-refresh \
962 binutils-build
963 echo "Successfully build Binutils v2.14."
964
965
966
967# configure.in/configure
968.PHONY: binutils-autoconf-refresh binutils-autoconf-rerun binutils-autoconf-clean binutils-autoconf-remove
969binutils-autoconf-refresh binutils-autoconf-rerun binutils-autoconf-clean binutils-autoconf-remove:
970ifeq "$(BUILD_PLATFORM)" "LINUX"
971 -$(SH) $(PATH_TOP)/xfix.sh
972endif
973 for dir in $(BINUTILS_CONFIGURE_DIRS); do \
974 if $(MAKE) $(MAKEOPT) -j 1 $(@:binutils-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; then \
975 true; \
976 else \
977 exit 8; \
978 fi \
979 done
980
981
982# build the components.
983.PHONY: binutils-build binutils-install binutils-configure
984binutils-build binutils-install binutils-configure:
985 mkdir -p $(PATH_OBJ)/binutils
986 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/binutils -f $(MAKEFILE) $@-it
987
988
989# When changed directory
990binutils-build-it: \
991 $(PATH_OBJ)/binutils/.ts.configured
992 $(ASH) -c " unset GCCLOAD ; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/binutils "
993
994# configure it (invoked after directory change).
995# We set CC to help configure finding it.
996# And we reconfigure libiberty to the gcc one.
997binutils-configure-it $(PATH_OBJ)/binutils/.ts.configured: $(PATH_TOP)/src/binutils/configure
998ifeq "$(BUILD_PLATFORM)" "OS2"
999 $(ASH) -c " \
1000 export CC=\"gcc.exe\" ; \
1001 $< \
1002 --enable-clh \
1003 --enable-threads=os2 \
1004 --enable-shared=libgcc,bfd,opcodes \
1005 --enable-nls \
1006 --without-included-gettext \
1007 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
1008 --prefix=/gcc \
1009 --with-gnu-ld \
1010 --with-gnu-as \
1011 --disable-libgcj \
1012 --enable-languages=c,c++ "
1013else
1014 $(ASH) -c "$< \
1015 --disable-clh \
1016 --enable-shared=libgcc,bfd,opcodes \
1017 --enable-nls \
1018 --without-included-gettext \
1019 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
1020 --prefix=/gcc \
1021 --with-gnu-ld \
1022 --with-gnu-as \
1023 --disable-libgcj \
1024 --enable-languages=c,c++ "
1025endif
1026 mkdir -p libiberty
1027# Not any longer.
1028# $(ASH) -c "cd libiberty && \
1029# $(PATH_TOP)/src/gcc/libiberty/configure \
1030# --prefix=$(ALL_PREFIX) "
1031 touch $(PATH_OBJ)/binutils/.ts.configured
1032
1033
1034# Install the Binutils build
1035# Repeating the prefix doesn't hurt anybody.
1036binutils-install-it:
1037 $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
1038
1039
1040# Not so easy, need to patch a few files.
1041binutils-versionstamps:
1042 @echo "Version stamping binutils..."
1043 cp -f $(PATH_TOP)/src/binutils/binutils/version.c $(PATH_TOP)/src/binutils/binutils/version.tmp.c
1044 sed -e '/printf.*program_version/s/%s %s.*\\n/%s %s $(INNOTEK_VERSION)\\n/' \
1045 $(PATH_TOP)/src/binutils/binutils/version.tmp.c > $(PATH_TOP)/src/binutils/binutils/version.c
1046 rm -f $(PATH_TOP)/src/binutils/binutils/version.tmp.c
1047 if [ -f $(PATH_TOP)/src/gcc/binutils/version.c ]; then \
1048 cp -f $(PATH_TOP)/src/gcc/binutils/version.c $(PATH_TOP)/src/gcc/binutils/version.tmp.c && \
1049 sed -e '/printf.*program_version/s/%s %s.*\\n/%s %s $(INNOTEK_VERSION)\\n/' \
1050 $(PATH_TOP)/src/gcc/binutils/version.tmp.c > $(PATH_TOP)/src/gcc/binutils/version.c && \
1051 rm -f $(PATH_TOP)/src/gcc/binutils/version.tmp.c ; \
1052 fi
1053 @echo "Version stamping gas..."
1054 cp -f $(PATH_TOP)/src/binutils/gas/as.c $(PATH_TOP)/src/binutils/gas/as.tmp.c
1055 sed -e '/printf.*GNU.*assembler/s/%s.*\\n/%s $(INNOTEK_VERSION)\\n/' \
1056 -e '/fprintf.*GNU.*assembler.*version.*BFD.*/s/using BFD version %s.*/using BFD version %s $(INNOTEK_VERSION)"),/ ' \
1057 $(PATH_TOP)/src/binutils/gas/as.tmp.c > $(PATH_TOP)/src/binutils/gas/as.c
1058 rm -f $(PATH_TOP)/src/binutils/gas/as.tmp.c
1059 if [ -f $(PATH_TOP)/src/gcc/gas/as.c ]; then \
1060 cp -f $(PATH_TOP)/src/gcc/gas/as.c $(PATH_TOP)/src/gcc/gas/as.tmp.c && \
1061 sed -e '/printf.*GNU.*assembler/s/%s.*\\n/%s $(INNOTEK_VERSION)\\n/' \
1062 -e '/fprintf.*GNU.*assembler.*version.*BFD.*/s/using BFD version %s.*/using BFD version %s $(INNOTEK_VERSION)"),/ ' \
1063 $(PATH_TOP)/src/gcc/gas/as.tmp.c > $(PATH_TOP)/src/gcc/gas/as.c && \
1064 rm -f $(PATH_TOP)/src/gcc/gas/as.tmp.c ; \
1065 fi
1066 @echo "Version stamping ld..."
1067 cp -f $(PATH_TOP)/src/binutils/ld/ldver.c $(PATH_TOP)/src/binutils/ld/ldver.tmp.c
1068 sed -e '/fprintf.*GNU.*ld.*version/s/(with BFD %s).*/(with BFD %s) $(INNOTEK_VERSION)\\n"),/' \
1069 $(PATH_TOP)/src/binutils/ld/ldver.tmp.c > $(PATH_TOP)/src/binutils/ld/ldver.c
1070 rm -f $(PATH_TOP)/src/binutils/ld/ldver.tmp.c
1071 if [ -f $(PATH_TOP)/src/gcc/ld/ldver.c ]; then \
1072 cp -f $(PATH_TOP)/src/gcc/ld/ldver.c $(PATH_TOP)/src/gcc/ld/ldver.tmp.c && \
1073 sed -e '/fprintf.*GNU.*ld.*version/s/(with BFD %s).*/(with BFD %s) $(INNOTEK_VERSION)\\n"),/' \
1074 $(PATH_TOP)/src/gcc/ld/ldver.tmp.c > $(PATH_TOP)/src/gcc/ld/ldver.c && \
1075 rm -f $(PATH_TOP)/src/gcc/ld/ldver.tmp.c ; \
1076 fi
1077
1078
1079
1080# Generate diffs for Binutils (part of packing).
1081.PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff
1082binutils-diff: $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff
1083$(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff:
1084 mkdir -p $(@D)
1085 $(TOOL_CVS_DIFF_TREE) $(BINUTILS_CVS_REL) src/binutils > $@
1086
1087
1088
1089
1090
1091
1092
1093
1094###############################################################################
1095###############################################################################
1096###############################################################################
1097#
1098# E M X
1099#
1100###############################################################################
1101###############################################################################
1102###############################################################################
1103all-emx emx: \
1104 emx-build
1105 @echo "Successfully build EMX."
1106
1107# Some helpers.
1108# TODO: Change OUT and INS to the right ones. Currently not possible as
1109# doing such breaks the rules generating.
1110EMX_MODE = dbg
1111ifeq "$(BUILD_MODE)" "RELEASE"
1112EMX_MODE = opt
1113endif
1114EMX_OUT = out/
1115EMX_INS = out/install/
1116#EMX_OUT = $(PATH_OBJ)/emx/
1117#EMX_INS = $(ALL_PREFIX)/
1118EMX_MASM = $(PATH_TOP)/tools/x86.os2/masm/v6.0/binp/ml.exe
1119EMX_DEFINES = OUT=$(EMX_OUT) INS=$(EMX_INS) MODE=$(EMX_MODE) "ASM=$(EMX_MASM) -c"
1120
1121# build the components. (directory changer rules)
1122.PHONY: emx-build emx-install emx-configure
1123emx-build emx-install emx-configure:
1124 mkdir -p $(PATH_OBJ)/emx
1125 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx -f $(MAKEFILE) $@-it
1126
1127# This is the configure equivalent.
1128emx-configure-it:
1129 @echo ...
1130
1131# make handle issue here. Make portions at the time.
1132emx-build-it:
1133 $(MAKE) $(MAKEOPT) -j 1 -C $(PATH_TOP)/src/emx $(EMX_DEFINES) tools
1134 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) all
1135
1136emx-install-it:
1137 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) INS=$(ALL_PREFIX)/ install
1138
1139
1140# We pass down the INNOTEK_VERSION define when building EMX.
1141emx-versionstamps:
1142 @echo "Version stamping EMX... nothing to do"
1143
1144# Install the compiled emx stuff to builttools.
1145##emx-builttools-stage2: emx-builttools-stage2-specs
1146emx-builttools-stage2:
1147 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) INS=$(PATH_BUILTTOOLS_TMP)/ install
1148
1149## bird: for now we will just replace the specs with the constantly updated libc specs.
1150emx-builttools-stage2-specs:
1151## -mv -f $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs \
1152## $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/emxspecs
1153## cp $(PATH_TOP)/src/emx/src/lib/libc.specs \
1154## $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs
1155
1156
1157# Generate diffs for Binutils (part of packing).
1158.PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
1159emx-diff: $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
1160$(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff:
1161 mkdir -p $(@D)
1162 $(TOOL_CVS_DIFF_TREE) $(EMX_CVS_REL) src/emx > $@
1163
1164
1165
1166
1167
1168###############################################################################
1169###############################################################################
1170###############################################################################
1171#
1172# P A C K I N G
1173#
1174###############################################################################
1175###############################################################################
1176###############################################################################
1177packing: \
1178 packing-all \
1179 packing-doc \
1180 packing-libc \
1181 packing-core \
1182 packing-dbg \
1183 packing-prf \
1184
1185ZIPFLAGS=-rX9
1186ZIPBASE=$(PATH_BIN)/GCC-$(GCC_VERSION)-beta3fix1
1187
1188packing-all:
1189 rm -f $(ZIPBASE).zip
1190 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE).zip *
1191
1192packing-doc:
1193 rm -f $(ZIPBASE)-doc.zip
1194 cd $(ALL_PREFIX)/..; zip $(ZIPFLAGS) $(ZIPBASE)-doc.zip usr/doc/GCC-$(GCC_VERSION)/*
1195
1196packing-libc:
1197 rm -f $(PATH_BIN)/libc.zip
1198 cd $(ALL_PREFIX)/lib; zip $(ZIPFLAGS) $(PATH_BIN)/libc.zip libc*.dll gcc*.dll
1199
1200packing-core:
1201 rm -f $(ZIPBASE)-core.zip
1202 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
1203 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-core.zip usr/lib/libc*dbg usr/lib/end.lib
1204
1205packing-dbg:
1206 rm -f $(ZIPBASE)-dbg.zip
1207 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-dbg.zip . -i \*.dbg -i \*.map -i \*.elh -i \*.sym -i usr/lib/dbg/\*
1208
1209packing-prf:
1210 rm -f $(ZIPBASE)-prf.zip
1211 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-prf.zip . -i \*_p.\* -i \*.prf
1212
1213packing-src: \
1214 packing-src-gcc \
1215 packing-src-binutils \
1216 packing-src-emx \
1217
1218packing-src-gcc:
1219 rm -f $(ZIPBASE)-src-GCC.zip
1220 zip $(ZIPFLAGS) $(ZIPBASE)-src-GCC.zip src/gcc -x \*CVS\*
1221
1222packing-src-binutils:
1223 rm -f $(ZIPBASE)-src-binutils.zip
1224 zip $(ZIPFLAGS) $(ZIPBASE)-src-binutils.zip src/binutils -x \*CVS\*
1225
1226packing-src-emx:
1227 rm -f $(ZIPBASE)-src-emx.zip
1228 zip $(subst r,,$(ZIPFLAGS)) $(ZIPBASE)-src-emx.zip src/emx/* -x \*CVS\* -x \*testcase\* -x \*out\*
1229 zip $(ZIPFLAGS) $(ZIPBASE)-src-emx.zip src/emx/src/* src/emx/include/* src/emx/src/bsd/* -x \*CVS\*
1230
1231
1232
1233###############################################################################
1234###############################################################################
1235###############################################################################
1236#
1237# M I S C
1238#
1239###############################################################################
1240###############################################################################
1241###############################################################################
1242
1243misc-install:
1244 mkdir -p $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1245 mkdir -p $(ALL_PREFIX)/lib
1246 mkdir -p $(ALL_PREFIX)/bin
1247 cp $(PATH_TOP)/doc/ReleaseNotes.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1248 cp $(PATH_TOP)/doc/MailingLists.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1249 cp $(PATH_TOP)/doc/Install.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1250 cp $(PATH_TOP)/doc/Licenses.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1251 cp $(PATH_TOP)/doc/COPYING.LIB $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1252 cp $(PATH_TOP)/doc/COPYING $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1253 cp $(PATH_TOP)/ChangeLog $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)/ChangeLog.os2
1254 cp $(PATH_TOP)/src/install/MakeOmfLibs.cmd $(ALL_PREFIX)/lib
1255 cp $(PATH_TOP)/src/misc/dllar.cmd $(ALL_PREFIX)/bin
1256 cp $(PATH_TOP)/src/misc/gccenv.cmd $(ALL_PREFIX)/bin
1257 ar cr $(ALL_PREFIX)/lib/m.a
1258
1259
1260dejagnu:
1261# nothing to make at the moment, it's just a all install stuff it seems.
1262
1263requires_autoconf_2_52_DEJAGNU_CONFIGURE_DIRS = \
1264src/misc/dejagnu \
1265src/misc/dejagnu/contrib/bluegnu2.0.3 \
1266src/misc/dejagnu/contrib/bluegnu2.0.3/doc \
1267src/misc/dejagnu/contrib/bluegnu2.0.3/example \
1268src/misc/dejagnu/contrib/bluegnu2.0.3/example/calc \
1269src/misc/dejagnu/contrib/bluegnu2.0.3/testsuite \
1270src/misc/dejagnu/example/calc \
1271src/misc/dejagnu/example/hello
1272
1273.PHONY: dejagnu-autoconf-refresh dejagnu-autoconf-rerun dejagnu-autoconf-clean dejagnu-autoconf-remove
1274dejagnu-autoconf-refresh dejagnu-autoconf-rerun dejagnu-autoconf-clean dejagnu-autoconf-remove:
1275ifeq "$(BUILD_PLATFORM)" "LINUX"
1276 -$(SH) $(PATH_TOP)/xfix.sh
1277endif
1278 for dir in $(DEJAGNU_CONFIGURE_DIRS); do \
1279 if $(MAKE) $(MAKEOPT) -j 1 $(@:dejagnu-autoconf-%=%) -f $(PWD)/config.gmk -C $$dir ; then \
1280 true; \
1281 else \
1282 exit 8; \
1283 fi \
1284 done
1285
1286
1287
1288#
1289# Expect
1290#
1291
1292expect:
1293
1294
1295# build the components.
1296.PHONY: expect-build expect-install expect-configure
1297expect-build expect-install expect-configure:
1298 mkdir -p $(PATH_OBJ)/misc/expect
1299 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/misc/expect -f $(MAKEFILE) $@-it
1300
1301
1302# When changed directory
1303expect-build-it: \
1304 $(PATH_OBJ)/misc/expect/.ts.configured
1305 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/misc/expect
1306
1307# configure it (invoked after directory change).
1308# We set CC to help configure finding it.
1309# And we reconfigure libiberty to the gcc one.
1310expect-configure-it $(PATH_OBJ)/misc/expect/.ts.configured: $(PATH_TOP)/src/misc/expect/configure
1311ifeq "$(BUILD_PLATFORM)" "OS2"
1312 $(ASH) -c " \
1313 export CC=\"gcc.exe\" ; \
1314 $< \
1315 --disable-shared \
1316 --host=i386-pc-os2-emx \
1317 --with-tclconfig=$(UNIXROOT)/usr/lib \
1318 --with-tclinclude=$(UNIXROOT)/usr/lib/tcl8.0/include \
1319 --enable-gcc \
1320 $(BUILD_ENABLE_SYMBOLS) \
1321 --prefix=$(PATH_BUILTTOOLSD) "
1322else
1323 $(ASH) -c " \
1324 $< \
1325 --enable-gcc \
1326 $(BUILD_ENABLE_SYMBOLS) \
1327 --prefix=$(PATH_BUILTTOOLSD) "
1328endif
1329 touch $(PATH_OBJ)/misc/expect/.ts.configured
1330
1331
1332# install to builttools (if anywhere!)
1333expect-install-it:
1334 $(MAKE) $(MAKEOPT) prefix=$(PATH_BUILTTOOLSD) install
1335
1336
1337
1338EXPECT_CONFIGURE_DIRS = \
1339src/misc/expect
1340# skipping testsuite for now as it requires some .m4 files we don't have.
1341#src/misc/expect/testsuite
1342
1343.PHONY: expect-autoconf-refresh expect-autoconf-rerun expect-autoconf-clean expect-autoconf-remove
1344expect-autoconf-refresh expect-autoconf-rerun expect-autoconf-clean expect-autoconf-remove:
1345ifeq "$(BUILD_PLATFORM)" "LINUX"
1346 -$(SH) $(PATH_TOP)/xfix.sh
1347endif
1348 for dir in $(EXPECT_CONFIGURE_DIRS); do \
1349 if $(MAKE) $(MAKEOPT) -j 1 $(@:expect-autoconf-%=%) -f $(PWD)/config.gmk -C $$dir ; then \
1350 true; \
1351 else \
1352 exit 8; \
1353 fi \
1354 done
1355
1356
1357
1358#
1359# Checkout rule
1360#
1361checkout update:
1362 cvs -q update -d 2>&1 | tee up.log
1363
1364# DO NOT DELETE
Note: See TracBrowser for help on using the repository browser.