58 lines
1.6 KiB
Makefile
58 lines
1.6 KiB
Makefile
|
#
|
||
|
# Makefile to compile cross
|
||
|
#
|
||
|
# Use SRC_DIR to alter the path of the source (default ../gcc)
|
||
|
# Use VERSION to specify the version (alters the name of the created drawer)
|
||
|
#
|
||
|
# when compiling 4.4.x or newer.
|
||
|
#
|
||
|
#
|
||
|
|
||
|
SRC_DIR=../gcc/repo
|
||
|
VERSION:=$(shell cat $(SRC_DIR)/gcc/BASE-VER)
|
||
|
MAJOR_VERSION:=$(word 1, $(subst ., , $(VERSION)))
|
||
|
CROSS_BUILD_DIR=cross-$(VERSION)
|
||
|
NATIVE_BUILD_DIR=native-$(VERSION)
|
||
|
PREFIX=/usr/local/amiga
|
||
|
BUILD=i686-pc-linux-gnu ## for some reasons configure script of gcc 4.2.4 doesn't identify the correct build type
|
||
|
REAL_SRC_DIR=$(realpath $(SRC_DIR))
|
||
|
|
||
|
# Defines FEATURES macro according to the actual gcc version
|
||
|
include features.mk
|
||
|
|
||
|
all: cross
|
||
|
|
||
|
.PHONY: cross-configure
|
||
|
cross-configure:
|
||
|
mkdir -p $(CROSS_BUILD_DIR)
|
||
|
cd $(CROSS_BUILD_DIR); $(REAL_SRC_DIR)/configure \
|
||
|
--with-bugurl='https://github.com/sba1/adtools/issues' \
|
||
|
--with-pkgversion='adtools build $(VERSION)' \
|
||
|
--target=ppc-amigaos \
|
||
|
--prefix=$(PREFIX) \
|
||
|
$(FEATURES) #\
|
||
|
# --enable-checking=gc
|
||
|
|
||
|
.PHONY: cross
|
||
|
cross: cross-configure
|
||
|
$(MAKE) -C $(CROSS_BUILD_DIR)
|
||
|
|
||
|
.PHONY: native
|
||
|
native:
|
||
|
mkdir -p $(NATIVE_BUILD_DIR)
|
||
|
cd $(NATIVE_BUILD_DIR); LDFLAGS="-lunix" $(REAL_SRC_DIR)/configure \
|
||
|
--with-bugurl='https://github.com/sba1/adtools/issues' \
|
||
|
--with-pkgversion='adtools build $(VERSION)' \
|
||
|
--host=ppc-amigaos \
|
||
|
--target=ppc-amigaos \
|
||
|
--disable-nls \
|
||
|
--prefix=/gcc \
|
||
|
--with-gmp=$(LIB_PATH) \
|
||
|
--with-mpfr=$(LIB_PATH) \
|
||
|
--with-mpc=$(LIB_PATH) \
|
||
|
--program-prefix=ppc-amigaos- \
|
||
|
--program-suffix=-$(MAJOR_VERSION) \
|
||
|
--libexecdir=/gcc/libexec \
|
||
|
$(FEATURES)
|
||
|
$(MAKE) -C $(NATIVE_BUILD_DIR)
|