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