source: trunk/Makefile@ 689

Last change on this file since 689 was 662, checked in by bird, 22 years ago

Multijob make.

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