make/devkit/Tools.gmk
author herrick
Thu, 28 Mar 2019 13:49:38 -0400
branchJDK-8200758-branch
changeset 57292 7a683c461b80
parent 54148 62e4ada7c4c8
child 58558 67daaa6c8d2b
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
     1
#
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
     2
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
     4
#
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    10
#
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    15
# accompanied this code).
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    16
#
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    20
#
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    23
# questions.
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    24
#
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    25
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    26
##########################################################################################
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    27
#
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    28
# Workhorse makefile for creating ONE cross compiler
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
    29
# Needs either to be from BUILD -> BUILD OR have
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    30
# BUILD -> HOST prebuilt
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    31
#
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
    32
# NOTE: There is a bug here. We don't limit the
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
    33
# PATH when building BUILD -> BUILD, which means that
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    34
# if you configure after you've once build the BUILD->BUILD
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    35
# compiler THAT one will be picked up as the compiler for itself.
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    36
# This is not so great, especially if you did a partial delete
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
    37
# of the target tree.
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    38
#
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    39
# Fix this...
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    40
#
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    41
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    42
$(info TARGET=$(TARGET))
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    43
$(info HOST=$(HOST))
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    44
$(info BUILD=$(BUILD))
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    45
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
    46
ARCH := $(word 1,$(subst -, ,$(TARGET)))
50472
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
    47
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
    48
ifeq ($(TARGET), arm-linux-gnueabihf)
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
    49
  ARCH=armhfp
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
    50
endif
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
    51
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
    52
$(info ARCH=$(ARCH))
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    53
54148
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    54
ifeq ($(BASE_OS), OL)
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    55
  BASE_URL := http://yum.oracle.com/repo/OracleLinux/OL6/4/base/$(ARCH)/
54148
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    56
  LINUX_VERSION := OL6.4
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    57
else ifeq ($(BASE_OS), Fedora)
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    58
  DEFAULT_OS_VERSION := 27
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    59
  ifeq ($(BASE_OS_VERSION), )
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    60
    BASE_OS_VERSION := $(DEFAULT_OS_VERSION)
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    61
  endif
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    62
  ifeq ($(filter x86_64 armhfp, $(ARCH)), )
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    63
    FEDORA_TYPE := fedora-secondary
50472
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
    64
  else
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    65
    FEDORA_TYPE := fedora/linux
50472
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
    66
  endif
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    67
  ARCHIVED := $(shell [ $(BASE_OS_VERSION) -lt $(DEFAULT_OS_VERSION) ] && echo true)
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    68
  ifeq ($(ARCHIVED),true)
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    69
    BASE_URL := https://archives.fedoraproject.org/pub/archive/$(FEDORA_TYPE)/releases/$(BASE_OS_VERSION)/Everything/$(ARCH)/os/Packages/
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    70
  else
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    71
    BASE_URL := https://dl.fedoraproject.org/pub/$(FEDORA_TYPE)/releases/$(BASE_OS_VERSION)/Everything/$(ARCH)/os/Packages/
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    72
  endif
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
    73
  LINUX_VERSION := Fedora_$(BASE_OS_VERSION)
49204
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
    74
else
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
    75
  $(error Unknown base OS $(BASE_OS))
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
    76
endif
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
    77
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    78
##########################################################################################
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    79
# Define external dependencies
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    80
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
    81
# Latest that could be made to work.
54148
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    82
GCC_VER := 8.2.0
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    83
ifeq ($(GCC_VER), 8.2.0)
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    84
  gcc_ver := gcc-8.2.0
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    85
  binutils_ver := binutils-2.30
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    86
  ccache_ver := ccache-3.5.1a
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    87
  CCACHE_DIRNAME := ccache-3.5.1
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    88
  mpfr_ver := mpfr-3.1.5
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    89
  gmp_ver := gmp-6.1.2
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    90
  mpc_ver := mpc-1.0.3
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    91
  gdb_ver := gdb-8.2.1
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
    92
