Rework makefiles so that ${CROSS} contains cross tool prefix.

Useful for e.g. invoking ${CROSS}ld -r.
While we're at it, make sure ${AR} always points to the cross tool.
This commit is contained in:
whitequark 2018-01-09 23:59:38 +00:00 committed by radare
parent fa942fdc8b
commit f552b65ddf
18 changed files with 86 additions and 72 deletions

View File

@ -1,11 +1,9 @@
# Ugly yet that's the path inside dockcross
ifeq (${PATH},"/usr/arm-linux-androideabi/bin/${ARCH}-linux-androideabi-gcc")
CC=${ARCH}-linux-androideabi-gcc
RANLIB={ARCH}-linux-androideabi-ranlib
USERCC=${ARCH}-linux-androideabi-gcc -fPIC -fPIE
else
CC=ndk-gcc -fPIC -fPIE
#RANLIB=ndk-ranlib
USERCC=ndk-gcc -fPIC -fPIE
endif
@ -14,42 +12,36 @@ ARCH=arm
ifeq (${NDK_ARCH},x86)
# mips
ARCH2=i686
RANLIB=${ARCH2}-linux-android-ranlib
AR=${ARCH2}-linux-android-ar
CC_AR=${AR} -r ${LIBAR}
CROSS=${ARCH2}-linux-android-
endif
ifeq (${NDK_ARCH},mips)
# mips
ARCH2=mipsel
RANLIB=${ARCH2}-linux-android-ranlib
AR=${ARCH2}-linux-android-ar
CC_AR=${AR} -r ${LIBAR}
CROSS=${ARCH2}-linux-android-
endif
ifeq (${NDK_ARCH},mips64)
# mips
ARCH2=mips64el
RANLIB=${ARCH2}-linux-android-ranlib
AR=${ARCH2}-linux-android-ar
CC_AR=${AR} -r ${LIBAR}
CROSS=${ARCH2}-linux-android-
endif
ifeq (${NDK_ARCH},arm)
# arm32
ARCH=arm
RANLIB=${ARCH}-linux-androideabi-ranlib
AR=${ARCH}-linux-androideabi-ar
CC_AR=${AR} -r ${LIBAR}
CROSS=${ARCH}-linux-androideabi-
endif
ifeq (${NDK_ARCH},aarch64)
# aarch64
ARCH=aarch64
RANLIB=${ARCH}-linux-android-ranlib
AR=${ARCH}-linux-android-ar
CC_AR=${AR} -r ${LIBAR}
CROSS=${ARCH}-linux-android-
endif
RANLIB=${CROSS}ranlib
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
ONELIB=0
OSTYPE=android
LINK=

View File

@ -1,12 +1,13 @@
ARCH=arm
CROSS_ROOT=/usr/bin
CROSS_TRIPLET=${ARCH}-linux-gnueabi
CROSS=${CROSS_ROOT}/${CROSS_TRIPLET}-
CC=${CROSS_ROOT}/${CROSS_TRIPLET}-gcc
USERCC=${CROSS_ROOT}/${CROSS_TRIPLET}-gcc
RANLIB=${CROSS_TRIPLET}-ranlib
CC_AR=${CROSS_ROOT}/${CROSS_TRIPLET}-ar -r ${LIBAR}
CC=${CROSS}gcc
USERCC=${CROSS}gcc
AR=${CROSS}ar
RANLIB=${CROSS}ranlib
CC_AR=${AR} -r ${LIBAR}
ONELIB=0
OSTYPE=gnulinux

View File

@ -1,13 +1,13 @@
ifeq (${_INCLUDE_MK_GCC_},)
_INCLUDE_MK_GCC_=1
# osx port install mingw32-gcc
CC=i386-mingw32-gcc
RANLIB=i386-mingw32-ranlib
CROSS=i386-mingw32-
CC=${CROSS}gcc
RANLIB=${CROSS}ranlib
OSTYPE=windows
ONELIB=0
LINK=-shared
AR=i386-mingw32-ar
CC_AR=$(AR) -r ${LIBAR}
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CC_LIB=${CC} -shared -o

