source: trunk/Makefile@ 1120

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

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

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