source: trunk/Makefile@ 830

Last change on this file since 830 was 813, checked in by bird, 22 years ago

beta3

  • Property cvs2svn:cvs-rev set to 1.55
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 43.6 KB
RevLine 
[25]1# $Id: Makefile 813 2003-10-06 14:37:44Z 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 \
[810]683 LIBGCC2_DEBUG_CFLAGS="$(BUILD_DEBUGINFO) -Zhigh-mem " \
684 CFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -O2" \
685 CXXFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -O2" \
686 BOOT_CFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -O2 -mcpu=pentium -mpreferred-stack-boundary=2 -malign-strings=0 -falign-loops=2 -falign-jumps=2 -falign-functions=2" \
687 LDFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zexe -Zcrtdll -Zstack 1024" \
688 BOOT_LDFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -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 ; \
[711]793 if test ! -d $(PATH_BUILTTOOLS)/omfhackbin; then echo "no omfhackbin"; exit 1; fi ; \
[468]794 unset GCCLOAD; \
795 export GCC_OMF="real"; \
[810]796 export LIBGCC2_DEBUG_CFLAGS="-g -Zhigh-mem -Zaout"; \
797 export CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
798 export CXXFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
799 export BOOT_CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
800 export LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zexe -Zcrtdll -Zstack 1024"; \
801 export BOOT_LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zexe -Zcrtdll -Zstack 1024"; \
[468]802 $(subst \,/,$(COMSPEC)) ; \
803 mv -f $(PATH_BUILTTOOLS)/omfhackbin $(PATH_BUILTTOOLS)/omfhack
804
805
806# When changed directory
[565]807# We pass down alot of flags here, but currently we don't use half of them as
[468]808# we're not booting the compiler.
809
810#OMFSPEC_HACK = $(if $(wildchar $(PATH_OBJ)/.all-stage1),\
811# -specs $(PATH_TOP)/src/emx/src/lib/libc.specs, \
812# -specs $(PATH_TOP)/tools/x86.os2/gcc/staged/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs)
813OMFSPECS_HACK =
814gccomf-build-it: \
815 $(PATH_OBJ)/gccomf/.ts.configured
816ifeq "$(BUILD_PLATFORM)" "OS2"
817 if test -d $(PATH_BUILTTOOLS)/omfhack; then mv -f $(PATH_BUILTTOOLS)/omfhack $(PATH_BUILTTOOLS)/omfhackbin; fi
[711]818 if test ! -d $(PATH_BUILTTOOLS)/omfhackbin; then echo "no omfhackbin"; exit 1; fi ; \
[662]819 unset GCCLOAD ; export GCC_OMF="real" ; echo GCC_OMF=$$GCC_OMF; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gccomf \
[810]820 LIBGCC2_DEBUG_CFLAGS="-g -Zhigh-mem -Zaout" \
821 CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
822 CXXFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
823 BOOT_CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
824 LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zexe -Zcrtdll -Zstack 1024" \
825 BOOT_LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zexe -Zcrtdll -Zstack 1024" \
[565]826 -e all
[468]827 mv -f $(PATH_BUILTTOOLS)/omfhackbin $(PATH_BUILTTOOLS)/omfhack
828else
[662]829 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc all
[468]830endif
831
832
833# configure it (invoked after directory change).
834# We set CC to help configure finding it.
835gccomf-configure-it $(PATH_OBJ)/gccomf/.ts.configured: $(PATH_TOP)/src/gcc/configure
836ifeq "$(BUILD_PLATFORM)" "OS2"
837 $(ASH) -c " \
838 export CC=\"gcc.exe\" ; \
839 $< \
840 --enable-clh \
841 --enable-threads=os2 \
842 --enable-shared=libgcc,bfd,opcodes \
843 --disable-nls \
844 --without-included-gettext \
845 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
846 --prefix=/gcc \
847 --with-gnu-ld \
848 --with-gnu-as \
849 --disable-libgcj \
850 --enable-languages=c,c++ "
851else
852 $(ASH) -c "$< \
853 --disable-clh \
854 --enable-shared=libgcc,bfd,opcodes \
855 --disable-nls \
856 --without-included-gettext \
857 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
858 --prefix=/gcc \
859 --with-gnu-ld \
860 --with-gnu-as \
861 --disable-libgcj \
862 --enable-languages=c,c++ "
863endif
864 touch $(PATH_OBJ)/gccomf/.ts.configured
865# TODO: Andy, on Linux --enable-clh result in linking errors.
866
867# Install the GCC build
868# Repeating the prefix doesn't hurt anybody.
869gccomf-install-it:
[662]870 $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
[468]871
872
873
874
875
[25]876###############################################################################
877###############################################################################
878###############################################################################
[34]879#
[25]880# B i n U t i l s
[34]881#
[25]882###############################################################################
883###############################################################################
884###############################################################################
[96]885
886BINUTILS_DIRS = \
887binutils/bfd \
888binutils/opcodes \
889binutils/gas \
890binutils/gprof \
891binutils/binutils \
892binutils/ld \
893
894BINUTILS_NOT_DIRS =\
895binutils/etc \
896binutils/libiberty \
897binutils/intl \
898
899
900BINUTILS_CONFIGURE_DIRS = $(BINUTILS_DIRS) $(BINUTILS_NOT_DIRS)
901
[25]902all-binutils binutils:
[89]903 echo "Binutils are build together with the other GNU Tools in GCC."
904 echo "Separate building of binutils is not configured."
[25]905
[628]906all-binutils214 binutils214: \
907 binutils-autoconf-refresh \
908 binutils-build
909 echo "Successfully build Binutils v2.14."
[25]910
911
[628]912
[96]913# configure.in/configure
914.PHONY: binutils-autoconf-refresh binutils-autoconf-rerun binutils-autoconf-clean binutils-autoconf-remove
915binutils-autoconf-refresh binutils-autoconf-rerun binutils-autoconf-clean binutils-autoconf-remove:
916ifeq "$(BUILD_PLATFORM)" "LINUX"
917 -$(SH) $(PATH_TOP)/xfix.sh
918endif
919 for dir in $(BINUTILS_CONFIGURE_DIRS); do \
[662]920 if $(MAKE) $(MAKEOPT) -j 1 $(@:binutils-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; then \
[96]921 true; \
922 else \
923 exit 8; \
924 fi \
925 done
926
927
928# build the components.
929.PHONY: binutils-build binutils-install binutils-configure
930binutils-build binutils-install binutils-configure:
931 mkdir -p $(PATH_OBJ)/binutils
[662]932 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/binutils -f $(MAKEFILE) $@-it
[96]933
934
935# When changed directory
936binutils-build-it: \
937 $(PATH_OBJ)/binutils/.ts.configured
[662]938 $(ASH) -c " unset GCCLOAD ; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/binutils "
[96]939
940# configure it (invoked after directory change).
941# We set CC to help configure finding it.
[98]942# And we reconfigure libiberty to the gcc one.
[96]943binutils-configure-it $(PATH_OBJ)/binutils/.ts.configured: $(PATH_TOP)/src/binutils/configure
[627]944ifeq "$(BUILD_PLATFORM)" "OS2"
[96]945 $(ASH) -c " \
946 export CC=\"gcc.exe\" ; \
947 $< \
[627]948 --enable-clh \
949 --enable-threads=os2 \
950 --enable-shared=libgcc,bfd,opcodes \
951 --enable-nls \
952 --without-included-gettext \
953 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
954 --prefix=/gcc \
955 --with-gnu-ld \
956 --with-gnu-as \
957 --disable-libgcj \
958 --enable-languages=c,c++ "
959else
960 $(ASH) -c "$< \
961 --disable-clh \
962 --enable-shared=libgcc,bfd,opcodes \
963 --enable-nls \
964 --without-included-gettext \
965 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
966 --prefix=/gcc \
967 --with-gnu-ld \
968 --with-gnu-as \
969 --disable-libgcj \
970 --enable-languages=c,c++ "
971endif
972 mkdir -p libiberty
973# Not any longer.
974# $(ASH) -c "cd libiberty && \
975# $(PATH_TOP)/src/gcc/libiberty/configure \
976# --prefix=$(ALL_PREFIX) "
[96]977 touch $(PATH_OBJ)/binutils/.ts.configured
978
979
980# Install the Binutils build
981# Repeating the prefix doesn't hurt anybody.
982binutils-install-it:
[662]983 $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
[96]984
985
[111]986# Not so easy, need to patch a few files.
987binutils-versionstamps:
988 @echo "Version stamping binutils..."
989 cp -f $(PATH_TOP)/src/binutils/binutils/version.c $(PATH_TOP)/src/binutils/binutils/version.tmp.c
990 sed -e '/printf.*program_version/s/%s %s.*\\n/%s %s $(INNOTEK_VERSION)\\n/' \
991 $(PATH_TOP)/src/binutils/binutils/version.tmp.c > $(PATH_TOP)/src/binutils/binutils/version.c
992 rm -f $(PATH_TOP)/src/binutils/binutils/version.tmp.c
993 if [ -f $(PATH_TOP)/src/gcc/binutils/version.c ]; then \
994 cp -f $(PATH_TOP)/src/gcc/binutils/version.c $(PATH_TOP)/src/gcc/binutils/version.tmp.c && \
995 sed -e '/printf.*program_version/s/%s %s.*\\n/%s %s $(INNOTEK_VERSION)\\n/' \
996 $(PATH_TOP)/src/gcc/binutils/version.tmp.c > $(PATH_TOP)/src/gcc/binutils/version.c && \
997 rm -f $(PATH_TOP)/src/gcc/binutils/version.tmp.c ; \
998 fi
999 @echo "Version stamping gas..."
1000 cp -f $(PATH_TOP)/src/binutils/gas/as.c $(PATH_TOP)/src/binutils/gas/as.tmp.c
1001 sed -e '/printf.*GNU.*assembler/s/%s.*\\n/%s $(INNOTEK_VERSION)\\n/' \
1002 -e '/fprintf.*GNU.*assembler.*version.*BFD.*/s/using BFD version %s.*/using BFD version %s $(INNOTEK_VERSION)"),/ ' \
1003 $(PATH_TOP)/src/binutils/gas/as.tmp.c > $(PATH_TOP)/src/binutils/gas/as.c
1004 rm -f $(PATH_TOP)/src/binutils/gas/as.tmp.c
1005 if [ -f $(PATH_TOP)/src/gcc/gas/as.c ]; then \
1006 cp -f $(PATH_TOP)/src/gcc/gas/as.c $(PATH_TOP)/src/gcc/gas/as.tmp.c && \
1007 sed -e '/printf.*GNU.*assembler/s/%s.*\\n/%s $(INNOTEK_VERSION)\\n/' \
1008 -e '/fprintf.*GNU.*assembler.*version.*BFD.*/s/using BFD version %s.*/using BFD version %s $(INNOTEK_VERSION)"),/ ' \
1009 $(PATH_TOP)/src/gcc/gas/as.tmp.c > $(PATH_TOP)/src/gcc/gas/as.c && \
1010 rm -f $(PATH_TOP)/src/gcc/gas/as.tmp.c ; \
1011 fi
1012 @echo "Version stamping ld..."
1013 cp -f $(PATH_TOP)/src/binutils/ld/ldver.c $(PATH_TOP)/src/binutils/ld/ldver.tmp.c
1014 sed -e '/fprintf.*GNU.*ld.*version/s/(with BFD %s).*/(with BFD %s) $(INNOTEK_VERSION)\\n"),/' \
1015 $(PATH_TOP)/src/binutils/ld/ldver.tmp.c > $(PATH_TOP)/src/binutils/ld/ldver.c
1016 rm -f $(PATH_TOP)/src/binutils/ld/ldver.tmp.c
1017 if [ -f $(PATH_TOP)/src/gcc/ld/ldver.c ]; then \
1018 cp -f $(PATH_TOP)/src/gcc/ld/ldver.c $(PATH_TOP)/src/gcc/ld/ldver.tmp.c && \
1019 sed -e '/fprintf.*GNU.*ld.*version/s/(with BFD %s).*/(with BFD %s) $(INNOTEK_VERSION)\\n"),/' \
1020 $(PATH_TOP)/src/gcc/ld/ldver.tmp.c > $(PATH_TOP)/src/gcc/ld/ldver.c && \
1021 rm -f $(PATH_TOP)/src/gcc/ld/ldver.tmp.c ; \
1022 fi
1023
[96]1024
[111]1025
[109]1026# Generate diffs for Binutils (part of packing).
1027.PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff
1028binutils-diff: $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff
1029$(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff:
[89]1030 mkdir -p $(@D)
[109]1031 $(TOOL_CVS_DIFF_TREE) $(BINUTILS_CVS_REL) src/binutils > $@
[98]1032
1033
1034
[109]1035
[98]1036
[89]1037
[25]1038
[96]1039
[25]1040###############################################################################
1041###############################################################################
1042###############################################################################
[34]1043#
[25]1044# E M X
[34]1045#
[25]1046###############################################################################
1047###############################################################################
1048###############################################################################
[120]1049all-emx emx: \
1050 emx-build
1051 @echo "Successfully build EMX."
[25]1052
[120]1053# Some helpers.
1054# TODO: Change OUT and INS to the right ones. Currently not possible as
1055# doing such breaks the rules generating.
1056EMX_MODE = dbg
1057ifeq "$(BUILD_MODE)" "RELEASE"
1058EMX_MODE = opt
1059endif
[265]1060EMX_OUT = out/
[120]1061EMX_INS = out/install/
[265]1062EMX_RULES= $(PATH_TOP)/src/emx/$(EMX_OUT)$(EMX_MODE)/genrules.smak
1063#EMX_OUT = $(PATH_OBJ)/emx/
1064#EMX_INS = $(ALL_PREFIX)/
1065#EMX_RULES= $(EMX_OUT)$(EMX_MODE)/genrules.smak
[120]1066EMX_MASM = $(PATH_TOP)/tools/x86.os2/masm/v6.0/binp/ml.exe
1067EMX_DEFINES = OUT=$(EMX_OUT) INS=$(EMX_INS) MODE=$(EMX_MODE) "ASM=$(EMX_MASM) -c"
[109]1068
[120]1069# build the components. (directory changer rules)
1070.PHONY: emx-build emx-install emx-configure
1071emx-build emx-install emx-configure:
1072 mkdir -p $(PATH_OBJ)/emx
[662]1073 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx -f $(MAKEFILE) $@-it
[120]1074
1075# This is the configure equivalent.
[265]1076emx-configure-it: $(EMX_RULES)
1077$(EMX_RULES):
1078 rm -f $(EMX_RULES)
[662]1079 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) $(EMX_RULES)
[120]1080
[265]1081# make handle issue here. Make portions at the time.
1082emx-build-it: $(EMX_RULES)
[662]1083 $(MAKE) $(MAKEOPT) -j 1 -C $(PATH_TOP)/src/emx $(EMX_DEFINES) tools
1084 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) os2
1085 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libc
1086 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) app
1087 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) alias
1088 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) regexp
1089 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libc-dll
1090 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libsocket libdl
1091 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libs
1092 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) all
[120]1093
[265]1094emx-install-it: $(EMX_RULES)
[662]1095 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) INS=$(ALL_PREFIX)/ install
[120]1096
1097
[565]1098# We pass down the INNOTEK_VERSION define when building EMX.
[111]1099emx-versionstamps:
[565]1100 @echo "Version stamping EMX... nothing to do"
[109]1101
[120]1102# Install the compiled emx stuff to builttools.
[282]1103##emx-builttools-stage2: emx-builttools-stage2-specs
1104emx-builttools-stage2:
[662]1105 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) INS=$(PATH_BUILTTOOLS_TMP)/ install
[120]1106
[282]1107## bird: for now we will just replace the specs with the constantly updated libc specs.
[255]1108emx-builttools-stage2-specs:
[363]1109## -mv -f $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs \
1110## $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/emxspecs
[282]1111## cp $(PATH_TOP)/src/emx/src/lib/libc.specs \
[363]1112## $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs
[120]1113
[255]1114
[109]1115# Generate diffs for Binutils (part of packing).
1116.PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
1117emx-diff: $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
1118$(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff:
1119 mkdir -p $(@D)
1120 $(TOOL_CVS_DIFF_TREE) $(EMX_CVS_REL) src/emx > $@
[111]1121
[122]1122
[402]1123
1124
1125
1126###############################################################################
1127###############################################################################
1128###############################################################################
1129#
1130# P A C K I N G
1131#
1132###############################################################################
1133###############################################################################
1134###############################################################################
[577]1135packing: \
1136 packing-all \
[708]1137 packing-doc \
[583]1138 packing-libc \
[577]1139 packing-core \
1140 packing-dbg \
[583]1141 packing-prf \
[577]1142
[583]1143ZIPFLAGS=-rX9
[813]1144ZIPBASE=$(PATH_BIN)/GCC-$(GCC_VERSION)-beta3
[577]1145
1146packing-all:
[583]1147 rm -f $(ZIPBASE).zip
1148 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE).zip *
[402]1149
[708]1150packing-doc:
1151 rm -f $(ZIPBASE)-doc.zip
1152 cd $(ALL_PREFIX)/..; zip $(ZIPFLAGS) $(ZIPBASE)-doc.zip usr/doc/GCC-$(GCC_VERSION)/* -x Change\*
1153
[583]1154packing-libc:
1155 rm -f $(PATH_BIN)/libc.zip
1156 cd $(ALL_PREFIX)/lib; zip $(ZIPFLAGS) $(PATH_BIN)/libc.zip libc*.dll gcc*.dll
1157
[577]1158packing-core:
[583]1159 rm -f $(ZIPBASE)-core.zip
1160 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
1161 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-core.zip usr/lib/libc*dbg usr/lib/end.lib
[122]1162
[577]1163packing-dbg:
[583]1164 rm -f $(ZIPBASE)-dbg.zip
1165 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-dbg.zip . -i \*.dbg -i \*.map -i \*.elh -i \*.sym -i usr/lib/dbg/\*
[577]1166
[583]1167packing-prf:
1168 rm -f $(ZIPBASE)-prf.zip
1169 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-prf.zip . -i \*_p.\* -i \*.prf
1170
1171packing-src: \
1172 packing-src-gcc \
1173 packing-src-binutils \
1174 packing-src-emx \
1175
1176packing-src-gcc:
1177 rm -f $(ZIPBASE)-src-GCC.zip
1178 zip $(ZIPFLAGS) $(ZIPBASE)-src-GCC.zip src/gcc -x \*CVS\*
1179
1180packing-src-binutils:
1181 rm -f $(ZIPBASE)-src-binutils.zip
1182 zip $(ZIPFLAGS) $(ZIPBASE)-src-binutils.zip src/binutils -x \*CVS\*
1183
1184packing-src-emx:
1185 rm -f $(ZIPBASE)-src-emx.zip
1186 zip $(subst r,,$(ZIPFLAGS)) $(ZIPBASE)-src-emx.zip src/emx/* -x \*CVS\* -x \*testcase\* -x \*out\*
1187 zip $(ZIPFLAGS) $(ZIPBASE)-src-emx.zip src/emx/src/* src/emx/include/* src/emx/src/bsd/* -x \*CVS\*
[627]1188
[568]1189
1190
[122]1191###############################################################################
1192###############################################################################
1193###############################################################################
1194#
1195# M I S C
1196#
1197###############################################################################
1198###############################################################################
1199###############################################################################
1200
[568]1201misc-install:
1202 mkdir -p $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1203 mkdir -p $(ALL_PREFIX)/lib
1204 mkdir -p $(ALL_PREFIX)/bin
1205 cp $(PATH_TOP)/doc/ReleaseNotes.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
[703]1206 cp $(PATH_TOP)/doc/MailingLists.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
[568]1207 cp $(PATH_TOP)/doc/Install.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
[705]1208 cp $(PATH_TOP)/doc/Licenses.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
[708]1209 cp $(PATH_TOP)/doc/COPYING.LIB $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1210 cp $(PATH_TOP)/doc/COPYING $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
[568]1211 cp $(PATH_TOP)/ChangeLog $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)/ChangeLog.os2
1212 cp $(PATH_TOP)/src/install/MakeOmfLibs.cmd $(ALL_PREFIX)/lib
1213 cp $(PATH_TOP)/src/misc/dllar.cmd $(ALL_PREFIX)/bin
[711]1214 cp $(PATH_TOP)/src/misc/gccenv.cmd $(ALL_PREFIX)/bin
[568]1215 ar cr $(ALL_PREFIX)/lib/m.a
[122]1216
[568]1217
[122]1218dejagnu:
1219# nothing to make at the moment, it's just a all install stuff it seems.
1220
1221requires_autoconf_2_52_DEJAGNU_CONFIGURE_DIRS = \
1222src/misc/dejagnu \
1223src/misc/dejagnu/contrib/bluegnu2.0.3 \
1224src/misc/dejagnu/contrib/bluegnu2.0.3/doc \
1225src/misc/dejagnu/contrib/bluegnu2.0.3/example \
1226src/misc/dejagnu/contrib/bluegnu2.0.3/example/calc \
1227src/misc/dejagnu/contrib/bluegnu2.0.3/testsuite \
1228src/misc/dejagnu/example/calc \
1229src/misc/dejagnu/example/hello
1230
1231.PHONY: dejagnu-autoconf-refresh dejagnu-autoconf-rerun dejagnu-autoconf-clean dejagnu-autoconf-remove
1232dejagnu-autoconf-refresh dejagnu-autoconf-rerun dejagnu-autoconf-clean dejagnu-autoconf-remove:
1233ifeq "$(BUILD_PLATFORM)" "LINUX"
1234 -$(SH) $(PATH_TOP)/xfix.sh
1235endif
1236 for dir in $(DEJAGNU_CONFIGURE_DIRS); do \
[662]1237 if $(MAKE) $(MAKEOPT) -j 1 $(@:dejagnu-autoconf-%=%) -f $(PWD)/config.gmk -C $$dir ; then \
[122]1238 true; \
1239 else \
1240 exit 8; \
1241 fi \
1242 done
1243
1244
1245
1246#
1247# Expect
1248#
1249
1250expect:
1251
1252
1253# build the components.
1254.PHONY: expect-build expect-install expect-configure
1255expect-build expect-install expect-configure:
1256 mkdir -p $(PATH_OBJ)/misc/expect
[662]1257 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/misc/expect -f $(MAKEFILE) $@-it
[122]1258
1259
1260# When changed directory
1261expect-build-it: \
1262 $(PATH_OBJ)/misc/expect/.ts.configured
[662]1263 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/misc/expect
[122]1264
1265# configure it (invoked after directory change).
1266# We set CC to help configure finding it.
1267# And we reconfigure libiberty to the gcc one.
1268expect-configure-it $(PATH_OBJ)/misc/expect/.ts.configured: $(PATH_TOP)/src/misc/expect/configure
1269ifeq "$(BUILD_PLATFORM)" "OS2"
1270 $(ASH) -c " \
1271 export CC=\"gcc.exe\" ; \
1272 $< \
1273 --disable-shared \
1274 --host=i386-pc-os2-emx \
1275 --with-tclconfig=$(UNIXROOT)/usr/lib \
1276 --with-tclinclude=$(UNIXROOT)/usr/lib/tcl8.0/include \
1277 --enable-gcc \
1278 $(BUILD_ENABLE_SYMBOLS) \
1279 --prefix=$(PATH_BUILTTOOLSD) "
1280else
1281 $(ASH) -c " \
1282 $< \
1283 --enable-gcc \
1284 $(BUILD_ENABLE_SYMBOLS) \
1285 --prefix=$(PATH_BUILTTOOLSD) "
1286endif
1287 touch $(PATH_OBJ)/misc/expect/.ts.configured
1288
1289
1290# install to builttools (if anywhere!)
1291expect-install-it:
[662]1292 $(MAKE) $(MAKEOPT) prefix=$(PATH_BUILTTOOLSD) install
[122]1293
1294
1295
1296EXPECT_CONFIGURE_DIRS = \
1297src/misc/expect
1298# skipping testsuite for now as it requires some .m4 files we don't have.
1299#src/misc/expect/testsuite
1300
1301.PHONY: expect-autoconf-refresh expect-autoconf-rerun expect-autoconf-clean expect-autoconf-remove
1302expect-autoconf-refresh expect-autoconf-rerun expect-autoconf-clean expect-autoconf-remove:
1303ifeq "$(BUILD_PLATFORM)" "LINUX"
1304 -$(SH) $(PATH_TOP)/xfix.sh
1305endif
1306 for dir in $(EXPECT_CONFIGURE_DIRS); do \
[662]1307 if $(MAKE) $(MAKEOPT) -j 1 $(@:expect-autoconf-%=%) -f $(PWD)/config.gmk -C $$dir ; then \
[122]1308 true; \
1309 else \
1310 exit 8; \
1311 fi \
1312 done
1313
[402]1314
[122]1315
[766]1316#
1317# Checkout rule
1318#
1319checkout update:
1320 cvs -q update -d 2>&1 | tee up.log
[122]1321
[132]1322# DO NOT DELETE
Note: See TracBrowser for help on using the repository browser.