source: trunk/Makefile@ 689

Last change on this file since 689 was 662, checked in by bird, 22 years ago

Multijob make.

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