View File

@ -1,11 +1,13 @@
ifeq (${_INCLUDE_MK_GCC_},)
_INCLUDE_MK_GCC_=1
CC=i486-mingw32-gcc
RANLIB=i486-mingw32-ranlib
CROSS=i486-mingw32-
CC=${CROSS}gcc
RANLIB=${CROSS}ranlib
OSTYPE=windows
ONELIB=0
LINK=-shared
CC_AR=i486-mingw32-gcc -r ${LIBAR}
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CC_LIB=${CC} -shared -o

View File

@ -1,12 +1,13 @@
ifeq (${_INCLUDE_MK_GCC_},)
_INCLUDE_MK_GCC_=1
CC=i586-mingw32-gcc
RANLIB=i586-mingw32-ranlib
CROSS=i586-mingw32-
CC=${CROSS}gcc
RANLIB=${CROSS}ranlib
ONELIB=0
OSTYPE=windows
LINK=
AR=i586-mingw32-ar
CC_AR=$(AR) -r ${LIBAR}
LINK=-shared
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CC_LIB=${CC} -shared -o

View File

@ -1,11 +1,12 @@
ifeq (${_INCLUDE_MK_GCC_},)
_INCLUDE_MK_GCC_=1
CC=i586-mingw32msvc-gcc
RANLIB=i586-mingw32msvc-ranlib
ONELIB=0
CROSS=i586-mingw32msvc-
CC=${CROSS}gcc
RANLIB=${CROSS}ranlib
OSTYPE=windows
LINK=
CC_AR=i586-mingw32msvc-ar -r ${LIBAR}
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CC_LIB=${CC} -shared -o

View File

@ -1,11 +1,12 @@
ifeq (${_INCLUDE_MK_GCC_},)
_INCLUDE_MK_GCC_=1
CC=i686-pc-mingw32-gcc
RANLIB=i686-pc-mingw32-ranlib
ONELIB=0
CROSS=i686-pc-mingw32-
CC=${CROSS}gcc
RANLIB=${CROSS}ranlib
OSTYPE=windows
LINK=
CC_AR=i686-pc-mingw32-ar -r ${LIBAR}
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CC_LIB=${CC} -shared -o

View File

@ -1,4 +1,4 @@
# AppVeyour
# AppVeyor
ifeq (${_INCLUDE_MK_GCC_},)
_INCLUDE_MK_GCC_=1
CC=gcc
@ -6,7 +6,8 @@ RANLIB=ranlib
ONELIB=0
OSTYPE=windows
LINK=
CC_AR=ar -r ${LIBAR}
AR=ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CC_LIB=${CC} -shared -o

View File

@ -1,11 +1,13 @@
ifeq (${_INCLUDE_MK_GCC_},)
_INCLUDE_MK_GCC_=1
CC=i686-w64-mingw32-gcc
RANLIB=i686-w64-mingw32-ranlib
CROSS=i686-w64-mingw32-
CC=${CROSS}gcc
RANLIB=${CROSS}ranlib
ONELIB=0
OSTYPE=windows
LINK=
CC_AR=i686-w64-mingw32-ar -r ${LIBAR}
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CC_LIB=${CC} -shared -o

View File

@ -1,11 +1,13 @@
ifeq (${_INCLUDE_MK_GCC_},)
_INCLUDE_MK_GCC_=1
CC=i686-w64-mingw32.static-gcc
RANLIB=i686-w64-mingw32.static-ranlib
CROSS=i686-w64-mingw32.static-
CC=${CROSS}gcc
RANLIB=${CROSS}ranlib
ONELIB=0
OSTYPE=windows
LINK=
CC_AR=i686-w64-mingw32.static-ar -r ${LIBAR}
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CC_LIB=${CC} -shared -o

View File

