source: trunk/Makefile@ 521

Last change on this file since 521 was 468, checked in by bird, 22 years ago

#460: Prefix /gcc when building gcc.
gccomf rules for building a debuggable version of the things.

  • Property cvs2svn:cvs-rev set to 1.39
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 40.3 KB
Line 
1# $Id: Makefile 468 2003-07-29 13:34:54Z 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
99
100
101
102
103
104###############################################################################
105###############################################################################
106###############################################################################
107###############################################################################
108#
109# M a i n R u l e z
110#
111###############################################################################
112###############################################################################
113###############################################################################
114###############################################################################
115all:
116 mkdir -p $(PATH_OBJ)
117 $(MAKE) -C . all-logged 2>&1 | $(UNIXROOT)/usr/bin/tee $(PATH_OBJ)/build-`date +"%Y%m%d-%H%M%S"`.log
118
119all-logged: \
120 all-banner-start \
121 all-env \
122 all-sanity \
123 all-preload \
124 all-versionstamps \
125 all-symlinks \
126 \
127 all-stage1 \
128 all-stage2 \
129 \
130 all-install \
131 \
132 all-symlinks-unlink
133 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
134 @echo "+ Make Ended Successfully: $(shell date)"
135 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
136
137#
138# banners
139#
140
141all-banner-start:
142 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
143 @echo "+ Make started: $(shell date)"
144 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
145
146all-banner-stage1:
147 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
148 @echo "+ Stage 1 - starting: $(shell date)"
149 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
150
151all-banner-stage2:
152 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
153 @echo "+ Stage 2 - starting: $(shell date)"
154 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
155
156all-banner-builttools-initial:
157 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
158 @echo "+ Initializing builttools tree"
159 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
160
161all-banner-builttools-stage2:
162 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
163 @echo "+ Copying stage2 builttools"
164 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
165
166all-banner-install:
167 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
168 @echo "+ Install - starting: $(shell date)"
169 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
170
171all-banner-install-done:
172 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
173 @echo "+ Install - done: $(shell date)"
174 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
175
176
177#
178# Sanity and environment dumps - to make it easier to figure out make bugs.
179#
180
181all-env:
182 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
183 @echo "Variables:"
184 @echo " PWD = $(PWD)"
185 @echo " PWDD = $(PWDD)"
186 @echo " PATH_TOP = $(PATH_TOP)"
187 @echo " PATH_TOPD = $(PATH_TOPD)"
188 @echo " PATH_OBJ = $(PATH_OBJ)"
189 @echo " PATH_OBJD = $(PATH_OBJD)"
190 @echo " PATH_BIN = $(PATH_BIN)"
191 @echo " PATH_BIND = $(PATH_BIND)"
192 @echo " ALL_PREFIX = $(ALL_PREFIX)"
193 @echo " PATH_EMXPGCC = $(PATH_EMXPGCC)"
194 @echo " PATH_EMX = $(PATH_EMX)"
195 @echo " BUILD_MODE = $(BUILD_MODE)"
196 @echo " BUILD_PLATFORM = $(BUILD_PLATFORM)"
197 @echo " BUILD_PROJECT = $(BUILD_PROJECT)"
198 @echo " GCC_VERSION = $(GCC_VERSION)"
199 @echo " GCC_VERSION_SHORT = $(GCC_VERSION_SHORT)"
200 @echo " GCC_CVS_VENDOR = $(GCC_CVS_VENDOR)"
201 @echo " GCC_CVS_REL = $(GCC_CVS_REL)"
202 @echo " BINUTILS_VERSION = $(BINUTILS_VERSION)"
203 @echo " BINUTILS_VERSION_SHORT = $(BINUTILS_VERSION_SHORT)"
204 @echo " BINUTILS_CVS_VENDOR = $(BINUTILS_CVS_VENDOR)"
205 @echo " BINUTILS_CVS_REL = $(BINUTILS_CVS_REL)"
206 @echo " EMX_VERSION = $(EMX_VERSION)"
207 @echo " EMX_VERSION_SHORT = $(EMX_VERSION_SHORT)"
208 @echo " EMX_CVS_VENDOR = $(EMX_CVS_VENDOR)"
209 @echo " EMX_CVS_REL = $(EMX_CVS_REL)"
210 @echo " MAKEFILE = $(MAKEFILE)"
211 @echo " UNIXROOT = $(UNIXROOT)"
212 @echo " AC_PREFIX = $(AC_PREFIX)"
213 @echo " AC_MACRODIR = $(AC_MACRODIR)"
214 @echo " HOSTNAME = $(HOSTNAME)"
215 @echo " USER = $(USER)"
216 @echo " LOGNAME = $(LOGNAME)"
217 @echo " TMP = $(TMP)"
218 @echo " TMPDIR = $(TMPDIR)"
219 @echo " USER = $(USER)"
220 @echo " AWK = $(AWK)"
221 @echo " GAWK = $(GAWK)"
222 @echo " SH = $(SH)"
223 @echo " ASH = $(ASH)"
224 @echo " BASH = $(BASH)"
225 @echo " CONFIG_SHELL = $(CONFIG_SHELL)"
226 @echo " MAKESHELL = $(MAKESHELL)"
227 @echo " EMXSHELL = $(EMXSHELL)"
228 @echo " SHELL = $(SHELL)"
229 @echo " MAKE = $(MAKE)"
230 @echo " PATH = $(PATH)"
231 @echo " C_INCLUDE_PATH = $(C_INCLUDE_PATH)"
232 @echo " CPLUS_INCLUDE_PATH = $(CPLUS_INCLUDE_PATH)"
233 @echo " OBJC_INCLUDE_PATH = $(OBJC_INCLUDE_PATH)"
234 @echo " LIBRARY_PATH = $(LIBRARY_PATH)"
235 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
236 @echo "Content of PATH_OBJ:"
237 -ls -la $(PATH_OBJ)/
238 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
239 @echo "Content of PATH_BIN:"
240 -ls -la $(PATH_BIN)/
241 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
242
243
244all-sanity:
245 @echo -n "Checking build environment sanity... "
246 @if [ "x$(BUILD_PROJECT)" != "xGCCOS2" ]; then \
247 echo ""; echo "Error: BUILD_PROJECT is wrong or isn't defined!"; \
248 exit 8; \
249 fi
250 @if [ "x$(BUILD_PLATFORM)" != "xOS2" -a "x$(BUILD_PLATFORM)" != "xLINUX" ]; then \
251 echo ""; echo "Error: BUILD_PLATFORM is wrong or isn't defined!"; \
252 exit 8; \
253 fi
254 @if [ "x$(BUILD_PLATFORM)" = "xOS2" -a "x$(UNIXROOT)" = "x" ]; then \
255 echo ""; echo "Error: UNIXROOT isn't defined!"; \
256 exit 8; \
257 fi
258 @if [ "x$(BUILD_PLATFORM)" != "xOS2" -a "x$(UNIXROOT)" != "x" ]; then \
259 echo ""; echo "Error: UNIXROOT is defined!"; \
260 exit 8; \
261 fi
262ifeq "$(BUILD_PLATFORM)" "OS2"
263 @if gcc --version | grep -qe ".*[3]\.[2-9]\.[0-9]"; then \
264 true; \
265 else \
266 echo ""; echo "Warning: GCC v3.2.x or higher is recommended!"; \
267 fi
268 @if ar --version | grep -qe ".*2\.11\.[2-9]" -e ".*[2]\.1[2-9]\.[0-9]*"; then \
269 true; \
270 else \
271 echo ""; echo "Warning: AR v2.11.2 or higher is recommended!"; \
272 fi
273endif
274 @echo "ok"
275
276
277#
278# Preload tools we commonly use this speeds up stuff.
279#
280PRELOADED_TOOLS = bin/sh.exe bin/echo.exe bin/true.exe usr/bin/test.exe usr/bin/expr.exe \
281 usr/bin/gawk.exe usr/bin/sed.exe bin/rm.exe bin/cat.exe bin/cp.exe
282
283all-preload:
284 @echo "Preloading tools:"
285ifeq "$(BUILD_PLATFORM)" "OS2"
286 @for tool in $(PRELOADED_TOOLS); do \
287 echo -n " $$tool"; \
288 emxload -e $(UNIXROOT)/$$tool; \
289 done
290 emxload -e gcc.exe g++.exe ld.exe as.exe ar.exe ld.exe
291endif
292 @echo ""
293
294all-preload-unload-obj:
295ifeq "$(BUILD_PLATFORM)" "OS2"
296 -for prog in `emxload -l | sed -e 's|\\\|\/|g' -e 's@.*³[[:blank:]]*@@' | grep -i '$(PATH_OBJD)'`; \
297 do \
298 echo $$prog; \
299 emxload -u $$prog; \
300 done
301 -for prog in `emxload -l | sed -e 's|\\\|\/|g' -e 's@.*³[[:blank:]]*@@' | grep -i '$(PATH_TOPD)/src'`; \
302 do \
303 echo $$prog; \
304 emxload -u $$prog; \
305 done
306endif
307
308
309#
310# Version stamping/branding.
311# Update various version strings which are printed from the tools to tell
312# the build date and that's our built. This helps us tell releases apart.
313#
314# IMPORTANT! Take care not to commit the changed files
315# (TODO! Try make these changes to non-cvs backed files. (long-term-goal))
316.PHONY: all-versionstamps
317all-versionstamps: $(PATH_OBJ)/.ts.versionstamped
318$(PATH_OBJ)/.ts.versionstamped:
319 echo '#define INNOTEK_VERSION "$(INNOTEK_VERSION)"' > include/innotekversion.h
320 $(MAKE) -f $(MAKEFILE) "INNOTEK_VERSION=$(INNOTEK_VERSION)" gcc-versionstamps binutils-versionstamps emx-versionstamps
321 mkdir -p $(@D)
322 touch $@
323
324
325#
326# Stages
327# A rebuild with the new toolsuite is usually required when there is ABI
328# changes and other vital changes done to the tools.
329#
330
331all-stage1: $(PATH_OBJ)/.all-stage1
332$(PATH_OBJ)/.all-stage1:
333 $(MAKE) -f $(MAKEFILE) all-stage1-it
334 echo "$(@F)" > $(PATH_OBJ)/.last-stage
335 touch $@
336 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
337 @echo "+ Stage 1 - done: $(shell date)"
338 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
339
340all-stage1-it: \
341 all-banner-stage1 \
342 all-builttools-initial \
343 all-emx \
344 all-binutils \
345 all-gcc
346
347
348all-stage2: $(PATH_OBJ)/.all-stage2
349$(PATH_OBJ)/.all-stage2: \
350 $(PATH_OBJ)/.all-stage2.save-stage1
351 $(MAKE) -f $(MAKEFILE) all-stage2-it
352 echo "$(@F)" > $(PATH_OBJ)/.last-stage
353 touch $@
354 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
355 @echo "+ Stage 2 - done: $(shell date)"
356 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
357
358$(PATH_OBJ)/.all-stage2.save-stage1:
359 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
360 @echo "+ Saving Stage 1 - Starting: $(shell date)"
361 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
362 $(MAKE) -f $(MAKEFILE) all-preload-unload-obj
363 $(MAKE) -f $(MAKEFILE) all-builttools-stage2
364 rm -Rf $(PATH_OBJ)/stage1
365 mkdir -p $(PATH_OBJ)/stage1
366 if [ -d $(PATH_OBJ)/gcc ] ; then mv $(PATH_OBJ)/gcc $(PATH_OBJ)/stage1/gcc; fi
367 if [ -d $(PATH_OBJ)/emx ] ; then mv $(PATH_OBJ)/emx $(PATH_OBJ)/stage1/emx; fi
368 if [ -d $(PATH_TOP)/src/emx/out ] ; then mv $(PATH_TOP)/src/emx/out $(PATH_OBJ)/stage1/emx_out; fi
369 $(MAKE) -f $(MAKEFILE) all-preload
370 touch $@
371 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
372 @echo "+ Saving Stage 1 - done: $(shell date)"
373 @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
374
375all-stage2-it: \
376 all-banner-stage2 \
377 all-emx \
378 all-binutils \
379 all-gcc
380
381
382#
383# Install to bin tree makeing it ready for packing.
384#
385all-install: \
386 all-banner-install \
387 gcc-install \
388 emx-install \
389 all-banner-install-done \
390
391
392#
393# Generate all the diffs we have to supply.
394#
395all-diff: \
396 gcc-diff \
397 binutils-diff \
398 emx-diff \
399
400
401
402
403
404
405###############################################################################
406###############################################################################
407###############################################################################
408#
409# B u i l t T o o l s
410#
411###############################################################################
412###############################################################################
413###############################################################################
414.PHONY: all-builttools-initial all-builttools-dirs all-builttools-clean all-builttools-stage2
415
416all-builttools-initial: \
417 all-banner-builttools-initial \
418 all-builttools-clean \
419 all-builttools-dirs \
420 $(PATH_BUILTTOOLS)/bin/dllar.cmd \
421 $(PATH_BUILTTOOLS)/omfhack/ar.exe \
422 $(PATH_BUILTTOOLS)/omfhack/realar.exe \
423 $(PATH_BUILTTOOLS)/omfhack/ranlib.exe
424
425all-builttools-clean: \
426 all-preload-unload-obj
427 rm -Rf $(PATH_BUILTTOOLS)
428
429all-builttools-dirs:
430 mkdir -p $(PATH_BUILTTOOLS)/bin $(PATH_BUILTTOOLS)/lib $(PATH_BUILTTOOLS)/include $(PATH_BUILTTOOLS)/omfhack
431
432$(PATH_BUILTTOOLS)/bin/dllar.cmd $(PATH_BUILTTOOLS_TMP)/bin/dllar.cmd: $(PATH_TOP)/src/misc/dllar.cmd
433 cp $< $@
434$(PATH_BUILTTOOLS)/omfhack/ranlib.exe $(PATH_BUILTTOOLS_TMP)/omfhack/ranlib.exe: $(PATH_TOP)/tools/bin/true.exe
435 cp $< $@
436$(PATH_BUILTTOOLS)/omfhack/ar.exe: $(PATH_EMXPGCC)/bin/emxomfar.exe
437 cp $< $@
438$(PATH_BUILTTOOLS_TMP)/omfhack/ar.exe: $(PATH_BUILTTOOLS_TMP)/bin/emxomfar.exe
439 cp $< $@
440$(PATH_BUILTTOOLS)/omfhack/realar.exe $(PATH_BUILTTOOLS_TMP)/omfhack/realar.exe: $(PATH_EMXPGCC)/bin/ar.exe
441 cp $< $@
442$(PATH_BUILTTOOLS_TMP)/omfhack:
443 mkdir -p $@
444
445all-builttools-stage2: \
446 all-banner-builttools-stage2 \
447 gcc-builttools-stage2 \
448 emx-builttools-stage2 \
449 all-builttools-stage2-libs \
450 $(PATH_BUILTTOOLS_TMP)/bin/dllar.cmd \
451 $(PATH_BUILTTOOLS_TMP)/omfhack \
452 $(PATH_BUILTTOOLS_TMP)/omfhack/ar.exe \
453 $(PATH_BUILTTOOLS_TMP)/omfhack/realar.exe \
454 $(PATH_BUILTTOOLS_TMP)/omfhack/ranlib.exe \
455 all-builttools-clean
456 mv -f $(PATH_BUILTTOOLS_TMP) $(PATH_BUILTTOOLS)
457
458all-builttools-stage2-libs:
459 -for aoutlib in `find $(PATH_BUILTTOOLS_TMP) -name "*.a" | sed -e 's/\.a$$//' `; \
460 do \
461 if [ ! -f $(aoutlib).lib ]; then \
462 echo " $${aoutlib}"; \
463 $(PATH_BUILTTOOLS_TMP)/bin/emxomf.exe -p256 $${aoutlib}.a; \
464 fi;\
465 done
466
467
468###############################################################################
469###############################################################################
470###############################################################################
471#
472# S y m l i n k s
473#
474#
475# We use symlinking of binutils stuff into the gcc tree so we can
476# build everything in one go and take advantage of the gcc
477# makesystem which will use the binutils we built when doing the
478# gcc libraries and such.
479#
480# On OS/2 symlinks doesn't exist so, we'll copy the source trees.
481# Copy because this will for directories work ok with cvs, moving
482# directories would cause 'cvs update -d' to refetch stuff.
483#
484# IMPORTANT! Take care, the 'symlined' stuff will be removed at the
485# end of the build. Remeber to do all-symlinks-unlink before a fresh
486# build is started as the duplicated binutils things doesn't get
487# updated by cvs.
488#
489#
490#w##############################################################################
491###############################################################################
492###############################################################################
493all-symlinks: \
494 all-symlinks-binutils
495
496all-symlinks-unlink: \
497 all-symlinks-unlink-binutils
498
499
500ifeq "$(BUILD_PLATFORM)" "OS2"
501TOOL_SYMLINK_FILE = cp -p
502TOOL_SYMLINK_DIR = cp -pRf
503TOOL_SYMLINK_MKDIR = mkdir
504TOOL_UNSYMLINK_DIR = rm -Rf
505else
506TOOL_SYMLINK_FILE = ln -s
507TOOL_SYMLINK_DIR = ln -s
508TOOL_SYMLINK_MKDIR = true
509TOOL_UNSYMLINK_DIR = rm
510endif
511
512# ld is broken, so don't use it!
513# ld \
514
515SYMLINKS_BINUTILS_TO_GCC_DIRS = \
516bfd \
517binutils \
518etc \
519gas \
520gprof \
521intl \
522opcodes \
523texinfo \
524include/aout \
525include/coff \
526include/elf \
527include/nlm \
528include/opcode \
529include/regs \
530
531SYMLINKS_BINUTILS_TO_GCC_FILES = \
532include/alloca-conf.h \
533include/ansidecl.h \
534include/bfdlink.h \
535include/bin-bugs.h \
536include/bout.h \
537include/callback.h \
538include/ChangeLog \
539include/COPYING \
540include/demangle.h \
541include/dis-asm.h \
542include/dyn-string.h \
543include/filenames.h \
544include/floatformat.h \
545include/fnmatch.h \
546include/fopen-bin.h \
547include/fopen-same.h \
548include/fopen-vms.h \
549include/gdbm.h \
550include/getopt.h \
551include/hashtab.h \
552include/hp-symtab.h \
553include/ieee.h \
554include/libiberty.h \
555include/MAINTAINERS \
556include/md5.h \
557include/oasys.h \
558include/objalloc.h \
559include/obstack.h \
560include/os9k.h \
561include/partition.h \
562include/progress.h \
563include/remote-sim.h \
564include/safe-ctype.h \
565include/sim-d10v.h \
566include/sort.h \
567include/splay-tree.h \
568include/symcat.h \
569
570# Symlink binutils stuff to gcc.
571# Note the test should've been "! -e", but that doesn' work in ash... :/
572all-symlinks-binutils:
573 for file in $(SYMLINKS_BINUTILS_TO_GCC_FILES); do \
574 if [ ! -f "$(PATH_TOP)/src/gcc/$$file" ]; then \
575 $(TOOL_SYMLINK_FILE) $(PATH_TOP)/src/binutils/$$file $(PATH_TOP)/src/gcc/$$file && \
576 touch $(PATH_TOP)/src/gcc/.symlinked.`echo $${file} | sed -e 's@/@_@g'`; \
577 fi ; \
578 done
579 for dir in $(SYMLINKS_BINUTILS_TO_GCC_DIRS) ; do \
580 if [ ! -d "$(PATH_TOP)/src/gcc/$$dir" ] ; then \
581 $(TOOL_SYMLINK_MKDIR) $(PATH_TOP)/src/gcc/$$dir && \
582 touch $(PATH_TOP)/src/gcc/.symlinked.`echo $${dir} | sed -e 's@/@_@g'` && \
583 $(TOOL_SYMLINK_DIR) $(PATH_TOP)/src/binutils/$$dir $(PATH_TOP)/src/gcc/`echo $${dir}| sed -e '/\//!d' -e 's@\([a-zA-z0-9]*\)/.*@\1/@'` ; \
584 fi ; \
585 done
586 -ls -a1 src/gcc/.sym*
587
588all-symlinks-unlink-binutils:
589 for file in $(SYMLINKS_BINUTILS_TO_GCC_FILES); do \
590 if [ -f "$(PATH_TOP)/src/gcc/.symlinked.`echo $${file} | sed -e 's@/@_@g'`" ]; then \
591 rm $(PATH_TOP)/src/gcc/$${file} && \
592 rm $(PATH_TOP)/src/gcc/.symlinked.`echo $${file} | sed -e 's@/@_@g'` ; \
593 fi ; \
594 done
595 for dir in $(SYMLINKS_BINUTILS_TO_GCC_DIRS) ; do \
596 if [ -f "$(PATH_TOP)/src/gcc/.symlinked.`echo $${dir} | sed -e 's@/@_@g'`" ] ; then \
597 $(TOOL_UNSYMLINK_DIR) $(PATH_TOP)/src/gcc/$${dir} && \
598 rm $(PATH_TOP)/src/gcc/.symlinked.`echo $${dir} | sed -e 's@/@_@g'`; \
599 fi ; \
600 done
601 -ls -a1 src/gcc/.sym*
602
603
604###############################################################################
605###############################################################################
606###############################################################################
607#
608# G C C
609#
610###############################################################################
611###############################################################################
612###############################################################################
613all-gcc gcc: \
614 gcc-autoconf-refresh \
615 gcc-build
616 echo "Successfully build GCC."
617
618
619
620GCC_DIRS = \
621gcc/libiberty \
622gcc/zlib \
623gcc/gcc \
624gcc/libstdc++-v3 \
625gcc/boehm-gc \
626gcc/fastjar \
627gcc/libf2c \
628gcc/libf2c/libF77 \
629gcc/libf2c/libI77 \
630gcc/libf2c/libU77 \
631gcc/libffi \
632gcc/libjava \
633gcc/libjava/libltdl \
634gcc/libobjc \
635
636# Here is a problem, we can't regenerate binutils makefiles when symlinked into
637# gcc. At least not yet. The result is messed up severely.
638not_yet =\
639gcc/bfd \
640gcc/binutils \
641gcc/gas \
642gcc/gprof \
643gcc/intl \
644gcc/ld \
645gcc/libiberty \
646gcc/opcodes \
647
648GCC_CONFIGURE_DIRS = $(GCC_DIRS)
649
650
651# configure.in/configure
652.PHONY: gcc-autoconf-refresh gcc-autoconf-rerun gcc-autoconf-clean gcc-autoconf-remove
653gcc-autoconf-refresh gcc-autoconf-rerun gcc-autoconf-clean gcc-autoconf-remove:
654ifeq "$(BUILD_PLATFORM)" "LINUX"
655 -$(SH) $(PATH_TOP)/xfix.sh
656endif
657 for dir in $(GCC_CONFIGURE_DIRS); do \
658 if $(MAKE) $(@:gcc-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; then \
659 true; \
660 else \
661 exit 8; \
662 fi \
663 done
664
665
666# build the components.
667.PHONY: gcc-build gcc-install gcc-configure
668gcc-build gcc-install gcc-configure:
669 mkdir -p $(PATH_OBJ)/gcc
670 $(MAKE) -C $(PATH_OBJ)/gcc -f $(MAKEFILE) $@-it
671
672
673# When changed directory
674# We pass down BOOT_ flags for stage2+.
675# Because strip is broken on OS/2 we pass -s for release build and -g for
676# non release builds - This overrides some stuff in src/gcc/gcc/config/i386/t-emx!
677# For the 2nd stage we need a hack for using the right specs when linking...
678#SPEC_HACK = $(if $(wildchar $(PATH_OBJ)/.all-stage1),\
679# -specs $(PATH_TOP)/src/emx/src/lib/libc.specs, \
680# -specs $(PATH_TOP)/tools/x86.os2/gcc/staged/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs)
681SPECS_HACK =
682gcc-build-it: \
683 $(PATH_OBJ)/gcc/.ts.configured
684ifeq "$(BUILD_PLATFORM)" "OS2"
685 unset GCCLOAD ; $(MAKE) -C $(PATH_OBJ)/gcc \
686 LIBGCC2_DEBUG_CFLAGS="$(BUILD_DEBUGINFO)" \
687 CFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -O2" \
688 CXXFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -O2" \
689 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" \
690 LDFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zexe -Zcrtdll" \
691 BOOT_LDFLAGS="$(SPEC_HACK) $(BUILD_DEBUGINFO) -Zexe -Zcrtdll" \
692 bootstrap
693else
694 $(MAKE) -C $(PATH_OBJ)/gcc bootstrap
695endif
696
697# configure it (invoked after directory change).
698# We set CC to help configure finding it.
699gcc-configure-it $(PATH_OBJ)/gcc/.ts.configured: $(PATH_TOP)/src/gcc/configure
700ifeq "$(BUILD_PLATFORM)" "OS2"
701 $(ASH) -c " \
702 export CC=\"gcc.exe\" ; \
703 $< \
704 --enable-clh \
705 --enable-threads=os2 \
706 --enable-shared=libgcc,bfd,opcodes \
707 --enable-nls \
708 --without-included-gettext \
709 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
710 --prefix=/gcc \
711 --with-gnu-ld \
712 --with-gnu-as \
713 --disable-libgcj \
714 --enable-languages=c,c++ "
715else
716 $(ASH) -c "$< \
717 --disable-clh \
718 --enable-shared=libgcc,bfd,opcodes \
719 --enable-nls \
720 --without-included-gettext \
721 --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
722 --prefix=/gcc \
723 --with-gnu-ld \
724 --with-gnu-as \
725 --disable-libgcj \
726 --enable-languages=c,c++ "
727endif
728 touch $(PATH_OBJ)/gcc/.ts.configured
729# TODO: Andy, on Linux --enable-clh result in linking errors.
730
731# Install the GCC build
732# Repeating the prefix doesn't hurt anybody.
733gcc-install-it:
734 $(MAKE) prefix=$(ALL_PREFIX) install
735
736
737
738# easy, update src/gcc/gcc/version.c
739gcc-versionstamps:
740 @echo "Version stamping gcc..."
741 mv -f $(PATH_TOP)/src/gcc/gcc/version.c $(PATH_TOP)/src/gcc/gcc/version.tmp.c
742 sed -e '/version_string/s/\([0-9]\.[0-9]*\.[0-9]*\).*/\1 $(INNOTEK_VERSION)";/' \
743 $(PATH_TOP)/src/gcc/gcc/version.tmp.c > $(PATH_TOP)/src/gcc/gcc/version.c
744 rm -f $(PATH_TOP)/src/gcc/gcc/version.tmp.c
745
746
747# Install to builttools directory.
748## WARNING! Another spec HACK!
749gcc-builttools-stage2:
750 $(MAKE) -C $(PATH_OBJ)/gcc prefix=$(PATH_BUILTTOOLS_TMPD) install
751## cp $(PATH_TOP)/src/emx/src/lib/libc.specs $(PATH_OBJ)/gcc/gcc/specs
752
753
754# Generate diffs for GCC (v3.2.2) - part of packing a release.
755.PHONY: gcc-diff $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff
756gcc-diff: $(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff
757$(ALL_PREFIX)/src/diffs/gcc-$(GCC_VERSION).diff:
758 mkdir -p $(@D)
759 $(TOOL_CVS_DIFF_TREE) $(GCC_CVS_REL) src/gcc > $@
760
761
762
763##############################################################################
764###############################################################################
765###############################################################################
766#
767# G C C - O M F f o r D e B u G i n g
768#
769###############################################################################
770###############################################################################
771###############################################################################
772all-gccomf: gccomf
773
774gccomf: gcc-autoconf-refresh \
775 gccomf-build
776 echo "Successfully build GCC OMF."
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-prompt:
787 mkdir -p $(PATH_OBJ)/gccomf
788 $(MAKE) -e -C $(PATH_OBJ)/gccomf -f $(MAKEFILE) $@-it
789gccomf-prompt-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"; \
799 export BOOT_LDFLAGS="$(OMFSPEC_HACK) -Zomf -g -Zexe -Zcrtdll"; \
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" \
822 BOOT_LDFLAGS="$(OMFSPEC_HACK) -Zomf -g -Zexe -Zcrtdll" \
823 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# easy, update same stuff in a bunch of files.
1066# actually, nothing any long as the global innotekversion.h takes care of it
1067# together with proper dependencies.
1068EMX_FILE_VER = \
1069emxbind/emxbind.h emxcat/emxcat.c emxdoc/emxdoc.c emxexp/emxexp.c emximp/emximp.c \
1070emxload/emxload.c emxomf/emxaout.c emxomf/emxomf.c emxomf/emxomfar.c emxomf/emxomfld.c \
1071emxomf/listomf.c emxstack/emxstack.c emxtsf/emxtsf.c os2/version.h
1072emx-versionstamps:
1073 @echo "Version stamping EMX..."
1074
1075# Install the compiled emx stuff to builttools.
1076##emx-builttools-stage2: emx-builttools-stage2-specs
1077emx-builttools-stage2:
1078 $(MAKE) -C $(PATH_TOP)/src/emx $(EMX_DEFINES) INS=$(PATH_BUILTTOOLS_TMP)/ install
1079
1080## bird: for now we will just replace the specs with the constantly updated libc specs.
1081emx-builttools-stage2-specs:
1082## -mv -f $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs \
1083## $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/emxspecs
1084## cp $(PATH_TOP)/src/emx/src/lib/libc.specs \
1085## $(PATH_BUILTTOOLS_TMP)/lib/gcc-lib/i386-pc-os2-emx/$(GCC_VERSION)/specs
1086
1087
1088# Generate diffs for Binutils (part of packing).
1089.PHONY: binutils-diff $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
1090emx-diff: $(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff
1091$(ALL_PREFIX)/src/diffs/emx-$(EMX_VERSION).diff:
1092 mkdir -p $(@D)
1093 $(TOOL_CVS_DIFF_TREE) $(EMX_CVS_REL) src/emx > $@
1094
1095
1096
1097
1098
1099###############################################################################
1100###############################################################################
1101###############################################################################
1102#
1103# P A C K I N G
1104#
1105###############################################################################
1106###############################################################################
1107###############################################################################
1108packing: packing-movetoinstall
1109 rm -f $(PATH_BIN)/GCC-$(GCC_VERSION).zip
1110 cd $(ALL_PREFIX)/.. ; zip -rX9 $(PATH_BIN)/GCC-$(GCC_VERSION).zip *
1111
1112
1113# this stuff should be in the install rules.
1114packing-movetoinstall:
1115 mkdir -p $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1116 mkdir -p $(ALL_PREFIX)/lib
1117 cp $(PATH_TOP)/doc/ReleaseNotes.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1118 cp $(PATH_TOP)/doc/Install.os2 $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)
1119 cp $(PATH_TOP)/ChangeLog $(ALL_PREFIX)/doc/GCC-$(GCC_VERSION)/ChangeLog.os2
1120 cp $(PATH_TOP)/src/install/MakeOmfLibs.cmd $(ALL_PREFIX)/lib
1121 ar cr $(ALL_PREFIX)/lib/m.a
1122
1123
1124###############################################################################
1125###############################################################################
1126###############################################################################
1127#
1128# M I S C
1129#
1130###############################################################################
1131###############################################################################
1132###############################################################################
1133
1134
1135dejagnu:
1136# nothing to make at the moment, it's just a all install stuff it seems.
1137
1138requires_autoconf_2_52_DEJAGNU_CONFIGURE_DIRS = \
1139src/misc/dejagnu \
1140src/misc/dejagnu/contrib/bluegnu2.0.3 \
1141src/misc/dejagnu/contrib/bluegnu2.0.3/doc \
1142src/misc/dejagnu/contrib/bluegnu2.0.3/example \
1143src/misc/dejagnu/contrib/bluegnu2.0.3/example/calc \
1144src/misc/dejagnu/contrib/bluegnu2.0.3/testsuite \
1145src/misc/dejagnu/example/calc \
1146src/misc/dejagnu/example/hello
1147
1148.PHONY: dejagnu-autoconf-refresh dejagnu-autoconf-rerun dejagnu-autoconf-clean dejagnu-autoconf-remove
1149dejagnu-autoconf-refresh dejagnu-autoconf-rerun dejagnu-autoconf-clean dejagnu-autoconf-remove:
1150ifeq "$(BUILD_PLATFORM)" "LINUX"
1151 -$(SH) $(PATH_TOP)/xfix.sh
1152endif
1153 for dir in $(DEJAGNU_CONFIGURE_DIRS); do \
1154 if $(MAKE) $(@:dejagnu-autoconf-%=%) -f $(PWD)/config.gmk -C $$dir ; then \
1155 true; \
1156 else \
1157 exit 8; \
1158 fi \
1159 done
1160
1161
1162
1163#
1164# Expect
1165#
1166
1167expect:
1168
1169
1170# build the components.
1171.PHONY: expect-build expect-install expect-configure
1172expect-build expect-install expect-configure:
1173 mkdir -p $(PATH_OBJ)/misc/expect
1174 $(MAKE) -C $(PATH_OBJ)/misc/expect -f $(MAKEFILE) $@-it
1175
1176
1177# When changed directory
1178expect-build-it: \
1179 $(PATH_OBJ)/misc/expect/.ts.configured
1180 $(MAKE) -C $(PATH_OBJ)/misc/expect
1181
1182# configure it (invoked after directory change).
1183# We set CC to help configure finding it.
1184# And we reconfigure libiberty to the gcc one.
1185expect-configure-it $(PATH_OBJ)/misc/expect/.ts.configured: $(PATH_TOP)/src/misc/expect/configure
1186ifeq "$(BUILD_PLATFORM)" "OS2"
1187 $(ASH) -c " \
1188 export CC=\"gcc.exe\" ; \
1189 $< \
1190 --disable-shared \
1191 --host=i386-pc-os2-emx \
1192 --with-tclconfig=$(UNIXROOT)/usr/lib \
1193 --with-tclinclude=$(UNIXROOT)/usr/lib/tcl8.0/include \
1194 --enable-gcc \
1195 $(BUILD_ENABLE_SYMBOLS) \
1196 --prefix=$(PATH_BUILTTOOLSD) "
1197else
1198 $(ASH) -c " \
1199 $< \
1200 --enable-gcc \
1201 $(BUILD_ENABLE_SYMBOLS) \
1202 --prefix=$(PATH_BUILTTOOLSD) "
1203endif
1204 touch $(PATH_OBJ)/misc/expect/.ts.configured
1205
1206
1207# install to builttools (if anywhere!)
1208expect-install-it:
1209 $(MAKE) prefix=$(PATH_BUILTTOOLSD) install
1210
1211
1212
1213EXPECT_CONFIGURE_DIRS = \
1214src/misc/expect
1215# skipping testsuite for now as it requires some .m4 files we don't have.
1216#src/misc/expect/testsuite
1217
1218.PHONY: expect-autoconf-refresh expect-autoconf-rerun expect-autoconf-clean expect-autoconf-remove
1219expect-autoconf-refresh expect-autoconf-rerun expect-autoconf-clean expect-autoconf-remove:
1220ifeq "$(BUILD_PLATFORM)" "LINUX"
1221 -$(SH) $(PATH_TOP)/xfix.sh
1222endif
1223 for dir in $(EXPECT_CONFIGURE_DIRS); do \
1224 if $(MAKE) $(@:expect-autoconf-%=%) -f $(PWD)/config.gmk -C $$dir ; then \
1225 true; \
1226 else \
1227 exit 8; \
1228 fi \
1229 done
1230
1231
1232
1233
1234# DO NOT DELETE
Note: See TracBrowser for help on using the repository browser.