source: trunk/Makefile@ 201

Last change on this file since 201 was 132, checked in by bird, 22 years ago

emx

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