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