else ifeq ($(GCC_VER), 7.3.0)
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
    93
  gcc_ver := gcc-7.3.0
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
    94
  binutils_ver := binutils-2.30
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
    95
  ccache_ver := ccache-3.3.6
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
    96
  mpfr_ver := mpfr-3.1.5
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
    97
  gmp_ver := gmp-6.1.2
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
    98
  mpc_ver := mpc-1.0.3
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
    99
  gdb_ver := gdb-8.1
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   100
else ifeq ($(GCC_VER), 4.9.2)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   101
  gcc_ver := gcc-4.9.2
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   102
  binutils_ver := binutils-2.25
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   103
  ccache_ver := ccache-3.2.1
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   104
  mpfr_ver := mpfr-3.0.1
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   105
  gmp_ver := gmp-4.3.2
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   106
  mpc_ver := mpc-1.0.1
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   107
  gdb_ver := gdb-7.12.1
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   108
else
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   109
  $(error Unsupported GCC version)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   110
endif
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   111
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   112
GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.xz
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   113
BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.xz
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   114
CCACHE := https://samba.org/ftp/ccache/$(ccache_ver).tar.xz
53556
f3546d51ce9c 8217910: Slow linking with devkit on Linux
erikj
parents: 52665
diff changeset
   115
MPFR := https://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   116
GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   117
MPC := http://ftp.gnu.org/pub/gnu/mpc/${mpc_ver}.tar.gz
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   118
GDB := http://ftp.gnu.org/gnu/gdb/${gdb_ver}.tar.xz
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   119
49204
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
   120
# RPMs used by all BASE_OS
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   121
RPM_LIST := \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   122
    kernel-headers \
34100
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   123
    glibc glibc-headers glibc-devel \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   124
    cups-libs cups-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   125
    libX11 libX11-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   126
    xorg-x11-proto-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   127
    alsa-lib alsa-lib-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   128
    libXext libXext-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   129
    libXtst libXtst-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   130
    libXrender libXrender-devel \
52357
e2478be9c682 8210837: Add libXrandr-devel to the Linux devkits
erikj
parents: 50472
diff changeset
   131
    libXrandr libXrandr-devel \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   132
    freetype freetype-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   133
    libXt libXt-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   134
    libSM libSM-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   135
    libICE libICE-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   136
    libXi libXi-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   137
    libXdmcp libXdmcp-devel \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   138
    libXau libXau-devel \
34592
77d3edda8e8e 8145008: Add libelf package to Linux devkit
erikj
parents: 34100
diff changeset
   139
    libgcc \
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 41458
diff changeset
   140
    zlib zlib-devel \
