source: trunk/Makefile@ 650

Last change on this file since 650 was 628, checked in by bird, 22 years ago

* empty log message *

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