source: trunk/Makefile@ 949

Last change on this file since 949 was 905, checked in by bird, 22 years ago

Got rid of da emx rulez.

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