47433
6331ad007664 8189119: Devkit for Linux needs to include fontconfig-devel
erikj
parents: 47253
diff changeset
   141
    libffi libffi-devel \
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   142
    fontconfig fontconfig-devel \
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   143
    systemtap-sdt-devel \
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   144
    #
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   145
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   146
##########################################################################################
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   147
# Define common directories and files
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   148
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   149
# Ensure we have 32-bit libs also for x64. We enable mixed-mode.
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   150
ifeq (x86_64,$(ARCH))
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   151
  LIBDIRS := lib64 lib
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   152
  CFLAGS_lib := -m32
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   153
else
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   154
  LIBDIRS := lib
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   155
endif
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   156
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   157
# Define directories
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   158
BUILDDIR := $(OUTPUT_ROOT)/$(HOST)/$(TARGET)
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   159
TARGETDIR := $(PREFIX)/$(TARGET)
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   160
SYSROOT := $(TARGETDIR)/sysroot
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   161
DOWNLOAD := $(OUTPUT_ROOT)/download
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   162
DOWNLOAD_RPMS := $(DOWNLOAD)/rpms/$(TARGET)-$(LINUX_VERSION)
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   163
SRCDIR := $(OUTPUT_ROOT)/src
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   164
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   165
# Marker file for unpacking rpms
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   166
rpms := $(SYSROOT)/rpms_unpacked
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   167
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   168
# Need to patch libs that are linker scripts to use non-absolute paths
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   169
libs := $(SYSROOT)/libs_patched
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   170
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   171
################################################################################
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   172
# Download RPMs
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   173
download-rpms:
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   174
	mkdir -p $(DOWNLOAD_RPMS)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   175
        # Only run this if rpm dir is empty.
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   176
        ifeq ($(wildcard $(DOWNLOAD_RPMS)/*.rpm), )
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   177
	  cd $(DOWNLOAD_RPMS) && \
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   178
	      wget -r -np -nd $(patsubst %, -A "*%*.rpm", $(RPM_LIST)) $(BASE_URL)
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   179
        endif
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   180
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   181
##########################################################################################
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   182
# Unpack source packages
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   183
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   184
# Generate downloading + unpacking of sources.
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   185
define Download
54148
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
   186
  # Allow override
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
   187
  $(1)_DIRNAME ?= $(basename $(basename $(notdir $($(1)))))
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
   188
  $(1)_DIR = $(abspath $(SRCDIR)/$$($(1)_DIRNAME))
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   189
  $(1)_CFG = $$($(1)_DIR)/configure
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   190
  $(1)_FILE = $(DOWNLOAD)/$(notdir $($(1)))
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   191
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   192
  $$($(1)_CFG) : $$($(1)_FILE)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   193
	mkdir -p $$(SRCDIR)
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   194
	tar -C $$(SRCDIR) -xf $$<
54148
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
   195
	$$(foreach p,$$(abspath $$(wildcard patches/$$(notdir $$($(1)_DIR)).patch)), \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   196
	  echo PATCHING $$(p) ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   197
	  patch -d $$($(1)_DIR) -p1 -i $$(p) ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   198
	)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   199
	touch $$@
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   200
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   201
  $$($(1)_FILE) :
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   202
	wget -P $(DOWNLOAD) $$($(1))
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   203
endef
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   204
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   205
# Download and unpack all source packages
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   206
$(foreach p,GCC BINUTILS CCACHE MPFR GMP MPC GDB,$(eval $(call Download,$(p))))
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   207
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   208
##########################################################################################
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   209
# Unpack RPMS
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   210
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   211
RPM_ARCHS := $(ARCH) noarch
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   212
ifeq ($(ARCH),x86_64)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   213
  ifeq ($(BUILD),$(HOST))
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   214
    ifeq ($(TARGET),$(HOST))
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   215
      # When building the native compiler for x86_64, enable mixed mode.
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   216
      RPM_ARCHS += i386 i686
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   217
    endif
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   218
  endif
49204
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
   219
else ifeq ($(ARCH),i686)
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   220
  RPM_ARCHS += i386
50472
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
   221
else ifeq ($(ARCH), armhfp)
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   222
  RPM_ARCHS += armv7hl
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   223
endif
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   224
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   225
RPM_FILE_LIST := $(sort $(foreach a, $(RPM_ARCHS), \
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   226
  $(wildcard $(patsubst %,$(DOWNLOAD_RPMS)/%*$a.rpm,$(RPM_LIST))) \
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   227
))
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   228
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   229
# Note. For building linux you should install rpm2cpio.
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   230
define unrpm
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   231
  $(SYSROOT)/$(notdir $(1)).unpacked : $(1)
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   232
  $$(rpms) : $(SYSROOT)/$(notdir $(1)).unpacked
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   233
endef
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   234
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   235
%.unpacked :
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   236
	$(info Unpacking target rpms and libraries from $<)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   237
	@(mkdir -p $(@D); \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   238
	cd $(@D); \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   239
	rpm2cpio $< | \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   240
	    cpio --extract --make-directories \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   241
	        -f \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   242
	        "./usr/share/doc/*" \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   243
	        "./usr/share/man/*" \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   244
	        "./usr/X11R6/man/*" \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   245
	        "*/X11/locale/*" \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   246
	    || die ; )
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   247
	touch $@
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   248
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   249
$(foreach p,$(RPM_FILE_LIST),$(eval $(call unrpm,$(p))))
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   250
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   251
##########################################################################################
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   252
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   253
# Note: MUST create a <sysroot>/usr/lib even if not really needed.
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   254
# gcc will use a path relative to it to resolve lib64. (x86_64).
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   255
# we're creating multi-lib compiler with 32bit libc as well, so we should
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   256
# have it anyway, but just to make sure...
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   257
# Patch libc.so and libpthread.so to force linking against libraries in sysroot
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   258
# and not the ones installed on the build machine.
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   259
$(libs) : $(rpms)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   260
	@echo Patching libc and pthreads
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   261
	@(for f in `find $(SYSROOT) -name libc.so -o -name libpthread.so`; do \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   262
	  (cat $$f | sed -e 's|/usr/lib64/||g' \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   263
	      -e 's|/usr/lib/||g' \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   264
	      -e 's|/lib64/||g' \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   265
	      -e 's|/lib/||g' ) > $$f.tmp ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   266
	  mv $$f.tmp $$f ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   267
	done)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   268
	@mkdir -p $(SYSROOT)/usr/lib
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   269
	@touch $@
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   270
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   271
##########################################################################################
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 41458
diff changeset
   272
# Create links for ffi header files so that they become visible by default when using the
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 41458
diff changeset
   273
# devkit.
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   274
ifeq ($(ARCH), x86_64)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   275
  $(SYSROOT)/usr/include/ffi.h: $(rpms)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   276
	cd $(@D) && rm -f $(@F) && ln -s ../lib/libffi-*/include/$(@F) .
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 41458
diff changeset
   277
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   278
  $(SYSROOT)/usr/include/ffitarget.h: $(rpms)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   279
	cd $(@D) && rm -f $(@F) && ln -s ../lib/libffi-*/include/$(@F) .
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 41458
diff changeset
   280
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   281
  SYSROOT_LINKS += $(SYSROOT)/usr/include/ffi.h $(SYSROOT)/usr/include/ffitarget.h
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   282
endif
42425
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 41458
diff changeset
   283
57cde06ae8d6 8141590: Cannot build Zero with devkit
erikj
parents: 41458
diff changeset
   284
##########################################################################################
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   285
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   286
# Define marker files for each source package to be compiled
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   287
$(foreach t,binutils mpfr gmp mpc gcc ccache gdb,$(eval $(t) = $(TARGETDIR)/$($(t)_ver).done))
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   288
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   289
##########################################################################################
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   290
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   291
# Default base config
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   292
CONFIG = --target=$(TARGET) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   293
    --host=$(HOST) --build=$(BUILD) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   294
    --prefix=$(PREFIX)
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   295
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   296
PATHEXT = $(PREFIX)/bin:
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   297
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   298
PATHPRE = PATH=$(PATHEXT)$(PATH)
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   299
NUM_CORES := $(shell cat /proc/cpuinfo | grep -c processor)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   300
BUILDPAR = -j$(NUM_CORES)
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   301
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   302
# Default commands to when making
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   303
MAKECMD =
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   304
INSTALLCMD = install
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   305
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   306
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   307
declare_tools = CC$(1)=$(2)gcc LD$(1)=$(2)ld AR$(1)=$(2)ar AS$(1)=$(2)as RANLIB$(1)=$(2)ranlib CXX$(1)=$(2)g++ OBJDUMP$(1)=$(2)objdump
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   308
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   309
ifeq ($(HOST),$(BUILD))
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   310
  ifeq ($(HOST),$(TARGET))
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   311
    TOOLS = $(call declare_tools,_FOR_TARGET,)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   312
  endif
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   313
endif
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   314
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   315
TOOLS ?= $(call declare_tools,_FOR_TARGET,$(TARGET)-)
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   316
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   317
##########################################################################################
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   318
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   319
# Create a TARGET bfd + libiberty only.
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   320
# Configure one or two times depending on mulitlib arch.
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   321
# If multilib, the second should be 32-bit, and we resolve
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   322
# CFLAG_<name> to most likely -m32.
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   323
define mk_bfd
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   324
  $$(info Libs for $(1))
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   325
  $$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   326
      : CFLAGS += $$(CFLAGS_$(1))
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   327
  $$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   328
      : LIBDIRS = --libdir=$(TARGETDIR)/$(1)
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   329
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   330
  bfdlib += $$(TARGETDIR)/$$(binutils_ver)-$(subst /,-,$(1)).done
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   331
  bfdmakes += $$(BUILDDIR)/$$(binutils_ver)-$(subst /,-,$(1))/Makefile
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   332
endef
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   333
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   334
# Create one set of bfds etc for each multilib arch
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   335
$(foreach l,$(LIBDIRS),$(eval $(call mk_bfd,$(l))))
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   336
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   337
# Only build these two libs.
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   338
$(bfdlib) : MAKECMD = all-libiberty all-bfd
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   339
$(bfdlib) : INSTALLCMD = install-libiberty install-bfd
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   340
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   341
# Building targets libbfd + libiberty. HOST==TARGET, i.e not
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   342
# for a cross env.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   343
$(bfdmakes) : CONFIG = --target=$(TARGET) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   344
    --host=$(TARGET) --build=$(BUILD) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   345
    --prefix=$(TARGETDIR) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   346
    --with-sysroot=$(SYSROOT) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   347
    $(LIBDIRS)
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   348
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   349
$(bfdmakes) : TOOLS = $(call declare_tools,_FOR_TARGET,$(TARGET)-) $(call declare_tools,,$(TARGET)-)
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   350
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   351
##########################################################################################
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   352
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   353
$(gcc) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   354
    $(binutils) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   355
    $(gmp) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   356
    $(mpfr) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   357
    $(mpc) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   358
    $(bfdmakes) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   359
    $(ccache) : ENVS += $(TOOLS)
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   360
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   361
# libdir to work around hateful bfd stuff installing into wrong dirs...
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   362
# ensure we have 64 bit bfd support in the HOST library. I.e our
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   363
# compiler on i686 will know 64 bit symbols, BUT later
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   364
# we build just the libs again for TARGET, then with whatever the arch
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   365
# wants.
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   366
$(BUILDDIR)/$(binutils_ver)/Makefile : CONFIG += --enable-64-bit-bfd --libdir=$(PREFIX)/$(word 1,$(LIBDIRS))
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   367
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   368
# Makefile creation. Simply run configure in build dir.
53556
f3546d51ce9c 8217910: Slow linking with devkit on Linux
erikj
parents: 52665
diff changeset
   369
# Setting CFLAGS to -O2 generates a much faster ld.
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   370
$(bfdmakes) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   371
$(BUILDDIR)/$(binutils_ver)/Makefile \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   372
    : $(BINUTILS_CFG)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   373
	$(info Configuring $@. Log in $(@D)/log.config)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   374
	@mkdir -p $(@D)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   375
	( \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   376
	  cd $(@D) ; \
53556
f3546d51ce9c 8217910: Slow linking with devkit on Linux
erikj
parents: 52665
diff changeset
   377
	  $(PATHPRE) $(ENVS) CFLAGS="-O2 $(CFLAGS)" \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   378
	      $(BINUTILS_CFG) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   379
	      $(CONFIG) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   380
	      --with-sysroot=$(SYSROOT) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   381
	      --disable-nls \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   382
	      --program-prefix=$(TARGET)- \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   383
	      --enable-multilib \
54148
62e4ada7c4c8 8220093: Change to GCC 8.2 for building on Linux at Oracle
erikj
parents: 53556
diff changeset
   384
	      --enable-gold=default \
53556
f3546d51ce9c 8217910: Slow linking with devkit on Linux
erikj
parents: 52665
diff changeset
   385
	      --enable-threads \
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   386
	      --enable-plugins \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   387
	) > $(@D)/log.config 2>&1
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   388
	@echo 'done'
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   389
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   390
$(BUILDDIR)/$(mpfr_ver)/Makefile \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   391
    : $(MPFR_CFG)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   392
	$(info Configuring $@. Log in $(@D)/log.config)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   393
	@mkdir -p $(@D)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   394
	( \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   395
	  cd $(@D) ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   396
	  $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   397
	      $(MPFR_CFG) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   398
	      $(CONFIG) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   399
	      --program-prefix=$(TARGET)- \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   400
	      --enable-shared=no \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   401
	      --with-gmp=$(PREFIX) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   402
	) > $(@D)/log.config 2>&1
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   403
	@echo 'done'
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   404
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   405
$(BUILDDIR)/$(gmp_ver)/Makefile \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   406
    : $(GMP_CFG)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   407
	$(info Configuring $@. Log in $(@D)/log.config)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   408
	@mkdir -p $(@D)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   409
	( \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   410
	  cd $(@D) ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   411
	  $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   412
	      $(GMP_CFG) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   413
	      --host=$(HOST) --build=$(BUILD) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   414
	      --prefix=$(PREFIX) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   415
	      --disable-nls \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   416
	      --program-prefix=$(TARGET)- \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   417
	      --enable-shared=no \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   418
	      --with-mpfr=$(PREFIX) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   419
	) > $(@D)/log.config 2>&1
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   420
	@echo 'done'
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   421
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   422
$(BUILDDIR)/$(mpc_ver)/Makefile \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   423
    : $(MPC_CFG)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   424
	$(info Configuring $@. Log in $(@D)/log.config)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   425
	@mkdir -p $(@D)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   426
	( \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   427
	  cd $(@D) ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   428
	  $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   429
	      $(MPC_CFG) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   430
	      $(CONFIG) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   431
	      --program-prefix=$(TARGET)- \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   432
	      --enable-shared=no \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   433
	      --with-mpfr=$(PREFIX) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   434
	      --with-gmp=$(PREFIX) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   435
	) > $(@D)/log.config 2>&1
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   436
	@echo 'done'
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   437
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   438
# Only valid if glibc target -> linux
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   439
# proper destructor handling for c++
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   440
ifneq (,$(findstring linux,$(TARGET)))
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   441
  $(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG += --enable-__cxa_atexit
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   442
endif
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   443
50472
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
   444
ifeq ($(ARCH), armhfp)
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
   445
  $(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG +=  --with-float=hard
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
   446
endif
ee1a0ddb2590 8204602: Add devkit for linux-arm32
ihse
parents: 49412
diff changeset
   447
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   448
ifneq ($(filter ppc64 ppc64le s390x, $(ARCH)), )
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   449
  # We only support 64-bit on these platforms anyway
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   450
  CONFIG += --disable-multilib
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   451
endif
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   452
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   453
# Want:
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   454
# c,c++
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   455
# shared libs
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   456
# multilib (-m32/-m64 on x64)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   457
# skip native language.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   458
# and link and assemble with the binutils we created
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   459
# earlier, so --with-gnu*
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   460
$(BUILDDIR)/$(gcc_ver)/Makefile \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   461
    : $(GCC_CFG)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   462
	$(info Configuring $@. Log in $(@D)/log.config)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   463
	mkdir -p $(@D)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   464
	( \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   465
	  cd $(@D) ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   466
	  $(PATHPRE) $(ENVS) $(GCC_CFG) $(EXTRA_CFLAGS) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   467
	      $(CONFIG) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   468
	      --with-sysroot=$(SYSROOT) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   469
	      --enable-languages=c,c++ \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   470
	      --enable-shared \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   471
	      --disable-nls \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   472
	      --with-gnu-as \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   473
	      --with-gnu-ld \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   474
	      --with-mpfr=$(PREFIX) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   475
	      --with-gmp=$(PREFIX) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   476
	      --with-mpc=$(PREFIX) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   477
	) > $(@D)/log.config 2>&1
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   478
	@echo 'done'
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   479
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   480
# need binutils for gcc
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   481
$(gcc) : $(binutils)
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   482
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   483
# as of 4.3 or so need these for doing config
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   484
$(BUILDDIR)/$(gcc_ver)/Makefile : $(gmp) $(mpfr) $(mpc)
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   485
$(mpfr) : $(gmp)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   486
$(mpc) : $(gmp) $(mpfr)
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   487
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   488
################################################################################
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   489
# Build gdb but only where host and target match
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   490
ifeq ($(HOST), $(TARGET))
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   491
  $(BUILDDIR)/$(gdb_ver)/Makefile: $(GDB_CFG)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   492
	$(info Configuring $@. Log in $(@D)/log.config)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   493
	mkdir -p $(@D)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   494
	( \
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   495
	  cd $(@D) ; \
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   496
	  $(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" $(GDB_CFG) \
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   497
	      $(CONFIG) \
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   498
	      --with-sysroot=$(SYSROOT) \
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   499
	) > $(@D)/log.config 2>&1
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   500
	@echo 'done'
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   501
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   502
  $(gdb): $(gcc)
49204
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
   503
else
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
   504
  $(BUILDDIR)/$(gdb_ver)/Makefile:
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
   505
	$(info Faking $@, not used when cross-compiling)
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
   506
	mkdir -p $(@D)
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
   507
	echo "install:" > $@
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
   508
	@echo 'done'
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   509
endif
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   510
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   511
##########################################################################################
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   512
# very straightforward. just build a ccache. it is only for host.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   513
$(BUILDDIR)/$(ccache_ver)/Makefile \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   514
    : $(CCACHE_CFG)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   515
	$(info Configuring $@. Log in $(@D)/log.config)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   516
	@mkdir -p $(@D)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   517
	@( \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   518
	  cd $(@D) ; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   519
	  $(PATHPRE) $(ENVS) $(CCACHE_CFG) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   520
	      $(CONFIG) \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   521
	) > $(@D)/log.config 2>&1
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   522
	@echo 'done'
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   523
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   524
gccpatch = $(TARGETDIR)/gcc-patched
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   525
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   526
##########################################################################################
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   527
# For some reason cpp is not created as a target-compiler
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   528
ifeq ($(HOST),$(TARGET))
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   529
  $(gccpatch) : $(gcc) link_libs
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   530
	@echo -n 'Creating compiler symlinks...'
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   531
	@for f in cpp; do \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   532
	  if [ ! -e $(PREFIX)/bin/$(TARGET)-$$f ]; \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   533
	  then \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   534
	    cd $(PREFIX)/bin && \
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   535
	    ln -fs $$f $(TARGET)-$$f ; \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   536
	  fi \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   537
	done
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   538
	@touch $@
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   539
	@echo 'done'
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   540
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   541
  ##########################################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   542
  # Ugly at best. Seems that when we compile host->host compiler, that are NOT
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   543
  # the BUILD compiler, the result will not try searching for libs in package root.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   544
  # "Solve" this by create links from the target libdirs to where they are.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   545
  link_libs:
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   546
	@echo -n 'Creating library symlinks...'
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   547
	@$(foreach l,$(LIBDIRS), \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   548
	for f in `cd $(PREFIX)/$(l) && ls`; do \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   549
	  if [ ! -e $(TARGETDIR)/$(l)/$$f ]; then \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   550
	    mkdir -p $(TARGETDIR)/$(l) && \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   551
	    cd $(TARGETDIR)/$(l)/ && \
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   552
	    ln -fs $(if $(findstring /,$(l)),../,)../../$(l)/$$f $$f; \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   553
	  fi \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   554
	done;)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   555
	@echo 'done'
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   556
else
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   557
  $(gccpatch) :
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   558
	@echo 'done'
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   559
endif
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   560
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   561
##########################################################################################
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   562
# Build in two steps.
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   563
# make <default>
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   564
# make install.
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   565
# Use path to our build hosts cross tools
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   566
# Always need to build cross tools for build host self.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   567
$(TARGETDIR)/%.done : $(BUILDDIR)/%/Makefile
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   568
	$(info Building $(basename $@). Log in $(<D)/log.build)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   569
	$(PATHPRE) $(ENVS) $(MAKE) $(BUILDPAR) -f $< -C $(<D) $(MAKECMD) $(MAKECMD.$(notdir $@)) > $(<D)/log.build 2>&1
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   570
	@echo -n 'installing...'
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   571
	$(PATHPRE) $(MAKE) $(INSTALLPAR) -f $< -C $(<D) $(INSTALLCMD) $(MAKECMD.$(notdir $@)) > $(<D)/log.install 2>&1
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   572
	@mkdir -p $(@D)
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   573
	@touch $@
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   574
	@echo 'done'
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   575
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   576
##########################################################################################
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   577
52665
61dcd7cd48c3 8213698: Improve devkit creation and add support for linux/ppc64/ppc64le/s390x
simonis
parents: 52357
diff changeset
   578
$(PREFIX)/devkit.info:
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   579
	@echo 'Creating devkit.info in the root of the kit'
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   580
	rm -f $@
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   581
	touch $@
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   582
	echo '# This file describes to configure how to interpret the contents of this' >> $@
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   583
	echo '# devkit' >> $@
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   584
	echo '' >> $@
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   585
	echo 'DEVKIT_NAME="$(gcc_ver) - $(LINUX_VERSION)"' >> $@
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   586
	echo 'DEVKIT_TOOLCHAIN_PATH="$$DEVKIT_ROOT/bin"' >> $@
49204
564802b01ded 8199451: Create linux-aarch64 cross-compilation devkit, and fix cross-compilation
ihse
parents: 48839
diff changeset
   587
	echo 'DEVKIT_SYSROOT="$$DEVKIT_ROOT/$(TARGET)/sysroot"' >> $@
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   588
	echo 'DEVKIT_EXTRA_PATH="$$DEVKIT_ROOT/bin"' >> $@
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   589
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   590
##########################################################################################
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   591
# Copy these makefiles into the root of the kit
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   592
$(PREFIX)/Makefile: ./Makefile
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   593
	rm -rf $@
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   594
	cp $< $@
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   595
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   596
$(PREFIX)/Tools.gmk: ./Tools.gmk
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   597
	rm -rf $@
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   598
	cp $< $@
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   599
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   600
THESE_MAKEFILES := $(PREFIX)/Makefile $(PREFIX)/Tools.gmk
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   601
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   602
##########################################################################################
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 21759
diff changeset
   603
34100
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   604
ifeq ($(TARGET), $(HOST))
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   605
  # To build with dtrace support, the build needs access to the dtrace executable from the
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   606
  # sysroot. Generally we don't want to add binaries in the sysroot to the path, but
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   607
  # luckily this seems to execute well enough on a different host Linux distro, so symlink
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   608
  # it into the main bin dir.
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   609
  $(PREFIX)/bin/dtrace:
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   610
	@echo 'Creating dtrace soft link'
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   611
	ln -s ../$(HOST)/sysroot/usr/bin/dtrace $@
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   612
34100
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   613
  $(PREFIX)/bin/%:
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   614
	@echo 'Creating missing $* soft link'
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   615
	ln -s $(TARGET)-$* $@
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   616
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   617
  missing-links := $(addprefix $(PREFIX)/bin/, \
49357
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 48839
diff changeset
   618
      addr2line ar as c++ c++filt dwp elfedit g++ gcc gcc-$(GCC_VER) gprof ld ld.bfd \
aaedb8343784 8198243: Add build time check for global operator new/delete in object files
erikj
parents: 48839
diff changeset
   619
      ld.gold nm objcopy objdump ranlib readelf size strings strip)
34100
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   620
endif
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   621
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   622
##########################################################################################
e3293031f83d 8143236: Update devkit creation makefiles for linux
erikj
parents: 33029
diff changeset
   623
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   624
bfdlib : $(bfdlib)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   625
binutils : $(binutils)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   626
rpms : $(rpms)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   627
libs : $(libs)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   628
sysroot : rpms libs
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   629
gcc : sysroot $(gcc) $(gccpatch)
48839
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   630
gdb : $(gdb)
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   631
all : binutils gcc bfdlib $(PREFIX)/devkit.info $(missing-links) $(SYSROOT_LINKS) \
042834d56fbf 8196998: Create devkit for Linux with gcc 7.3
erikj
parents: 47433
diff changeset
   632
    $(THESE_MAKEFILES) gdb
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   633
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   634
# this is only built for host. so separate.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   635
ccache : $(ccache)
18021
680b9b43e2d6 8015377: Support using compiler devkits on Linux
erikj
parents:
diff changeset
   636
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 18021
diff changeset
   637
.PHONY : gcc all binutils bfdlib link_libs rpms libs sysroot