source: trunk/Makefile@ 119

Last change on this file since 119 was 111, checked in by bird, 23 years ago

Version Stamping

  • Property cvs2svn:cvs-rev set to 1.19
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 23.5 KB
Line 
1# $Id: Makefile 111 2003-05-09 16:51:43Z 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)
36ifndef PATH_OBJ
37export PATH_OBJ = $(PATH_TOP)/obj/$(BUILD_PLATFORM)/$(BUILD_MODE)
38export PATH_OBJD = $(PATH_TOPD)/obj/$(BUILD_PLATFORM)/$(BUILD_MODE)
39endif
40export PATH_BUILTTOOLS = $(PATH_OBJ)/builttools
41export PATH_BUILTTOOLSD= $(PATH_OBJD)/builttools
42
43# Debug info or not (when ever we feel like passing down such options).
44ifeq "$(BUILD_MODE)" "RELEASE"
45BUILD_DEBUGINFO = -s
46else
47BUILD_DEBUGINFO = -g
48endif
49
50
51# Version and CVS defines
52export GCC_VERSION ?= 3.2.2
53export GCC_VERSION_SHORT ?= 3022
54export GCC_CVS_VENDOR ?= GNU
55export GCC_CVS_REL ?= GCC_3-2-2
56export BINUTILS_VERSION ?= 2.11.2
57export BINUTILS_VERSION_SHORT ?= 2112
58export BINUTILS_CVS_VENDOR ?= GNU
59export BINUTILS_CVS_REL ?= BINUTILS_2-11-2
60export EMX_VERSION ?= 0.9d-fix04
61export EMX_VERSION_SHORT ?= 9d04
62export EMX_CVS_VENDOR ?= EMX
63export EMX_CVS_REL ?= EMX_0-9D-FIX04
64
65# innotek version and timestamp
66export INNOTEK_VERSION ?= (Innotek Build $(shell date '+%Y-%m-%d %H:%M'))
67
68
69#
70# For builds on Linux Host builds we do the environment setup here.
71# This is essentially a mimicking of what we do on OS/2.
72#
73ifndef BUILD_PLATFORM
74ifeq "$(shell uname -s)" "Linux"
75export BUILD_PLATFORM ?= LINUX
76export BUILD_PROJECT ?= GCCOS2
77export SH ?= /bin/sh
78export ASH ?= /bin/ash
79export BASH ?= /bin/bash
80export AWK ?= /bin/gawk
81export GAWK ?= /bin/gawk
82export CONFIG_SHELL ?= $(SH)
83export MAKESHELL ?= $(SH)
84export PATH_EMX ?= /usr
85export PATH_EMXPGCC ?= /usr
86export TMP ?= /tmp
87export TMPDIR ?= /tmp
88endif
89endif
90
91
92
93# Misc Helpers
94ALL_PREFIX = $(PATH_BIND)/$(GCC_VERSION)/usr
95TOOL_CVS_DIFF_TREE = -cvs diff -R -N -w -u -r
96
97
98
99
100
101###############################################################################
102###############################################################################
103###############################################################################
104###############################################################################
105#
106# M a i n R u l e z
107#
108###############################################################################
109###############################################################################
110###############################################################################
111###############################################################################
112all:
113 mkdir -p $(PATH_OBJ)
114 $(MAKE) -C . all-logged 2>&1 | $(UNIXROOT)/usr/bin/tee $(PATH_OBJ)/build-`date +"%Y%m%d-%H%M%S"`.log
115
116all-logged: \
117 all-start \
118 all-env \
119 all-sanity \
120 all-preload \
121 all-builttools-initial \
122 all-versionstamps \
123 all-symlinks \
124 \
125 all-binutils \
126 all-gcc \
127 all-emx \
128 \
129 all-install \
130 \
131 all-symlinks-unlink \
132 all-ended
133
134
135all-start:
136 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
137 @echo "+ Make started: $(shell date)"
138 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
139
140
141all-ended:
142 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
143 @echo "+ Make ended: $(shell date)"
144 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
145
146
147all-env:
148 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
149 @echo "Variables:"
150 @echo " PWD = $(PWD)"
151 @echo " PWDD = $(PWDD)"
152 @echo " PATH_TOP = $(PATH_TOP)"
153 @echo " PATH_TOPD = $(PATH_TOPD)"
154 @echo " PATH_OBJ = $(PATH_OBJ)"
155 @echo " PATH_OBJD = $(PATH_OBJD)"
156 @echo " PATH_BIN = $(PATH_BIN)"
157 @echo " PATH_BIND = $(PATH_BIND)"
158 @echo " ALL_PREFIX = $(ALL_PREFIX)"
159 @echo " PATH_EMXPGCC = $(PATH_EMXPGCC)"
160 @echo " PATH_EMX = $(PATH_EMX)"
161 @echo " BUILD_MODE = $(BUILD_MODE)"
162 @echo " BUILD_PLATFORM = $(BUILD_PLATFORM)"
163 @echo " BUILD_PROJECT = $(BUILD_PROJECT)"
164 @echo " GCC_VERSION = $(GCC_VERSION)"
165 @echo " GCC_VERSION_SHORT = $(GCC_VERSION_SHORT)"
166 @echo " GCC_CVS_VENDOR = $(GCC_CVS_VENDOR)"
167 @echo " GCC_CVS_REL = $(GCC_CVS_REL)"
168 @echo " BINUTILS_VERSION = $(BINUTILS_VERSION)"
169 @echo " BINUTILS_VERSION_SHORT = $(BINUTILS_VERSION_SHORT)"
170 @echo " BINUTILS_CVS_VENDOR = $(BINUTILS_CVS_VENDOR)"
171 @echo " BINUTILS_CVS_REL = $(BINUTILS_CVS_REL)"
172 @echo " EMX_VERSION = $(EMX_VERSION)"
173 @echo " EMX_VERSION_SHORT = $(EMX_VERSION_SHORT)"
174 @echo " EMX_CVS_VENDOR = $(EMX_CVS_VENDOR)"
175 @echo " EMX_CVS_REL = $(EMX_CVS_REL)"
176 @echo " MAKEFILE = $(MAKEFILE)"
177 @echo " UNIXROOT = $(UNIXROOT)"
178 @echo " AC_PREFIX = $(AC_PREFIX)"
179 @echo " AC_MACRODIR = $(AC_MACRODIR)"
180 @echo " HOSTNAME = $(HOSTNAME)"
181 @echo " USER = $(USER)"
182 @echo " LOGNAME = $(LOGNAME)"
183 @echo " TMP = $(TMP)"
184 @echo " TMPDIR = $(TMPDIR)"
185 @echo " USER = $(USER)"
186 @echo " AWK = $(AWK)"
187 @echo " GAWK = $(GAWK)"
188 @echo " SH = $(SH)"
189 @echo " ASH = $(ASH)"
190 @echo " BASH = $(BASH)"
191 @echo " CONFIG_SHELL = $(CONFIG_SHELL)"
192 @echo " MAKESHELL = $(MAKESHELL)"
193 @echo " EMXSHELL = $(EMXSHELL)"
194 @echo " SHELL = $(SHELL)"
195 @echo " MAKE = $(MAKE)"
196 @echo " PATH = $(PATH)"
197 @echo " C_INCLUDE_PATH = $(C_INCLUDE_PATH)"
198 @echo " CPLUS_INCLUDE_PATH = $(CPLUS_INCLUDE_PATH)"
199 @echo " OBJC_INCLUDE_PATH = $(OBJC_INCLUDE_PATH)"
200 @echo " LIBRARY_PATH = $(LIBRARY_PATH)"
201 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
202
203all-sanity:
204 @echo -n "Checking build environment sanity... "
205 @if [ "x$(BUILD_PROJECT)" != "xGCCOS2" ]; then \
206 echo ""; echo "Error: BUILD_PROJECT is wrong or isn't defined!"; \
207 exit 8; \
208 fi
209 @if [ "x$(BUILD_PLATFORM)" != "xOS2" -a "x$(BUILD_PLATFORM)" != "xLINUX" ]; then \
210 echo ""; echo "Error: BUILD_PLATFORM is wrong or isn't defined!"; \
211 exit 8; \
212 fi
213 @if [ "x$(BUILD_PLATFORM)" = "xOS2" -a "x$(UNIXROOT)" = "x" ]; then \
214 echo ""; echo "Error: UNIXROOT isn't defined!"; \
215 exit 8; \
216 fi
217 @if [ "x$(BUILD_PLATFORM)" != "xOS2" -a "x$(UNIXROOT)" != "x" ]; then \
218 echo ""; echo "Error: UNIXROOT is defined!"; \
219 exit 8; \
220 fi
221ifeq "$(BUILD_PLATFORM)" "OS2"
222 @if gcc --version | grep -qe ".*[3]\.[2-9]\.[0-9]"; then \
223 true; \
224 else \
225 echo ""; echo "Warning: GCC v3.2.x or higher is recommended!"; \
226 fi
227 @if ar --version | grep -qe ".*2\.11\.[2-9]" -e ".*[2]\.1[2-9]\.[0-9]*"; then \
228 true; \
229 else \
230 echo ""; echo "Warning: AR v2.11.2 or higher is recommended!"; \
231 fi
232endif
233 @echo "ok"
234
235
236PRELOADED_TOOLS = bin/sh.exe bin/echo.exe bin/true.exe usr/bin/test.exe usr/bin/expr.exe \
237 usr/bin/gawk.exe usr/bin/sed.exe bin/rm.exe bin/cat.exe bin/cp.exe
238
239all-preload:
240 @echo "Preloading tools:"
241ifeq "$(BUILD_PLATFORM)" "OS2"
242 @for tool in $(PRELOADED_TOOLS); do \
243 echo -n " $$tool"; \
244 emxload -e $(UNIXROOT)/$$tool; \
245 done
246 emxload -e gcc.exe g++.exe ld.exe cc1.exe as.exe cc1plus.exe cpp0.exe ar.exe
247endif
248 @echo ""
249
250
251# we do some version stamping/branding of certain files. It's mainly to
252# distiguish releases and to tell everyone that they're from Innotek. :)
253#
254# IMPORTANT! Take care not to commit the changed files
255# (TODO! Try make these changes to non-cvs backed files. (long-term-goal))
256.PHONY: all-versionstamps
257all-versionstamps: $(PATH_OBJ)/.ts.versionstamped
258$(PATH_OBJ)/.ts.versionstamped:
259 $(MAKE) -f $(MAKEFILE) "INNOTEK_VERSION=$(INNOTEK_VERSION)" gcc-versionstamps binutils-versionstamps emx-versionstamps
260 mkdir -p $(@D)
261 touch $@
262
263
264
265all-install: \
266 gcc-install
267# emx-install
268# binutils-install
269
270
271all-diff: \
272 gcc-diff \
273 binutils-diff \
274 emx-diff \
275
276
277###############################################################################
278###############################################################################
279###############################################################################
280#
281# B u i l t T o o l s
282#
283###############################################################################
284###############################################################################
285###############################################################################
286.PHONY: all-builttools-initial all-builttools-dirs
287all-builttools-initial: \
288 all-builttools-dirs \
289 $(PATH_BUILTTOOLS)/bin/dllar.cmd \
290
291
292all-builttools-dirs:
293 mkdir -p $(PATH_BUILTTOOLS)/bin $(PATH_BUILTTOOLS)/lib $(PATH_BUILTTOOLS)/include
294
295$(PATH_BUILTTOOLS)/bin/dllar.cmd: $(PATH_TOP)/src/misc/dllar.cmd
296 cp $< $@
297
298
299
300
301###############################################################################
302###############################################################################
303###############################################################################
304#
305# S y m l i n k s
306#
307#
308# We use symlinking of binutils stuff into the gcc tree so we can
309# build everything in one go and take advantage of the gcc
310# makesystem which will use the binutils we built when doing the
311# gcc libraries and such.
312#
313# On OS/2 symlinks doesn't exist so, we'll copy the source trees.
314# Copy because this will for directories work ok with cvs, moving
315# directories would cause 'cvs update -d' to refetch stuff.
316#
317# IMPORTANT! Take care, the 'symlined' stuff will be removed at the
318# end of the build. Remeber to do all-symlinks-unlink before a fresh
319# build is started as the duplicated binutils things doesn't get
320# updated by cvs.
321#
322#
323#w##############################################################################
324###############################################################################
325###############################################################################
326all-symlinks: \
327 all-symlinks-binutils
328
329all-symlinks-unlink: \
330 all-symlinks-unlink-binutils
331
332
333ifeq "$(BUILD_PLATFORM)" "OS2"
334TOOL_SYMLINK_FILE = cp
335TOOL_SYMLINK_DIR = cp -Rf
336TOOL_SYMLINK_MKDIR = mkdir
337TOOL_UNSYMLINK_DIR = rm -Rf
338else
339TOOL_SYMLINK_FILE = ln -s
340TOOL_SYMLINK_DIR = ln -s
341TOOL_SYMLINK_MKDIR = true
342TOOL_UNSYMLINK_DIR = rm
343endif
344
345# ld is broken, so don't use it!
346# ld \
347
348SYMLINKS_BINUTILS_TO_GCC_DIRS = \
349bfd \
350binutils \
351etc \
352gas \
353gprof \
354intl \
355opcodes \
356texinfo \
357include/aout \
358include/coff \
359include/elf \
360include/nlm \
361include/opcode \
362include/regs \
363
364SYMLINKS_BINUTILS_TO_GCC_FILES = \
365include/alloca-conf.h \
366include/ansidecl.h \
367include/bfdlink.h \
368include/bin-bugs.h \
369include/bout.h \
370include/callback.h \
371include/ChangeLog \
372include/COPYING \
373include/demangle.h \
374include/dis-asm.h \
375include/dyn-string.h \
376include/filenames.h \
377include/floatformat.h \
378include/fnmatch.h \
379include/fopen-bin.h \
380include/fopen-same.h \
381include/fopen-vms.h \
382include/gdbm.h \
383include/getopt.h \
384include/hashtab.h \
385include/hp-symtab.h \
386include/ieee.h \
387include/libiberty.h \
388include/MAINTAINERS \
389include/md5.h \
390include/oasys.h \
391include/objalloc.h \
392include/obstack.h \
393include/os9k.h \
394include/partition.h \
395include/progress.h \
396include/remote-sim.h \
397include/safe-ctype.h \
398include/sim-d10v.h \
399include/sort.h \
400include/splay-tree.h \
401include/symcat.h \
402
403# Symlink binutils stuff to gcc.
404# Note the test should've been "! -e", but that doesn' work in ash... :/
405all-symlinks-binutils:
406 for file in $(SYMLINKS_BINUTILS_TO_GCC_FILES); do \
407 if [ ! -f "$(PATH_TOP)/src/gcc/$$file" ]; then \
408 $(TOOL_SYMLINK_FILE) $(PATH_TOP)/src/binutils/$$file $(PATH_TOP)/src/gcc/$$file && \
409 touch $(PATH_TOP)/src/gcc/.symlinked.`echo $${file} | sed -e 's@/@_@g'`; \
410 fi ; \
411 done
412 for dir in $(SYMLINKS_BINUTILS_TO_GCC_DIRS) ; do \
413 if [ ! -d "$(PATH_TOP)/src/gcc/$$dir" ] ; then \
414 $(TOOL_SYMLINK_MKDIR) $(PATH_TOP)/src/gcc/$$dir && \
415 touch $(PATH_TOP)/src/gcc/.symlinked.`echo $${dir} | sed -e 's@/@_@g'` && \
416 $(TOOL_SYMLINK_DIR) $(PATH_TOP)/src/binutils/$$dir $(PATH_TOP)/src/gcc/`echo $${dir}| sed -e '/\//!d' -e 's@\([a-zA-z0-9]*\)/.*@\1/@'` ; \
417 fi ; \
418 done
419 -ls -a1 src/gcc/.sym*
420
421all-symlinks-unlink-binutils:
422 for file in $(SYMLINKS_BINUTILS_TO_GCC_FILES); do \
423 if [ -f "$(PATH_TOP)/src/gcc/.symlinked.`echo $${file} | sed -e 's@/@_@g'`" ]; then \
424 rm $(PATH_TOP)/src/gcc/$${file} && \
425 rm $(PATH_TOP)/src/gcc/.symlinked.`echo $${file} | sed -e 's@/@_@g'` ; \
426 fi ; \
427 done
428 for dir in $(SYMLINKS_BINUTILS_TO_GCC_DIRS) ; do \
429 if [ -f "$(PATH_TOP)/src/gcc/.symlinked.`echo $${dir} | sed -e 's@/@_@g'`" ] ; then \
430 $(TOOL_UNSYMLINK_DIR) $(PATH_TOP)/src/gcc/$${dir} && \
431 rm $(PATH_TOP)/src/gcc/.symlinked.`echo $${dir} | sed -e 's@/@_@g'`; \
432 fi ; \
433 done
434 -ls -a1 src/gcc/.sym*
435
436
437###############################################################################
438###############################################################################
439###############################################################################
440#
441# G C C
442#
443###############################################################################
444###############################################################################
445###############################################################################
446all-gcc gcc: \
447 gcc-autoconf-refresh \
448 gcc-build
449 echo "Successfully build GCC."
450
451
452
453GCC_DIRS = \
454gcc/libiberty \
455gcc/zlib \
456gcc/gcc \
457gcc/libstdc++-v3 \
458gcc/boehm-gc \
459gcc/fastjar \
460gcc/libf2c \
461gcc/libf2c/libF77 \
462gcc/libf2c/libI77 \
463gcc/libf2c/libU77 \
464gcc/libffi \
465gcc/libjava \
466gcc/libjava/libltdl \
467gcc/libobjc \
468
469not_yet =\
470gcc/bfd \
471gcc/binutils \
472gcc/gas \
473gcc/gprof \
474gcc/intl \
475gcc/ld \
476gcc/libiberty \
477gcc/opcodes \
478
479GCC_CONFIGURE_DIRS = $(GCC_DIRS)
480
481
482# configure.in/configure
483.PHONY: gcc-autoconf-refresh gcc-autoconf-rerun gcc-autoconf-clean gcc-autoconf-remove
484gcc-autoconf-refresh gcc-autoconf-rerun gcc-autoconf-clean gcc-autoconf-remove:
485ifeq "$(BUILD_PLATFORM)" "LINUX"
486 -$(SH) $(PATH_TOP)/xfix.sh
487endif
488 for dir in $(GCC_CONFIGURE_DIRS); do \
489 if $(MAKE) $(@:gcc-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; then \
490 true; \
491 else \
492 exit 8; \
493 fi \
494 done
495
496
497# build the components.
498.PHONY: gcc-build gcc-install gcc-configure
499gcc-build gcc-install gcc-configure:
500 mkdir -p $(PATH_OBJ)/gcc
501 $(MAKE) -C $(PATH_OBJ)/gcc -f $(MAKEFILE) $@-it
502
503
504# When changed directory
505# We pass down BOOT_ flags for stage2+.
506# Because strip is broken on OS/2 we pass -s for release build and -g for
507# non release builds - This overrides some stuff in src/gcc/gcc/config/i386/t-emx!
508gcc-build-it: \
509 $(PATH_OBJ)/gcc/.ts.configured
510ifeq "$(BUILD_PLATFORM)" "OS2"
511 unset GCCLOAD ; $(MAKE) -C $(PATH_OBJ)/gcc \
512 LIBGCC2_DEBUG_CFLAGS="$(BUILD_DEBUGINFO)" \
513 BOOT_CFLAGS="$(BUILD_DEBUGINFO) -O2 -mcpu=pentium -mpreferred-stack-boundary=2 -malign-strings=0 -falign-loops=2 -falign-jumps=2 -falign-functions=2" \
514 BOOT_LDFLAGS="$(BUILD_DEBUGINFO) -Zexe -Zcrtdll" \
515 LIBGCC2_DEBUG_CFLAG="$(BUILD_DEBUGINFO)" \
516 bootstrap
517else
518 $(MAKE) -C $(PATH_OBJ)/gcc bootstrap
519endif
520
521# configure it (invoked after directory change).
522# We set CC to help configure finding it.
523gcc-configure-it $(PATH_OBJ)/gcc/.ts.configured: $(PATH_TOP)/src/gcc/configure
524ifeq "$(BUILD_PLATFORM)" "OS2"
525 $(ASH) -c " \
526 export CC=\"gcc.exe\" ; \
527 $< \
528 --enable-clh \
529 --enable-threads=os2 \
530 --enable-shared=libgcc \
531 --enable-nls \
532 --without-included-gettext \
533 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
534 --prefix=$(ALL_PREFIX) \
535 --with-gnu-ld \
536 --with-gnu-as \
537 --disable-libgcj \
538 --enable-languages=c,c++ "
539else
540 $(ASH) -c "$< \
541 --disable-clh \
542 --enable-shared=libgcc \
543 --enable-nls \
544 --without-included-gettext \
545 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
546 --prefix=$(ALL_PREFIX) \
547 --with-gnu-ld \
548 --with-gnu-as \
549 --disable-libgcj \
550 --enable-languages=c,c++ "
551endif
552 touch $(PATH_OBJ)/gcc/.ts.configured
553# TODO: Andy, on Linux --enable-clh result in linking errors.
554
555
556# Install the GCC build
557# Repeating the prefix doesn't hurt anybody.
558gcc-install-it:
559 $(MAKE) prefix=$(PATH_BIND)/usr install
560
561
562
563# easy, update src/gcc/gcc/version.c
564gcc-versionstamps:
565 @echo "Version stamping gcc..."
566 mv -f $(PATH_TOP)/src/gcc/gcc/version.c $(PATH_TOP)/src/gcc/gcc/version.tmp.c
567 sed -e '/version_string/s/\([0-9]\.[0-9]*\.[0-9]*\).*/\1 $(INNOTEK_VERSION)";/' \
568 $(PATH_TOP)/src/gcc/gcc/version.tmp.c > $(PATH_TOP)/src/gcc/gcc/version.c
569 rm -f $(PATH_TOP)/src/gcc/gcc/version.tmp.c
570
571
572
573# Generate diffs for GCC (v3.2.2) - part of packing a release.
574.PHONY: gcc-diff $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff
575gcc-diff: $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff
576$(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff:
577 mkdir -p $(@D)
578 $(TOOL_CVS_DIFF_TREE) $(GCC_CVS_REL) src/gcc > $@
579
580
581
582
583
584
585
586
587###############################################################################
588###############################################################################
589###############################################################################
590#
591# B i n U t i l s
592#
593###############################################################################
594###############################################################################
595###############################################################################
596
597BINUTILS_DIRS = \
598binutils/bfd \
599binutils/opcodes \
600binutils/gas \
601binutils/gprof \
602binutils/binutils \
603binutils/ld \
604
605BINUTILS_NOT_DIRS =\
606binutils/etc \
607binutils/libiberty \
608binutils/intl \
609
610
611BINUTILS_CONFIGURE_DIRS = $(BINUTILS_DIRS) $(BINUTILS_NOT_DIRS)
612
613all-binutils binutils:
614 echo "Binutils are build together with the other GNU Tools in GCC."
615 echo "Separate building of binutils is not configured."
616
617
618
619# configure.in/configure
620.PHONY: binutils-autoconf-refresh binutils-autoconf-rerun binutils-autoconf-clean binutils-autoconf-remove
621binutils-autoconf-refresh binutils-autoconf-rerun binutils-autoconf-clean binutils-autoconf-remove:
622ifeq "$(BUILD_PLATFORM)" "LINUX"
623 -$(SH) $(PATH_TOP)/xfix.sh
624endif
625 for dir in $(BINUTILS_CONFIGURE_DIRS); do \
626 if $(MAKE) $(@:binutils-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; then \
627 true; \
628 else \
629 exit 8; \
630 fi \
631 done
632
633
634# build the components.
635.PHONY: binutils-build binutils-install binutils-configure
636binutils-build binutils-install binutils-configure:
637 mkdir -p $(PATH_OBJ)/binutils
638 $(MAKE) -C $(PATH_OBJ)/binutils -f $(MAKEFILE) $@-it
639
640
641# When changed directory
642binutils-build-it: \
643 $(PATH_OBJ)/binutils/.ts.configured
644 $(ASH) -c " unset GCCLOAD ; $(MAKE) -C $(PATH_OBJ)/binutils "
645
646# configure it (invoked after directory change).
647# We set CC to help configure finding it.
648# And we reconfigure libiberty to the gcc one.
649binutils-configure-it $(PATH_OBJ)/binutils/.ts.configured: $(PATH_TOP)/src/binutils/configure
650 $(ASH) -c " \
651 export CC=\"gcc.exe\" ; \
652 $< \
653 --enable-shared \
654 --prefix=$(ALL_PREFIX) "
655 $(ASH) -c "cd libiberty && \
656 $(PATH_TOP)/src/gcc/libiberty/configure \
657 --prefix=$(ALL_PREFIX) "
658 touch $(PATH_OBJ)/binutils/.ts.configured
659
660
661# Install the Binutils build
662# Repeating the prefix doesn't hurt anybody.
663binutils-install-it:
664 $(MAKE) prefix=$(ALL_PREFIX) install
665
666
667# Not so easy, need to patch a few files.
668binutils-versionstamps:
669 @echo "Version stamping binutils..."
670 cp -f $(PATH_TOP)/src/binutils/binutils/version.c $(PATH_TOP)/src/binutils/binutils/version.tmp.c
671 sed -e '/printf.*program_version/s/%s %s.*\\n/%s %s $(INNOTEK_VERSION)\\n/' \
672 $(PATH_TOP)/src/binutils/binutils/version.tmp.c > $(PATH_TOP)/src/binutils/binutils/version.c
673 rm -f $(PATH_TOP)/src/binutils/binutils/version.tmp.c
674 if [ -f $(PATH_TOP)/src/gcc/binutils/version.c ]; then \
675 cp -f $(PATH_TOP)/src/gcc/binutils/version.c $(PATH_TOP)/src/gcc/binutils/version.tmp.c && \
676 sed -e '/printf.*program_version/s/%s %s.*\\n/%s %s $(INNOTEK_VERSION)\\n/' \
677 $(PATH_TOP)/src/gcc/binutils/version.tmp.c > $(PATH_TOP)/src/gcc/binutils/version.c && \
678 rm -f $(PATH_TOP)/src/gcc/binutils/version.tmp.c ; \
679 fi
680 @echo "Version stamping gas..."
681 cp -f $(PATH_TOP)/src/binutils/gas/as.c $(PATH_TOP)/src/binutils/gas/as.tmp.c
682 sed -e '/printf.*GNU.*assembler/s/%s.*\\n/%s $(INNOTEK_VERSION)\\n/' \
683 -e '/fprintf.*GNU.*assembler.*version.*BFD.*/s/using BFD version %s.*/using BFD version %s $(INNOTEK_VERSION)"),/ ' \
684 $(PATH_TOP)/src/binutils/gas/as.tmp.c > $(PATH_TOP)/src/binutils/gas/as.c
685 rm -f $(PATH_TOP)/src/binutils/gas/as.tmp.c
686 if [ -f $(PATH_TOP)/src/gcc/gas/as.c ]; then \
687 cp -f $(PATH_TOP)/src/gcc/gas/as.c $(PATH_TOP)/src/gcc/gas/as.tmp.c && \
688 sed -e '/printf.*GNU.*assembler/s/%s.*\\n/%s $(INNOTEK_VERSION)\\n/' \
689 -e '/fprintf.*GNU.*assembler.*version.*BFD.*/s/using BFD version %s.*/using BFD version %s $(INNOTEK_VERSION)"),/ ' \
690 $(PATH_TOP)/src/gcc/gas/as.tmp.c > $(PATH_TOP)/src/gcc/gas/as.c && \
691 rm -f $(PATH_TOP)/src/gcc/gas/as.tmp.c ; \
692 fi
693 @echo "Version stamping ld..."
694 cp -f $(PATH_TOP)/src/binutils/ld/ldver.c $(PATH_TOP)/src/binutils/ld/ldver.tmp.c
695 sed -e '/fprintf.*GNU.*ld.*version/s/(with BFD %s).*/(with BFD %s) $(INNOTEK_VERSION)\\n"),/' \
696 $(PATH_TOP)/src/binutils/ld/ldver.tmp.c > $(PATH_TOP)/src/binutils/ld/ldver.c
697 rm -f $(PATH_TOP)/src/binutils/ld/ldver.tmp.c
698 if [ -f $(PATH_TOP)/src/gcc/ld/ldver.c ]; then \
699 cp -f $(PATH_TOP)/src/gcc/ld/ldver.c $(PATH_TOP)/src/gcc/ld/ldver.tmp.c && \
700 sed -e '/fprintf.*GNU.*ld.*version/s/(with BFD %s).*/(with BFD %s) $(INNOTEK_VERSION)\\n"),/' \
701 $(PATH_TOP)/src/gcc/ld/ldver.tmp.c > $(PATH_TOP)/src/gcc/ld/ldver.c && \
702 rm -f $(PATH_TOP)/src/gcc/ld/ldver.tmp.c ; \
703 fi
704
705
706
707# Generate diffs for Binutils (part of packing).
708.PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff
709binutils-diff: $(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff
710$(ALL_PREFIX)/src/diffs/binutils-$(BINUTILS_VERSION).diff:
711 mkdir -p $(@D)
712 $(TOOL_CVS_DIFF_TREE) $(BINUTILS_CVS_REL) src/binutils > $@
713
714
715
716
717
718
719
720
721###############################################################################
722###############################################################################
723###############################################################################
724#
725# E M X
726#
727###############################################################################
728###############################################################################
729###############################################################################
730all-emx emx:
731 echo "Successfully build EMX."
732 echo "Warning!!! EMX not yet done!"
733
734
735
736
737# do nothing *yet*.
738emx-versionstamps:
739 echo "Todo Versionstamping EMX tools and such."
740
741
742# Generate diffs for Binutils (part of packing).
743.PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
744emx-diff: $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
745$(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff:
746 mkdir -p $(@D)
747 $(TOOL_CVS_DIFF_TREE) $(EMX_CVS_REL) src/emx > $@
748
Note: See TracBrowser for help on using the repository browser.