source: trunk/Makefile@ 1036

Last change on this file since 1036 was 985, checked in by bird, 22 years ago

Moved emx back.

  • Property cvs2svn:cvs-rev set to 1.61
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 45.3 KB
RevLine 
[25]1# $Id: Makefile 985 2004-01-11 22:52:03Z bird $
2#
3# Top level makefile.
4#
5# InnoTek Systemberatung GmbHconfidential
6#
7# Copyright (c) 2003 InnoTek Systemberatung GmbH
8# Author: knut st. osmundsen <bird@anduin.net>
9#
10# All Rights Reserved
11#
12
[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 \
308 usr/bin/gawk.exe usr/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/intl \
691gcc/ld \
692gcc/libiberty \
693gcc/opcodes \
[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 \
[662]705 if $(MAKE) $(MAKEOPT) -j 1 $(@:gcc-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; then \
[96]706 true; \
707 else \
708 exit 8; \
709 fi \
[25]710 done
711
712
713# build the components.
[76]714.PHONY: gcc-build gcc-install gcc-configure
715gcc-build gcc-install gcc-configure:
[41]716 mkdir -p $(PATH_OBJ)/gcc
[662]717 $(MAKE) $(MAKEOPT) -j 1 -C $(PATH_OBJ)/gcc -f $(MAKEFILE) $@-it
[41]718
[69]719
720# When changed directory
[76]721# We pass down BOOT_ flags for stage2+.
722# Because strip is broken on OS/2 we pass -s for release build and -g for
723# non release builds - This overrides some stuff in src/gcc/gcc/config/i386/t-emx!
[255]724# For the 2nd stage we need a hack for using the right specs when linking...
[282]725#SPEC_HACK = $(if $(wildchar $(PATH_OBJ)/.all-stage1),\
726# -specs $(PATH_TOP)/src/emx/src/lib/libc.specs, \
727# -specs $(PATH_TOP)/tools/x86.os2/gcc/staged/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs)
728SPECS_HACK =
[41]729gcc-build-it: \
730 $(PATH_OBJ)/gcc/.ts.configured
[69]731ifeq "$(BUILD_PLATFORM)" "OS2"
[662]732 unset GCCLOAD ; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc \
[984]733 LIBGCC2_DEBUG_CFLAGS="$(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem " \
734 CFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem" \
735 CXXFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem" \
736 BOOT_CFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) $(BUILD_OPTIMIZE) -Zhigh-mem" \
737 LDFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf" \
738 BOOT_LDFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf" \
[69]739 bootstrap
740else
[662]741 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc bootstrap
[69]742endif
743
744# configure it (invoked after directory change).
745# We set CC to help configure finding it.
[984]746# We also set some LDFLAGS to get omf linking.
[76]747gcc-configure-it $(PATH_OBJ)/gcc/.ts.configured: $(PATH_TOP)/src/gcc/configure
[69]748ifeq "$(BUILD_PLATFORM)" "OS2"
749 $(ASH) -c " \
750 export CC=\"gcc.exe\" ; \
[984]751 export LDFLAGS=\"$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf\" ; \
752 export BOOT_LDFLAGS=\"$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zhigh-mem -Zcrtdll -Zstack 1024 -Zomf\" ; \
[41]753 $< \
[68]754 --enable-clh \
[41]755 --enable-threads=os2 \
[203]756 --enable-shared=libgcc,bfd,opcodes \
[41]757 --enable-nls \
758 --without-included-gettext \
759 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
[468]760 --prefix=/gcc \
[41]761 --with-gnu-ld \
762 --with-gnu-as \
763 --disable-libgcj \
764 --enable-languages=c,c++ "
[69]765else
766 $(ASH) -c "$< \
[103]767 --disable-clh \
[203]768 --enable-shared=libgcc,bfd,opcodes \
[69]769 --enable-nls \
770 --without-included-gettext \
771 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
[468]772 --prefix=/gcc \
[69]773 --with-gnu-ld \
774 --with-gnu-as \
775 --disable-libgcj \
776 --enable-languages=c,c++ "
777endif
[41]778 touch $(PATH_OBJ)/gcc/.ts.configured
[103]779# TODO: Andy, on Linux --enable-clh result in linking errors.
780
[76]781# Install the GCC build
782# Repeating the prefix doesn't hurt anybody.
783gcc-install-it:
[662]784 $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
[25]785
[120]786
787
[111]788# easy, update src/gcc/gcc/version.c
789gcc-versionstamps:
790 @echo "Version stamping gcc..."
791 mv -f $(PATH_TOP)/src/gcc/gcc/version.c $(PATH_TOP)/src/gcc/gcc/version.tmp.c
792 sed -e '/version_string/s/\([0-9]\.[0-9]*\.[0-9]*\).*/\1 $(INNOTEK_VERSION)";/' \
793 $(PATH_TOP)/src/gcc/gcc/version.tmp.c > $(PATH_TOP)/src/gcc/gcc/version.c
794 rm -f $(PATH_TOP)/src/gcc/gcc/version.tmp.c
795
796
[120]797# Install to builttools directory.
[282]798## WARNING! Another spec HACK!
[120]799gcc-builttools-stage2:
[662]800 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc prefix=$(PATH_BUILTTOOLS_TMPD) install
[282]801## cp $(PATH_TOP)/src/emx/src/lib/libc.specs $(PATH_OBJ)/gcc/gcc/specs
[120]802
[111]803
[55]804# Generate diffs for GCC (v3.2.2) - part of packing a release.
[109]805.PHONY: gcc-diff $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff
806gcc-diff: $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff
807$(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff:
[55]808 mkdir -p $(@D)
[109]809 $(TOOL_CVS_DIFF_TREE) $(GCC_CVS_REL) src/gcc > $@
[25]810
[102]811
812
[468]813##############################################################################
814###############################################################################
815###############################################################################
816#
817# G C C - O M F f o r D e B u G i n g
818#
819###############################################################################
820###############################################################################
821###############################################################################
822all-gccomf: gccomf
[593]823gccomf:
824 mkdir -p $(PATH_OBJ)/gccomf
[662]825 $(NICE) $(MAKE) $(MAKEOPT) -C . gccomf-logged 2>&1 | $(UNIXROOT)/usr/bin/tee $(PATH_OBJ)/gccomf/build-`date +"%Y%m%d-%H%M%S"`.log
[593]826
827gccomf-logged: \
828 gcc-autoconf-refresh \
[468]829 gccomf-build
[593]830 echo "Unbelievable!!! We just successfully completed a GCC OMF build!!!"
[468]831
832# build the components.
833.PHONY: gccomf-build gccomf-install gccomf-configure
834gccomf-build gccomf-install gccomf-configure:
835 mkdir -p $(PATH_OBJ)/gccomf
[662]836 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gccomf -f $(MAKEFILE) $@-it
[468]837
[565]838
[468]839# Separate since we want the 'e' option
[555]840gccomf-shell:
[468]841 mkdir -p $(PATH_OBJ)/gccomf
[662]842 $(MAKE) $(MAKEOPT) -e -C $(PATH_OBJ)/gccomf -f $(MAKEFILE) $@-it
[565]843gccomf-shell-it:
[468]844 chdir $(PATH_OBJ)/gccomf ; \
845 if test -d $(PATH_BUILTTOOLS)/omfhack; then mv -f $(PATH_BUILTTOOLS)/omfhack $(PATH_BUILTTOOLS)/omfhackbin; fi ; \
[711]846 if test ! -d $(PATH_BUILTTOOLS)/omfhackbin; then echo "no omfhackbin"; exit 1; fi ; \
[468]847 unset GCCLOAD; \
848 export GCC_OMF="real"; \
[810]849 export LIBGCC2_DEBUG_CFLAGS="-g -Zhigh-mem -Zaout"; \
850 export CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
851 export CXXFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
852 export BOOT_CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g "; \
[984]853 export LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024"; \
854 export BOOT_LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024"; \
[468]855 $(subst \,/,$(COMSPEC)) ; \
856 mv -f $(PATH_BUILTTOOLS)/omfhackbin $(PATH_BUILTTOOLS)/omfhack
857
858
859# When changed directory
[565]860# We pass down alot of flags here, but currently we don't use half of them as
[468]861# we're not booting the compiler.
862
863#OMFSPEC_HACK = $(if $(wildchar $(PATH_OBJ)/.all-stage1),\
864# -specs $(PATH_TOP)/src/emx/src/lib/libc.specs, \
865# -specs $(PATH_TOP)/tools/x86.os2/gcc/staged/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs)
866OMFSPECS_HACK =
867gccomf-build-it: \
868 $(PATH_OBJ)/gccomf/.ts.configured
869ifeq "$(BUILD_PLATFORM)" "OS2"
870 if test -d $(PATH_BUILTTOOLS)/omfhack; then mv -f $(PATH_BUILTTOOLS)/omfhack $(PATH_BUILTTOOLS)/omfhackbin; fi
[711]871 if test ! -d $(PATH_BUILTTOOLS)/omfhackbin; then echo "no omfhackbin"; exit 1; fi ; \
[662]872 unset GCCLOAD ; export GCC_OMF="real" ; echo GCC_OMF=$$GCC_OMF; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gccomf \
[810]873 LIBGCC2_DEBUG_CFLAGS="-g -Zhigh-mem -Zaout" \
874 CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
875 CXXFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
876 BOOT_CFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g " \
[984]877 LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024" \
878 BOOT_LDFLAGS="$(OMFSPEC_HACK) -Zhigh-mem -Zomf -g -Zcrtdll -Zstack 1024" \
[565]879 -e all
[468]880 mv -f $(PATH_BUILTTOOLS)/omfhackbin $(PATH_BUILTTOOLS)/omfhack
881else
[662]882 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/gcc all
[468]883endif
884
885
886# configure it (invoked after directory change).
887# We set CC to help configure finding it.
888gccomf-configure-it $(PATH_OBJ)/gccomf/.ts.configured: $(PATH_TOP)/src/gcc/configure
889ifeq "$(BUILD_PLATFORM)" "OS2"
890 $(ASH) -c " \
891 export CC=\"gcc.exe\" ; \
892 $< \
893 --enable-clh \
894 --enable-threads=os2 \
895 --enable-shared=libgcc,bfd,opcodes \
896 --disable-nls \
897 --without-included-gettext \
898 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
899 --prefix=/gcc \
900 --with-gnu-ld \
901 --with-gnu-as \
902 --disable-libgcj \
903 --enable-languages=c,c++ "
904else
905 $(ASH) -c "$< \
906 --disable-clh \
907 --enable-shared=libgcc,bfd,opcodes \
908 --disable-nls \
909 --without-included-gettext \
910 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
911 --prefix=/gcc \
912 --with-gnu-ld \
913 --with-gnu-as \
914 --disable-libgcj \
915 --enable-languages=c,c++ "
916endif
917 touch $(PATH_OBJ)/gccomf/.ts.configured
918# TODO: Andy, on Linux --enable-clh result in linking errors.
919
920# Install the GCC build
921# Repeating the prefix doesn't hurt anybody.
922gccomf-install-it:
[662]923 $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
[468]924
925
926
927
928
[25]929###############################################################################
930###############################################################################
931###############################################################################
[34]932#
[25]933# B i n U t i l s
[34]934#
[25]935###############################################################################
936###############################################################################
937###############################################################################
[96]938
939BINUTILS_DIRS = \
940binutils/bfd \
941binutils/opcodes \
942binutils/gas \
943binutils/gprof \
944binutils/binutils \
945binutils/ld \
946
947BINUTILS_NOT_DIRS =\
948binutils/etc \
949binutils/libiberty \
950binutils/intl \
951
952
953BINUTILS_CONFIGURE_DIRS = $(BINUTILS_DIRS) $(BINUTILS_NOT_DIRS)
954
[25]955all-binutils binutils:
[89]956 echo "Binutils are build together with the other GNU Tools in GCC."
957 echo "Separate building of binutils is not configured."
[25]958
[628]959all-binutils214 binutils214: \
960 binutils-autoconf-refresh \
961 binutils-build
962 echo "Successfully build Binutils v2.14."
[25]963
964
[628]965
[96]966# configure.in/configure
967.PHONY: binutils-autoconf-refresh binutils-autoconf-rerun binutils-autoconf-clean binutils-autoconf-remove
968binutils-autoconf-refresh binutils-autoconf-rerun binutils-autoconf-clean binutils-autoconf-remove:
969ifeq "$(BUILD_PLATFORM)" "LINUX"
970 -$(SH) $(PATH_TOP)/xfix.sh
971endif
972 for dir in $(BINUTILS_CONFIGURE_DIRS); do \
[662]973 if $(MAKE) $(MAKEOPT) -j 1 $(@:binutils-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; then \
[96]974 true; \
975 else \
976 exit 8; \
977 fi \
978 done
979
980
981# build the components.
982.PHONY: binutils-build binutils-install binutils-configure
983binutils-build binutils-install binutils-configure:
984 mkdir -p $(PATH_OBJ)/binutils
[662]985 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/binutils -f $(MAKEFILE) $@-it
[96]986
987
988# When changed directory
989binutils-build-it: \
990 $(PATH_OBJ)/binutils/.ts.configured
[662]991 $(ASH) -c " unset GCCLOAD ; $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/binutils "
[96]992
993# configure it (invoked after directory change).
994# We set CC to help configure finding it.
[98]995# And we reconfigure libiberty to the gcc one.
[96]996binutils-configure-it $(PATH_OBJ)/binutils/.ts.configured: $(PATH_TOP)/src/binutils/configure
[627]997ifeq "$(BUILD_PLATFORM)" "OS2"
[96]998 $(ASH) -c " \
999 export CC=\"gcc.exe\" ; \
1000 $< \
[627]1001 --enable-clh \
1002 --enable-threads=os2 \
1003 --enable-shared=libgcc,bfd,opcodes \
1004 --enable-nls \
1005 --without-included-gettext \
1006 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
1007 --prefix=/gcc \
1008 --with-gnu-ld \
1009 --with-gnu-as \
1010 --disable-libgcj \
1011 --enable-languages=c,c++ "
1012else
1013 $(ASH) -c "$< \
1014 --disable-clh \
1015 --enable-shared=libgcc,bfd,opcodes \
1016 --enable-nls \
1017 --without-included-gettext \
1018 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
1019 --prefix=/gcc \
1020 --with-gnu-ld \
1021 --with-gnu-as \
1022 --disable-libgcj \
1023 --enable-languages=c,c++ "
1024endif
1025 mkdir -p libiberty
1026# Not any longer.
1027# $(ASH) -c "cd libiberty && \
1028# $(PATH_TOP)/src/gcc/libiberty/configure \
1029# --prefix=$(ALL_PREFIX) "
[96]1030 touch $(PATH_OBJ)/binutils/.ts.configured
1031
1032
1033# Install the Binutils build
1034# Repeating the prefix doesn't hurt anybody.
1035binutils-install-it:
[662]1036 $(MAKE) $(MAKEOPT) prefix=$(ALL_PREFIX) install
[96]1037
1038
[111]1039# Not so easy, need to patch a few files.
1040binutils-versionstamps:
1041 @echo "Version stamping binutils..."
1042 cp -f $(PATH_TOP)/src/binutils/binutils/version.c $(PATH_TOP)/src/binutils/binutils/version.tmp.c
1043 sed -e '/printf.*program_version/s/%s %s.*\\n/%s %s $(INNOTEK_VERSION)\\n/' \
1044 $(PATH_TOP)/src/binutils/binutils/version.tmp.c > $(PATH_TOP)/src/binutils/binutils/version.c
1045 rm -f $(PATH_TOP)/src/binutils/binutils/version.tmp.c
1046 if [ -f $(PATH_TOP)/src/gcc/binutils/version.c ]; then \
1047 cp -f $(PATH_TOP)/src/gcc/binutils/version.c $(PATH_TOP)/src/gcc/binutils/version.tmp.c && \
1048 sed -e '/printf.*program_version/s/%s %s.*\\n/%s %s $(INNOTEK_VERSION)\\n/' \
1049 $(PATH_TOP)/src/gcc/binutils/version.tmp.c > $(PATH_TOP)/src/gcc/binutils/version.c && \
1050 rm -f $(PATH_TOP)/src/gcc/binutils/version.tmp.c ; \
1051 fi
1052 @echo "Version stamping gas..."
1053 cp -f $(PATH_TOP)/src/binutils/gas/as.c $(PATH_TOP)/src/binutils/gas/as.tmp.c
1054 sed -e '/printf.*GNU.*assembler/s/%s.*\\n/%s $(INNOTEK_VERSION)\\n/' \
1055 -e '/fprintf.*GNU.*assembler.*version.*BFD.*/s/using BFD version %s.*/using BFD version %s $(INNOTEK_VERSION)"),/ ' \
1056 $(PATH_TOP)/src/binutils/gas/as.tmp.c > $(PATH_TOP)/src/binutils/gas/as.c
1057 rm -f $(PATH_TOP)/src/binutils/gas/as.tmp.c
1058 if [ -f $(PATH_TOP)/src/gcc/gas/as.c ]; then \
1059 cp -f $(PATH_TOP)/src/gcc/gas/as.c $(PATH_TOP)/src/gcc/gas/as.tmp.c && \
1060 sed -e '/printf.*GNU.*assembler/s/%s.*\\n/%s $(INNOTEK_VERSION)\\n/' \
1061 -e '/fprintf.*GNU.*assembler.*version.*BFD.*/s/using BFD version %s.*/using BFD version %s $(INNOTEK_VERSION)"),/ ' \
1062 $(PATH_TOP)/src/gcc/gas/as.tmp.c > $(PATH_TOP)/src/gcc/gas/as.c && \
1063 rm -f $(PATH_TOP)/src/gcc/gas/as.tmp.c ; \
1064 fi
1065 @echo "Version stamping ld..."
1066 cp -f $(PATH_TOP)/src/binutils/ld/ldver.c $(PATH_TOP)/src/binutils/ld/ldver.tmp.c
1067 sed -e '/fprintf.*GNU.*ld.*version/s/(with BFD %s).*/(with BFD %s) $(INNOTEK_VERSION)\\n"),/' \
1068 $(PATH_TOP)/src/binutils/ld/ldver.tmp.c > $(PATH_TOP)/src/binutils/ld/ldver.c
1069 rm -f $(PATH_TOP)/src/binutils/ld/ldver.tmp.c
1070 if [ -f $(PATH_TOP)/src/gcc/ld/ldver.c ]; then \
1071 cp -f $(PATH_TOP)/src/gcc/ld/ldver.c $(PATH_TOP)/src/gcc/ld/ldver.tmp.c && \
1072 sed -e '/fprintf.*GNU.*ld.*version/s/(with BFD %s).*/(with BFD %s) $(INNOTEK_VERSION)\\n"),/' \
1073 $(PATH_TOP)/src/gcc/ld/ldver.tmp.c > $(PATH_TOP)/src/gcc/ld/ldver.c && \
1074 rm -f $(PATH_TOP)/src/gcc/ld/ldver.tmp.c ; \
1075 fi
1076
[96]1077
[111]1078
[109]1079# Generate diffs for Binutils (part of packing).
1080.PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff
1081binutils-diff: $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff
1082$(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff:
[89]1083 mkdir -p $(@D)
[109]1084 $(TOOL_CVS_DIFF_TREE) $(BINUTILS_CVS_REL) src/binutils > $@
[98]1085
1086
1087
[109]1088
[98]1089
[89]1090
[25]1091
[96]1092
[25]1093###############################################################################
1094###############################################################################
1095###############################################################################
[34]1096#
[25]1097# E M X
[34]1098#
[25]1099###############################################################################
1100###############################################################################
1101###############################################################################
[120]1102all-emx emx: \
1103 emx-build
1104 @echo "Successfully build EMX."
[25]1105
[120]1106# Some helpers.
1107# TODO: Change OUT and INS to the right ones. Currently not possible as
1108# doing such breaks the rules generating.
1109EMX_MODE = dbg
1110ifeq "$(BUILD_MODE)" "RELEASE"
1111EMX_MODE = opt
1112endif
[265]1113EMX_OUT = out/
[120]1114EMX_INS = out/install/
[265]1115#EMX_OUT = $(PATH_OBJ)/emx/
1116#EMX_INS = $(ALL_PREFIX)/
[120]1117EMX_MASM = $(PATH_TOP)/tools/x86.os2/masm/v6.0/binp/ml.exe
1118EMX_DEFINES = OUT=$(EMX_OUT) INS=$(EMX_INS) MODE=$(EMX_MODE) "ASM=$(EMX_MASM) -c"
[109]1119
[120]1120# build the components. (directory changer rules)
1121.PHONY: emx-build emx-install emx-configure
1122emx-build emx-install emx-configure:
1123 mkdir -p $(PATH_OBJ)/emx
[662]1124 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx -f $(MAKEFILE) $@-it
[120]1125
1126# This is the configure equivalent.
[905]1127emx-configure-it:
1128 @echo ...
[120]1129
[265]1130# make handle issue here. Make portions at the time.
[905]1131emx-build-it:
[662]1132 $(MAKE) $(MAKEOPT) -j 1 -C $(PATH_TOP)/src/emx $(EMX_DEFINES) tools
1133 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) os2
1134 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libc
1135 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) app
1136 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) alias
1137 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) regexp
1138 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libc-dll
1139 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libsocket libdl
1140 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) libs
1141 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) all
[120]1142
[905]1143emx-install-it:
[662]1144 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) INS=$(ALL_PREFIX)/ install
[120]1145
1146
[565]1147# We pass down the INNOTEK_VERSION define when building EMX.
[111]1148emx-versionstamps:
[565]1149 @echo "Version stamping EMX... nothing to do"
[109]1150
[120]1151# Install the compiled emx stuff to builttools.
[282]1152##emx-builttools-stage2: emx-builttools-stage2-specs
1153emx-builttools-stage2:
[662]1154 $(MAKE) $(MAKEOPT) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) INS=$(PATH_BUILTTOOLS_TMP)/ install
[120]1155
[282]1156## bird: for now we will just replace the specs with the constantly updated libc specs.
[255]1157emx-builttools-stage2-specs:
[363]1158## -mv -f $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs \
1159## $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/emxspecs
[282]1160## cp $(PATH_TOP)/src/emx/src/lib/libc.specs \
[363]1161## $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs
[120]1162
[255]1163
[109]1164# Generate diffs for Binutils (part of packing).
1165.PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
1166emx-diff: $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
1167$(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff:
1168 mkdir -p $(@D)
1169 $(TOOL_CVS_DIFF_TREE) $(EMX_CVS_REL) src/emx > $@
[111]1170
[122]1171
[402]1172
1173
1174
1175###############################################################################
1176###############################################################################
1177###############################################################################
1178#
1179# P A C K I N G
1180#
1181###############################################################################
1182###############################################################################
1183###############################################################################
[577]1184packing: \
1185 packing-all \
[708]1186 packing-doc \
[583]1187 packing-libc \
[577]1188 packing-core \
1189 packing-dbg \
[583]1190 packing-prf \
[577]1191
[583]1192ZIPFLAGS=-rX9
[846]1193ZIPBASE=$(PATH_BIN)/GCC-$(GCC_VERSION)-beta3fix1
[577]1194
1195packing-all:
[583]1196 rm -f $(ZIPBASE).zip
1197 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE).zip *
[402]1198
[708]1199packing-doc:
1200 rm -f $(ZIPBASE)-doc.zip
[838]1201 cd $(ALL_PREFIX)/..; zip $(ZIPFLAGS) $(ZIPBASE)-doc.zip usr/doc/GCC-$(GCC_VERSION)/*
[708]1202
[583]1203packing-libc:
1204 rm -f $(PATH_BIN)/libc.zip
1205 cd $(ALL_PREFIX)/lib; zip $(ZIPFLAGS) $(PATH_BIN)/libc.zip libc*.dll gcc*.dll
1206
[577]1207packing-core:
[583]1208 rm -f $(ZIPBASE)-core.zip
1209 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-core.zip * -x \*.dbg -x \*.map -x \*_p.\* -x \*.elh -x \*.prf -x \*.lib -x usr/lib/dbg/\* -x \*.lib
1210 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-core.zip usr/lib/libc*dbg usr/lib/end.lib
[122]1211
[577]1212packing-dbg:
[583]1213 rm -f $(ZIPBASE)-dbg.zip
1214 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-dbg.zip . -i \*.dbg -i \*.map -i \*.elh -i \*.sym -i usr/lib/dbg/\*
[577]1215
[583]1216packing-prf:
1217 rm -f $(ZIPBASE)-prf.zip
1218 cd $(ALL_PREFIX)/.. ; zip $(ZIPFLAGS) $(ZIPBASE)-prf.zip . -i \*_p.\* -i \*.prf
1219
1220packing-src: \
1221 packing-src-gcc \
1222 packing-src-binutils \
1223 packing-src-emx \
1224
1225packing-src-gcc:
1226 rm -f $(ZIPBASE)-src-GCC.zip
1227 zip $(ZIPFLAGS) $(ZIPBASE)-src-GCC.zip src/gcc -x \*CVS\*
1228
1229packing-src-binutils:
1230 rm -f $(ZIPBASE)-src-binutils.zip
1231 zip $(ZIPFLAGS) $(ZIPBASE)-src-binutils.zip src/binutils -x \*CVS\*
1232
1233packing-src-emx:
1234 rm -f $(ZIPBASE)-src-emx.zip
1235 zip $(subst r,,$(ZIPFLAGS)) $(ZIPBASE)-src-emx.zip src/emx/* -x \*CVS\* -x \*testcase\* -x \*out\*
1236 zip $(ZIPFLAGS) $(ZIPBASE)-src-emx.zip src/emx/src/* src/emx/include/* src/emx/src/bsd/* -x \*CVS\*
[627]1237
[568]1238
1239
[122]1240###############################################################################
1241###############################################################################
1242###############################################################################
1243#
1244# M I S C
1245#
1246###############################################################################
1247###############################################################################
1248###############################################################################
1249
[568]1250misc-install:
1251 mkdir -p $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1252 mkdir -p $(ALL_PREFIX)/lib
1253 mkdir -p $(ALL_PREFIX)/bin
1254 cp $(PATH_TOP)/doc/ReleaseNotes.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
[703]1255 cp $(PATH_TOP)/doc/MailingLists.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
[568]1256 cp $(PATH_TOP)/doc/Install.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
[705]1257 cp $(PATH_TOP)/doc/Licenses.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
[708]1258 cp $(PATH_TOP)/doc/COPYING.LIB $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1259 cp $(PATH_TOP)/doc/COPYING $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
[568]1260 cp $(PATH_TOP)/ChangeLog $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)/ChangeLog.os2
1261 cp $(PATH_TOP)/src/install/MakeOmfLibs.cmd $(ALL_PREFIX)/lib
1262 cp $(PATH_TOP)/src/misc/dllar.cmd $(ALL_PREFIX)/bin
[711]1263 cp $(PATH_TOP)/src/misc/gccenv.cmd $(ALL_PREFIX)/bin
[568]1264 ar cr $(ALL_PREFIX)/lib/m.a
[122]1265
[568]1266
[122]1267dejagnu:
1268# nothing to make at the moment, it's just a all install stuff it seems.
1269
1270requires_autoconf_2_52_DEJAGNU_CONFIGURE_DIRS = \
1271src/misc/dejagnu \
1272src/misc/dejagnu/contrib/bluegnu2.0.3 \
1273src/misc/dejagnu/contrib/bluegnu2.0.3/doc \
1274src/misc/dejagnu/contrib/bluegnu2.0.3/example \
1275src/misc/dejagnu/contrib/bluegnu2.0.3/example/calc \
1276src/misc/dejagnu/contrib/bluegnu2.0.3/testsuite \
1277src/misc/dejagnu/example/calc \
1278src/misc/dejagnu/example/hello
1279
1280.PHONY: dejagnu-autoconf-refresh dejagnu-autoconf-rerun dejagnu-autoconf-clean dejagnu-autoconf-remove
1281dejagnu-autoconf-refresh dejagnu-autoconf-rerun dejagnu-autoconf-clean dejagnu-autoconf-remove:
1282ifeq "$(BUILD_PLATFORM)" "LINUX"
1283 -$(SH) $(PATH_TOP)/xfix.sh
1284endif
1285 for dir in $(DEJAGNU_CONFIGURE_DIRS); do \
[662]1286 if $(MAKE) $(MAKEOPT) -j 1 $(@:dejagnu-autoconf-%=%) -f $(PWD)/config.gmk -C $$dir ; then \
[122]1287 true; \
1288 else \
1289 exit 8; \
1290 fi \
1291 done
1292
1293
1294
1295#
1296# Expect
1297#
1298
1299expect:
1300
1301
1302# build the components.
1303.PHONY: expect-build expect-install expect-configure
1304expect-build expect-install expect-configure:
1305 mkdir -p $(PATH_OBJ)/misc/expect
[662]1306 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/misc/expect -f $(MAKEFILE) $@-it
[122]1307
1308
1309# When changed directory
1310expect-build-it: \
1311 $(PATH_OBJ)/misc/expect/.ts.configured
[662]1312 $(MAKE) $(MAKEOPT) -C $(PATH_OBJ)/misc/expect
[122]1313
1314# configure it (invoked after directory change).
1315# We set CC to help configure finding it.
1316# And we reconfigure libiberty to the gcc one.
1317expect-configure-it $(PATH_OBJ)/misc/expect/.ts.configured: $(PATH_TOP)/src/misc/expect/configure
1318ifeq "$(BUILD_PLATFORM)" "OS2"
1319 $(ASH) -c " \
1320 export CC=\"gcc.exe\" ; \
1321 $< \
1322 --disable-shared \
1323 --host=i386-pc-os2-emx \
1324 --with-tclconfig=$(UNIXROOT)/usr/lib \
1325 --with-tclinclude=$(UNIXROOT)/usr/lib/tcl8.0/include \
1326 --enable-gcc \
1327 $(BUILD_ENABLE_SYMBOLS) \
1328 --prefix=$(PATH_BUILTTOOLSD) "
1329else
1330 $(ASH) -c " \
1331 $< \
1332 --enable-gcc \
1333 $(BUILD_ENABLE_SYMBOLS) \
1334 --prefix=$(PATH_BUILTTOOLSD) "
1335endif
1336 touch $(PATH_OBJ)/misc/expect/.ts.configured
1337
1338
1339# install to builttools (if anywhere!)
1340expect-install-it:
[662]1341 $(MAKE) $(MAKEOPT) prefix=$(PATH_BUILTTOOLSD) install
[122]1342
1343
1344
1345EXPECT_CONFIGURE_DIRS = \
1346src/misc/expect
1347# skipping testsuite for now as it requires some .m4 files we don't have.
1348#src/misc/expect/testsuite
1349
1350.PHONY: expect-autoconf-refresh expect-autoconf-rerun expect-autoconf-clean expect-autoconf-remove
1351expect-autoconf-refresh expect-autoconf-rerun expect-autoconf-clean expect-autoconf-remove:
1352ifeq "$(BUILD_PLATFORM)" "LINUX"
1353 -$(SH) $(PATH_TOP)/xfix.sh
1354endif
1355 for dir in $(EXPECT_CONFIGURE_DIRS); do \
[662]1356 if $(MAKE) $(MAKEOPT) -j 1 $(@:expect-autoconf-%=%) -f $(PWD)/config.gmk -C $$dir ; then \
[122]1357 true; \
1358 else \
1359 exit 8; \
1360 fi \
1361 done
1362
[402]1363
[122]1364
[766]1365#
1366# Checkout rule
1367#
1368checkout update:
1369 cvs -q update -d 2>&1 | tee up.log
[122]1370
[132]1371# DO NOT DELETE
Note: See TracBrowser for help on using the repository browser.