source: trunk/Makefile@ 596

Last change on this file since 596 was 593, checked in by bird, 22 years ago

'nice' the builds to idle. gccomf.

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