@ -1,11 +1,12 @@
#CC=arm-linux-androideabi-gcc
CC=ios-sdk-gcc
USERCC=ios-sdk-gcc
CROSS=ios-sdk-
CC=${CROSS}gcc
USERCC=${CROSS}gcc
RANLIB=ranlib
ONELIB=0
OSTYPE=darwin
LINK=
CC_AR=ar -r ${LIBAR}
AR=ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS}
CC_LIB=${CC} -shared -o

View File

@ -5,7 +5,8 @@ RANLIB=mingw32-gcc-ranlib
OSTYPE=windows
ONELIB=0
LINK=-shared
CC_AR=mingw32-gcc-ar ${LIBAR}
AR=mingw32-gcc-ar
CC_AR=${AR} ${LIBAR}
PICFLAGS=
#CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CFLAGS+=${PICFLAGS} -D__WINDOWS__=1

View File

@ -2,11 +2,12 @@ ARCH=mipsel
CROSS_ROOT=/usr/bin
CROSS_TRIPLET=${ARCH}-linux-gnu
CC=${CROSS_ROOT}/${CROSS_TRIPLET}-gcc
USERCC=${CROSS_ROOT}/${CROSS_TRIPLET}-gcc
RANLIB=${CROSS_TRIPLET}-ranlib
CC_AR=${CROSS_ROOT}/${CROSS_TRIPLET}-ar -r ${LIBAR}
CROSS=${CROSS_ROOT}/${CROSS_TRIPLET}-
CC=${CROSS}gcc
USERCC=${CROSS}gcc
RANLIB=${CROSS}ranlib
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
ONELIB=0
OSTYPE=gnulinux

View File

@ -1,9 +1,11 @@
CC=arm-unknown-nto-qnx6.5.0eabi-gcc
RANLIB=arm-unknown-nto-qnx6.5.0eabi-ranlib
CROSS=arm-unknown-nto-qnx6.5.0eabi-
CC=${CROSS}gcc
RANLIB=${CROSS}ranlib
ONELIB=0
OSTYPE=qnx
LINK=
CC_AR=arm-unknown-nto-qnx6.5.0eabi-ar -r ${LIBAR}
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS}
CC_LIB=${CC} -shared -o

View File

@ -2,7 +2,8 @@ CC=tcc
RANLIB=ranlib
LINK=
ONELIB=0
CC_AR=ar -r ${LIBAR}
AR=ar
CC_AR=${AR} -r ${LIBAR}
CC_LIB=${CC} -shared -o ${LIBSO}
CFLAGS_INCLUDE=-I
LDFLAGS_LINK=-l

View File

@ -5,7 +5,8 @@ USERCC=gcc -fPIC -fPIE
ARCH=arm
RANLIB=ranlib
CC_AR=ar -r ${LIBAR}
AR=ar
CC_AR=${AR} -r ${LIBAR}
ONELIB=0
OSTYPE=android

View File

@ -1,9 +1,11 @@
CC=x86_64-w64-mingw32-gcc
RANLIB=x86_64-w64-mingw32-ranlib
CROSS=x86_64-w64-mingw32-
CC=${CROSS}gcc
RANLIB=${CROSS}ranlib
ONELIB=0
OSTYPE=windows
LINK=
CC_AR=x86_64-w64-mingw32-ar -r ${LIBAR}
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CC_LIB=${CC} -shared -o

View File

@ -1,10 +1,12 @@
PREFIX=/usr/src/mxe/usr/
CC=x86_64-w64-mingw32.static-gcc
RANLIB=x86_64-w64-mingw32.static-ranlib
CROSS=x86_64-w64-mingw32.static-
CC=${CROSS}gcc
RANLIB=${CROSS}ranlib
ONELIB=0
OSTYPE=windows
LINK=
CC_AR=x86_64-w64-mingw32.static-ar -r ${LIBAR}
AR=${CROSS}ar
CC_AR=${AR} -r ${LIBAR}
PICFLAGS=
CFLAGS+=${PICFLAGS} -MD -D__WINDOWS__=1
CC_LIB=${CC} -shared -o