| 1 | # $Id: Makefile 90 2003-05-05 09:26:47Z 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 | ###############################################################################
|
|---|
| 18 | PWD := $(shell pwd)
|
|---|
| 19 | PWDD := $(shell pwd|sed 's/^[a-zA-Z]://')
|
|---|
| 20 | MAKEFILE = $(PWD)/Makefile
|
|---|
| 21 |
|
|---|
| 22 | ifndef "$(BUILD_MODE)"
|
|---|
| 23 | export BUILD_MODE=DEBUG
|
|---|
| 24 | endif
|
|---|
| 25 |
|
|---|
| 26 | ifndef PATH_TOP
|
|---|
| 27 | export PATH_TOP := $(PWD)
|
|---|
| 28 | endif
|
|---|
| 29 | ifndef PATH_TOPD
|
|---|
| 30 | export PATH_TOPD := $(PWDD)
|
|---|
| 31 | endif
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 | export PATH_BIN = $(PATH_TOP)/bin/$(BUILD_PLATFORM)/$(BUILD_MODE)
|
|---|
| 35 | export PATH_BIND = $(PATH_TOPD)/bin/$(BUILD_PLATFORM)/$(BUILD_MODE)
|
|---|
| 36 | ifndef PATH_OBJ
|
|---|
| 37 | export PATH_OBJ = $(PATH_TOP)/obj/$(BUILD_PLATFORM)/$(BUILD_MODE)
|
|---|
| 38 | export PATH_OBJD = $(PATH_TOPD)/obj/$(BUILD_PLATFORM)/$(BUILD_MODE)
|
|---|
| 39 | endif
|
|---|
| 40 | export PATH_BUILTTOOLS = $(PATH_OBJ)/builttools
|
|---|
| 41 | export PATH_BUILTTOOLSD= $(PATH_OBJD)/builttools
|
|---|
| 42 |
|
|---|
| 43 | # Debug info or not (when ever we feel like passing down such options).
|
|---|
| 44 | ifeq "$(BUILD_MODE)" "RELEASE"
|
|---|
| 45 | BUILD_DEBUGINFO = -s
|
|---|
| 46 | else
|
|---|
| 47 | BUILD_DEBUGINFO = -g
|
|---|
| 48 | endif
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 | #
|
|---|
| 52 | # For builds on Linux Host builds we do the environment setup here.
|
|---|
| 53 | # This is essentially a mimicking of what we do on OS/2.
|
|---|
| 54 | #
|
|---|
| 55 | ifndef BUILD_PLATFORM
|
|---|
| 56 | ifeq "$(shell uname -s)" "Linux"
|
|---|
| 57 | export BUILD_PLATFORM ?= LINUX
|
|---|
| 58 | export BUILD_PROJECT ?= GCCOS2
|
|---|
| 59 | export SH ?= /bin/sh
|
|---|
| 60 | export ASH ?= /bin/ash
|
|---|
| 61 | export BASH ?= /bin/bash
|
|---|
| 62 | export AWK ?= /bin/gawk
|
|---|
| 63 | export GAWK ?= /bin/gawk
|
|---|
| 64 | export CONFIG_SHELL ?= $(SH)
|
|---|
| 65 | export MAKESHELL ?= $(SH)
|
|---|
| 66 | export PATH_EMX ?= /usr
|
|---|
| 67 | export PATH_EMXPGCC ?= /usr
|
|---|
| 68 | export TMP ?= /tmp
|
|---|
| 69 | export TMPDIR ?= /tmp
|
|---|
| 70 | endif
|
|---|
| 71 | endif
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 | ###############################################################################
|
|---|
| 75 | ###############################################################################
|
|---|
| 76 | ###############################################################################
|
|---|
| 77 | ###############################################################################
|
|---|
| 78 | #
|
|---|
| 79 | # M a i n R u l e z
|
|---|
| 80 | #
|
|---|
| 81 | ###############################################################################
|
|---|
| 82 | ###############################################################################
|
|---|
| 83 | ###############################################################################
|
|---|
| 84 | ###############################################################################
|
|---|
| 85 | all:
|
|---|
| 86 | mkdir -p $(PATH_OBJ)
|
|---|
| 87 | $(MAKE) -C . all-logged 2>&1 | $(UNIXROOT)/usr/bin/tee $(PATH_OBJ)/build-`date +"%Y%m%d-%H%M%S"`.log
|
|---|
| 88 |
|
|---|
| 89 | all-logged: \
|
|---|
| 90 | all-start \
|
|---|
| 91 | all-env \
|
|---|
| 92 | all-sanity \
|
|---|
| 93 | all-preload \
|
|---|
| 94 | all-builttools-initial \
|
|---|
| 95 | all-symlinks \
|
|---|
| 96 | \
|
|---|
| 97 | all-binutils \
|
|---|
| 98 | all-gcc \
|
|---|
| 99 | all-emx \
|
|---|
| 100 | \
|
|---|
| 101 | all-install \
|
|---|
| 102 | \
|
|---|
| 103 | all-ended
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 | all-start:
|
|---|
| 107 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
|---|
| 108 | @echo "+ Make started: $(shell date)"
|
|---|
| 109 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 | all-ended:
|
|---|
| 113 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
|---|
| 114 | @echo "+ Make ended: $(shell date)"
|
|---|
| 115 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 | all-env:
|
|---|
| 119 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
|---|
| 120 | @echo "Variables:"
|
|---|
| 121 | @echo " PWD = $(PWD)"
|
|---|
| 122 | @echo " PWDD = $(PWDD)"
|
|---|
| 123 | @echo " PATH_TOP = $(PATH_TOP)"
|
|---|
| 124 | @echo " PATH_TOPD = $(PATH_TOPD)"
|
|---|
| 125 | @echo " PATH_OBJ = $(PATH_OBJ)"
|
|---|
| 126 | @echo " PATH_OBJD = $(PATH_OBJD)"
|
|---|
| 127 | @echo " PATH_BIN = $(PATH_BIN)"
|
|---|
| 128 | @echo " PATH_BIND = $(PATH_BIND)"
|
|---|
| 129 | @echo " PATH_EMXPGCC = $(PATH_EMXPGCC)"
|
|---|
| 130 | @echo " PATH_EMX = $(PATH_EMX)"
|
|---|
| 131 | @echo " BUILD_MODE = $(BUILD_MODE)"
|
|---|
| 132 | @echo " BUILD_PLATFORM = $(BUILD_PLATFORM)"
|
|---|
| 133 | @echo " BUILD_PROJECT = $(BUILD_PROJECT)"
|
|---|
| 134 | @echo " MAKEFILE = $(MAKEFILE)"
|
|---|
| 135 | @echo " UNIXROOT = $(UNIXROOT)"
|
|---|
| 136 | @echo " AC_PREFIX = $(AC_PREFIX)"
|
|---|
| 137 | @echo " AC_MACRODIR = $(AC_MACRODIR)"
|
|---|
| 138 | @echo " HOSTNAME = $(HOSTNAME)"
|
|---|
| 139 | @echo " USER = $(USER)"
|
|---|
| 140 | @echo " LOGNAME = $(LOGNAME)"
|
|---|
| 141 | @echo " TMP = $(TMP)"
|
|---|
| 142 | @echo " TMPDIR = $(TMPDIR)"
|
|---|
| 143 | @echo " USER = $(USER)"
|
|---|
| 144 | @echo " AWK = $(AWK)"
|
|---|
| 145 | @echo " GAWK = $(GAWK)"
|
|---|
| 146 | @echo " SH = $(SH)"
|
|---|
| 147 | @echo " ASH = $(ASH)"
|
|---|
| 148 | @echo " BASH = $(BASH)"
|
|---|
| 149 | @echo " CONFIG_SHELL = $(CONFIG_SHELL)"
|
|---|
| 150 | @echo " MAKESHELL = $(MAKESHELL)"
|
|---|
| 151 | @echo " EMXSHELL = $(EMXSHELL)"
|
|---|
| 152 | @echo " SHELL = $(SHELL)"
|
|---|
| 153 | @echo " MAKE = $(MAKE)"
|
|---|
| 154 | @echo " PATH = $(PATH)"
|
|---|
| 155 | @echo " C_INCLUDE_PATH = $(C_INCLUDE_PATH)"
|
|---|
| 156 | @echo " CPLUS_INCLUDE_PATH = $(CPLUS_INCLUDE_PATH)"
|
|---|
| 157 | @echo " OBJC_INCLUDE_PATH = $(OBJC_INCLUDE_PATH)"
|
|---|
| 158 | @echo " LIBRARY_PATH = $(LIBRARY_PATH)"
|
|---|
| 159 | @echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
|
|---|
| 160 |
|
|---|
| 161 | all-sanity:
|
|---|
| 162 | @echo -n "Checking build environment sanity... "
|
|---|
| 163 | @if [ "x$(BUILD_PROJECT)" != "xGCCOS2" ]; then \
|
|---|
| 164 | echo ""; echo "Error: BUILD_PROJECT is wrong or isn't defined!"; \
|
|---|
| 165 | exit 8; \
|
|---|
| 166 | fi
|
|---|
| 167 | @if [ "x$(BUILD_PLATFORM)" != "xOS2" -a "x$(BUILD_PLATFORM)" != "xLINUX" ]; then \
|
|---|
| 168 | echo ""; echo "Error: BUILD_PLATFORM is wrong or isn't defined!"; \
|
|---|
| 169 | exit 8; \
|
|---|
| 170 | fi
|
|---|
| 171 | @if [ "x$(BUILD_PLATFORM)" = "xOS2" -a "x$(UNIXROOT)" = "x" ]; then \
|
|---|
| 172 | echo ""; echo "Error: UNIXROOT isn't defined!"; \
|
|---|
| 173 | exit 8; \
|
|---|
| 174 | fi
|
|---|
| 175 | @if [ "x$(BUILD_PLATFORM)" != "xOS2" -a "x$(UNIXROOT)" != "x" ]; then \
|
|---|
| 176 | echo ""; echo "Error: UNIXROOT is defined!"; \
|
|---|
| 177 | exit 8; \
|
|---|
| 178 | fi
|
|---|
| 179 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
|---|
| 180 | @if gcc --version | grep -qe ".*[3]\.[2-9]\.[0-9]"; then \
|
|---|
| 181 | true; \
|
|---|
| 182 | else \
|
|---|
| 183 | echo ""; echo "Warning: GCC v3.2.x or higher is recommended!"; \
|
|---|
| 184 | fi
|
|---|
| 185 | @if ar --version | grep -qe ".*2\.11\.[2-9]" -e ".*[2]\.1[2-9]\.[0-9]*"; then \
|
|---|
| 186 | true; \
|
|---|
| 187 | else \
|
|---|
| 188 | echo ""; echo "Warning: AR v2.11.2 or higher is recommended!"; \
|
|---|
| 189 | fi
|
|---|
| 190 | endif
|
|---|
| 191 | @echo "ok"
|
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 | PRELOADED_TOOLS = bin/sh.exe bin/echo.exe bin/true.exe usr/bin/test.exe usr/bin/expr.exe \
|
|---|
| 195 | usr/bin/gawk.exe usr/bin/sed.exe bin/rm.exe bin/cat.exe bin/cp.exe
|
|---|
| 196 |
|
|---|
| 197 | all-preload:
|
|---|
| 198 | @echo "Preloading tools:"
|
|---|
| 199 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
|---|
| 200 | @for tool in $(PRELOADED_TOOLS); do \
|
|---|
| 201 | echo -n " $$tool"; \
|
|---|
| 202 | emxload -e $(UNIXROOT)/$$tool; \
|
|---|
| 203 | done
|
|---|
| 204 | emxload -e gcc.exe g++.exe ld.exe cc1.exe as.exe cc1plus.exe cpp0.exe ar.exe
|
|---|
| 205 | endif
|
|---|
| 206 | @echo ""
|
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 | all-install: \
|
|---|
| 211 | gcc-install
|
|---|
| 212 | # emx-install
|
|---|
| 213 | # binutils-install
|
|---|
| 214 |
|
|---|
| 215 |
|
|---|
| 216 |
|
|---|
| 217 | ###############################################################################
|
|---|
| 218 | ###############################################################################
|
|---|
| 219 | ###############################################################################
|
|---|
| 220 | #
|
|---|
| 221 | # B u i l t T o o l s
|
|---|
| 222 | #
|
|---|
| 223 | ###############################################################################
|
|---|
| 224 | ###############################################################################
|
|---|
| 225 | ###############################################################################
|
|---|
| 226 | .PHONY: all-builttools-initial all-builttools-dirs
|
|---|
| 227 | all-builttools-initial: \
|
|---|
| 228 | all-builttools-dirs \
|
|---|
| 229 | $(PATH_BUILTTOOLS)/usr/bin/dllar.cmd \
|
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 | all-builttools-dirs:
|
|---|
| 233 | mkdir -p $(PATH_BUILTTOOLS)/bin $(PATH_BUILTTOOLS)/lib $(PATH_BUILTTOOLS)/usr/bin $(PATH_BUILTTOOLS)/usr/lib
|
|---|
| 234 |
|
|---|
| 235 | $(PATH_BUILTTOOLS)/usr/bin/dllar.cmd: $(PATH_TOP)/src/misc/dllar.cmd
|
|---|
| 236 | cp $< $@
|
|---|
| 237 |
|
|---|
| 238 |
|
|---|
| 239 |
|
|---|
| 240 |
|
|---|
| 241 | ###############################################################################
|
|---|
| 242 | ###############################################################################
|
|---|
| 243 | ###############################################################################
|
|---|
| 244 | #
|
|---|
| 245 | # S y m l i n k s
|
|---|
| 246 | #
|
|---|
| 247 | #
|
|---|
| 248 | # We use symlinking of binutils stuff into the gcc tree so we can
|
|---|
| 249 | # build everything in one go and take advantage of the gcc
|
|---|
| 250 | # makesystem which will use the binutils we built when doing the
|
|---|
| 251 | # gcc libraries and such.
|
|---|
| 252 | #
|
|---|
| 253 | # On OS/2 symlinks doesn't exist so, we'll copy the source trees.
|
|---|
| 254 | # Copy because this will for directories work ok with cvs, moving
|
|---|
| 255 | # directories would cause 'cvs update -d' to refetch stuff.
|
|---|
| 256 | #
|
|---|
| 257 | #
|
|---|
| 258 | #w##############################################################################
|
|---|
| 259 | ###############################################################################
|
|---|
| 260 | ###############################################################################
|
|---|
| 261 | all-symlinks:
|
|---|
| 262 | # Don't do this till we've got binutils working.
|
|---|
| 263 | # all-symlinks-binutils
|
|---|
| 264 |
|
|---|
| 265 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
|---|
| 266 | TOOL_SYMLINK_FILE = cp
|
|---|
| 267 | TOOL_SYMLINK_DIR = cp -Rf
|
|---|
| 268 | TOOL_SYMLINK_MKDIR = mkdir
|
|---|
| 269 | TOOL_UNSYMLINK_DIR = rm -Rf
|
|---|
| 270 | else
|
|---|
| 271 | TOOL_SYMLINK_FILE = ln -s
|
|---|
| 272 | TOOL_SYMLINK_DIR = ln -s
|
|---|
| 273 | TOOL_SYMLINK_MKDIR = true
|
|---|
| 274 | TOOL_UNSYMLINK_DIR = rm
|
|---|
| 275 | endif
|
|---|
| 276 |
|
|---|
| 277 | SYMLINKS_BINUTILS_TO_GCC_DIRS = \
|
|---|
| 278 | bfd \
|
|---|
| 279 | binutils \
|
|---|
| 280 | etc \
|
|---|
| 281 | gas \
|
|---|
| 282 | gprof \
|
|---|
| 283 | intl \
|
|---|
| 284 | ld \
|
|---|
| 285 | opcodes \
|
|---|
| 286 | texinfo \
|
|---|
| 287 | include/aout \
|
|---|
| 288 | include/coff \
|
|---|
| 289 | include/elf \
|
|---|
| 290 | include/nlm \
|
|---|
| 291 | include/opcode \
|
|---|
| 292 | include/regs \
|
|---|
| 293 |
|
|---|
| 294 | SYMLINKS_BINUTILS_TO_GCC_FILES = \
|
|---|
| 295 | include/alloca-conf.h \
|
|---|
| 296 | include/ansidecl.h \
|
|---|
| 297 | include/bfdlink.h \
|
|---|
| 298 | include/bin-bugs.h \
|
|---|
| 299 | include/bout.h \
|
|---|
| 300 | include/callback.h \
|
|---|
| 301 | include/ChangeLog \
|
|---|
| 302 | include/COPYING \
|
|---|
| 303 | include/demangle.h \
|
|---|
| 304 | include/dis-asm.h \
|
|---|
| 305 | include/dyn-string.h \
|
|---|
| 306 | include/filenames.h \
|
|---|
| 307 | include/floatformat.h \
|
|---|
| 308 | include/fnmatch.h \
|
|---|
| 309 | include/fopen-bin.h \
|
|---|
| 310 | include/fopen-same.h \
|
|---|
| 311 | include/fopen-vms.h \
|
|---|
| 312 | include/gdbm.h \
|
|---|
| 313 | include/getopt.h \
|
|---|
| 314 | include/hashtab.h \
|
|---|
| 315 | include/hp-symtab.h \
|
|---|
| 316 | include/ieee.h \
|
|---|
| 317 | include/libiberty.h \
|
|---|
| 318 | include/MAINTAINERS \
|
|---|
| 319 | include/md5.h \
|
|---|
| 320 | include/oasys.h \
|
|---|
| 321 | include/objalloc.h \
|
|---|
| 322 | include/obstack.h \
|
|---|
| 323 | include/os9k.h \
|
|---|
| 324 | include/partition.h \
|
|---|
| 325 | include/progress.h \
|
|---|
| 326 | include/remote-sim.h \
|
|---|
| 327 | include/safe-ctype.h \
|
|---|
| 328 | include/sim-d10v.h \
|
|---|
| 329 | include/sort.h \
|
|---|
| 330 | include/splay-tree.h \
|
|---|
| 331 | include/symcat.h \
|
|---|
| 332 |
|
|---|
| 333 | # Symlink binutils stuff to gcc.
|
|---|
| 334 | # Note the test should've been "! -e", but that doesn' work in ash... :/
|
|---|
| 335 | all-symlinks-binutils:
|
|---|
| 336 | for file in $(SYMLINKS_BINUTILS_TO_GCC_FILES); do \
|
|---|
| 337 | if [ ! -f "$(PATH_TOP)/src/gcc/$$file" ]; then \
|
|---|
| 338 | $(TOOL_SYMLINK_FILE) $(PATH_TOP)/src/binutils/$$file $(PATH_TOP)/src/gcc/$$file && \
|
|---|
| 339 | touch $(PATH_TOP)/src/gcc/$${file}.symlinked ; \
|
|---|
| 340 | fi ; \
|
|---|
| 341 | done
|
|---|
| 342 | for dir in $(SYMLINKS_BINUTILS_TO_GCC_DIRS) ; do \
|
|---|
| 343 | if [ ! -d "$(PATH_TOP)/src/gcc/$$dir" ] ; then \
|
|---|
| 344 | $(TOOL_SYMLINK_MKDIR) $(PATH_TOP)/src/gcc/$$dir && \
|
|---|
| 345 | touch $(PATH_TOP)/src/gcc/$${dir}.symlinked && \
|
|---|
| 346 | $(TOOL_SYMLINK_DIR) $(PATH_TOP)/src/binutils/$$dir $(PATH_TOP)/src/gcc/ ; \
|
|---|
| 347 | fi ; \
|
|---|
| 348 | done
|
|---|
| 349 |
|
|---|
| 350 | all-symlinks-unlink-binutils:
|
|---|
| 351 | for file in $(SYMLINKS_BINUTILS_TO_GCC_FILES); do \
|
|---|
| 352 | if [ -f "$(PATH_TOP)/src/gcc/$${file}.symlinked" ]; then \
|
|---|
| 353 | rm $(PATH_TOP)/src/gcc/$${file} && \
|
|---|
| 354 | rm $(PATH_TOP)/src/gcc/$${file}.symlinked ; \
|
|---|
| 355 | fi ; \
|
|---|
| 356 | done
|
|---|
| 357 | for dir in $(SYMLINKS_BINUTILS_TO_GCC_DIRS) ; do \
|
|---|
| 358 | if [ -f "$(PATH_TOP)/src/gcc/$$dir.symlinked" ] ; then \
|
|---|
| 359 | $(TOOL_UNSYMLINK_DIR) $(PATH_TOP)/src/gcc/$${dir} && \
|
|---|
| 360 | rm $(PATH_TOP)/src/gcc/$${dir}.symlinked ; \
|
|---|
| 361 | fi ; \
|
|---|
| 362 | done
|
|---|
| 363 |
|
|---|
| 364 |
|
|---|
| 365 | ###############################################################################
|
|---|
| 366 | ###############################################################################
|
|---|
| 367 | ###############################################################################
|
|---|
| 368 | #
|
|---|
| 369 | # G C C
|
|---|
| 370 | #
|
|---|
| 371 | ###############################################################################
|
|---|
| 372 | ###############################################################################
|
|---|
| 373 | ###############################################################################
|
|---|
| 374 | all-gcc gcc: \
|
|---|
| 375 | gcc-autoconf-refresh \
|
|---|
| 376 | gcc-build
|
|---|
| 377 | echo "Successfully build GCC."
|
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 |
|
|---|
| 381 | GCC_DIRS = \
|
|---|
| 382 | gcc/libiberty \
|
|---|
| 383 | gcc/zlib \
|
|---|
| 384 | gcc/gcc \
|
|---|
| 385 | gcc/libstdc++-v3 \
|
|---|
| 386 | gcc/boehm-gc \
|
|---|
| 387 | gcc/fastjar \
|
|---|
| 388 | gcc/libf2c \
|
|---|
| 389 | gcc/libf2c/libF77 \
|
|---|
| 390 | gcc/libf2c/libI77 \
|
|---|
| 391 | gcc/libf2c/libU77 \
|
|---|
| 392 | gcc/libffi \
|
|---|
| 393 | gcc/libjava \
|
|---|
| 394 | gcc/libjava/libltdl \
|
|---|
| 395 | gcc/libobjc \
|
|---|
| 396 |
|
|---|
| 397 | not_yet =\
|
|---|
| 398 | gcc/bfd \
|
|---|
| 399 | gcc/binutils \
|
|---|
| 400 | gcc/gas \
|
|---|
| 401 | gcc/gprof \
|
|---|
| 402 | gcc/intl \
|
|---|
| 403 | gcc/ld \
|
|---|
| 404 | gcc/libiberty \
|
|---|
| 405 | gcc/opcodes \
|
|---|
| 406 |
|
|---|
| 407 | GCC_CONFIGURE_DIRS = $(GCC_DIRS)
|
|---|
| 408 |
|
|---|
| 409 |
|
|---|
| 410 | # configure.in/configure
|
|---|
| 411 | .PHONY: gcc-autoconf-refresh gcc-autoconf-rerun gcc-autoconf-clean gcc-autoconf-remove
|
|---|
| 412 | gcc-autoconf-refresh gcc-autoconf-rerun gcc-autoconf-clean gcc-autoconf-remove:
|
|---|
| 413 | ifeq "$(BUILD_PLATFORM)" "LINUX"
|
|---|
| 414 | -$(SH) $(PATH_TOP)/xfix.sh
|
|---|
| 415 | endif
|
|---|
| 416 | for dir in $(GCC_CONFIGURE_DIRS); do \
|
|---|
| 417 | $(MAKE) $(@:gcc-autoconf-%=%) -f $(PWD)/config.gmk -C src/$$dir ; \
|
|---|
| 418 | done
|
|---|
| 419 |
|
|---|
| 420 |
|
|---|
| 421 | # build the components.
|
|---|
| 422 | .PHONY: gcc-build gcc-install gcc-configure
|
|---|
| 423 | gcc-build gcc-install gcc-configure:
|
|---|
| 424 | mkdir -p $(PATH_OBJ)/gcc
|
|---|
| 425 | $(MAKE) -C $(PATH_OBJ)/gcc -f $(MAKEFILE) $@-it
|
|---|
| 426 |
|
|---|
| 427 |
|
|---|
| 428 | # When changed directory
|
|---|
| 429 | # We pass down BOOT_ flags for stage2+.
|
|---|
| 430 | # Because strip is broken on OS/2 we pass -s for release build and -g for
|
|---|
| 431 | # non release builds - This overrides some stuff in src/gcc/gcc/config/i386/t-emx!
|
|---|
| 432 | gcc-build-it: \
|
|---|
| 433 | $(PATH_OBJ)/gcc/.ts.configured
|
|---|
| 434 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
|---|
| 435 | unset GCCLOAD & $(MAKE) -C $(PATH_OBJ)/gcc \
|
|---|
| 436 | LIBGCC2_DEBUG_CFLAGS="$(BUILD_DEBUGINFO)" \
|
|---|
| 437 | BOOT_CFLAGS="$(BUILD_DEBUGINFO) -O2 -mcpu=pentium -mpreferred-stack-boundary=2 -malign-strings=0 -falign-loops=2 -falign-jumps=2 -falign-functions=2" \
|
|---|
| 438 | BOOT_LDFLAGS="$(BUILD_DEBUGINFO) -Zexe -Zcrtdll" \
|
|---|
| 439 | LIBGCC2_DEBUG_CFLAG="$(BUILD_DEBUGINFO)" \
|
|---|
| 440 | bootstrap
|
|---|
| 441 | else
|
|---|
| 442 | $(MAKE) -C $(PATH_OBJ)/gcc bootstrap
|
|---|
| 443 | endif
|
|---|
| 444 |
|
|---|
| 445 | # configure it (invoked after directory change).
|
|---|
| 446 | # We set CC to help configure finding it.
|
|---|
| 447 | gcc-configure-it $(PATH_OBJ)/gcc/.ts.configured: $(PATH_TOP)/src/gcc/configure
|
|---|
| 448 | ifeq "$(BUILD_PLATFORM)" "OS2"
|
|---|
| 449 | $(ASH) -c " \
|
|---|
| 450 | export CC=\"gcc.exe\" ; \
|
|---|
| 451 | $< \
|
|---|
| 452 | --enable-clh \
|
|---|
| 453 | --enable-threads=os2 \
|
|---|
| 454 | --enable-shared=libgcc \
|
|---|
| 455 | --enable-nls \
|
|---|
| 456 | --without-included-gettext \
|
|---|
| 457 | --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
|
|---|
| 458 | --prefix=$(PATH_BIND)/gcc322 \
|
|---|
| 459 | --with-gnu-ld \
|
|---|
| 460 | --with-gnu-as \
|
|---|
| 461 | --disable-libgcj \
|
|---|
| 462 | --enable-languages=c,c++ "
|
|---|
| 463 | else
|
|---|
| 464 | $(ASH) -c "$< \
|
|---|
| 465 | --enable-clh \
|
|---|
| 466 | --enable-shared=libgcc \
|
|---|
| 467 | --enable-nls \
|
|---|
| 468 | --without-included-gettext \
|
|---|
| 469 | --with-local-prefix=$(subst \,/,$(PATH_EMXPGCC)) \
|
|---|
| 470 | --prefix=$(PATH_BIND)/gcc322 \
|
|---|
| 471 | --with-gnu-ld \
|
|---|
| 472 | --with-gnu-as \
|
|---|
| 473 | --disable-libgcj \
|
|---|
| 474 | --enable-languages=c,c++ "
|
|---|
| 475 | endif
|
|---|
| 476 | touch $(PATH_OBJ)/gcc/.ts.configured
|
|---|
| 477 |
|
|---|
| 478 |
|
|---|
| 479 | # Install the GCC build
|
|---|
| 480 | # Repeating the prefix doesn't hurt anybody.
|
|---|
| 481 | gcc-install-it:
|
|---|
| 482 | $(MAKE) prefix=$(PATH_BIND)/gcc322 install
|
|---|
| 483 |
|
|---|
| 484 |
|
|---|
| 485 | # Generate diffs for GCC (v3.2.2) - part of packing a release.
|
|---|
| 486 | .PHONY: gcc-diff $(PATH_BIN)/usr/src/gcc/gcc-3.2.2.diff
|
|---|
| 487 | gcc-diff: $(PATH_BIN)/usr/src/gcc/gcc-3.2.2.diff
|
|---|
| 488 | $(PATH_BIN)/usr/src/gcc/gcc-3.2.2.diff:
|
|---|
| 489 | mkdir -p $(@D)
|
|---|
| 490 | -cvs diff -R -N -w -c -r GCC_3-2-2 src/gcc > $@
|
|---|
| 491 |
|
|---|
| 492 |
|
|---|
| 493 |
|
|---|
| 494 | ###############################################################################
|
|---|
| 495 | ###############################################################################
|
|---|
| 496 | ###############################################################################
|
|---|
| 497 | #
|
|---|
| 498 | # B i n U t i l s
|
|---|
| 499 | #
|
|---|
| 500 | ###############################################################################
|
|---|
| 501 | ###############################################################################
|
|---|
| 502 | ###############################################################################
|
|---|
| 503 | all-binutils binutils:
|
|---|
| 504 | echo "Binutils are build together with the other GNU Tools in GCC."
|
|---|
| 505 | echo "Separate building of binutils is not configured."
|
|---|
| 506 |
|
|---|
| 507 |
|
|---|
| 508 |
|
|---|
| 509 | # Generate diffs for GCC (v3.2.2) - part of packing a release.
|
|---|
| 510 | .PHONY: binutils-diff $(PATH_BIN)/usr/src/binutils/binutils-2.11.2.diff
|
|---|
| 511 | binutils-diff: $(PATH_BIN)/usr/src/binutils/binutils-2.11.2.diff
|
|---|
| 512 | $(PATH_BIN)/usr/src/binutils/binutils-2.11.2.diff:
|
|---|
| 513 | mkdir -p $(@D)
|
|---|
| 514 | -cvs diff -R -N -w -c -r BINUTILS_2-11-2 src/binutils > $@
|
|---|
| 515 |
|
|---|
| 516 |
|
|---|
| 517 | ###############################################################################
|
|---|
| 518 | ###############################################################################
|
|---|
| 519 | ###############################################################################
|
|---|
| 520 | #
|
|---|
| 521 | # E M X
|
|---|
| 522 | #
|
|---|
| 523 | ###############################################################################
|
|---|
| 524 | ###############################################################################
|
|---|
| 525 | ###############################################################################
|
|---|
| 526 | all-emx emx:
|
|---|
| 527 | echo "Successfully build EMX."
|
|---|
| 528 | echo "Warning!!! EMX not yet done!"
|
|---|
| 529 |
|
|---|