Add arm-linux-gnu cross-compiler support

(No support for selecting include and library path yet)
This commit is contained in:
Christophe de Dinechin 2017-06-19 12:59:10 +02:00
parent 4cabbde4b4
commit 131463c503
4 changed files with 39 additions and 6 deletions

23
config.arm-linux-gnu.mk Normal file
View File

@ -0,0 +1,23 @@
#******************************************************************************
# config.arm-linux-gnu.mk Build project
#******************************************************************************
#
# File Description:
#
# Compilation profile for arm-linux-gnu
#
#
#
#
#
#
#
#
#******************************************************************************
# (C) 2017 Christophe de Dinechin <christophe@dinechin.org>
#This software is licensed under the GNU General Public License v3
#See file COPYING for details.
#******************************************************************************
CROSS_COMPILE=arm-linux-gnu
include $(BUILD)config.gnu.mk

View File

@ -22,13 +22,13 @@
# Tools
#------------------------------------------------------------------------------
CC= gcc
CXX= g++
CC= $(CROSS_COMPILE:%=%-)gcc
CXX= $(CROSS_COMPILE:%=%-)g++
LD= $(CXX)
CPP= $(CC) -E
PYTHON= python
AR= ar -rcs
RANLIB= ranlib
AR= $(CROSS_COMPILE:%=%-)ar -rcs
RANLIB= $(CROSS_COMPILE:%=%-)ranlib
LIBTOOL= libtool -no_warning_for_no_symbols
INSTALL= install

View File

@ -1,5 +1,9 @@
#include "config.h"
#if HAVE_IOSTREAM
#include <iostream>
#elif HAVE_STDIO_H
#include <stdio.h>
#endif // IO
#if HAVE_SYS_IMPROBABLE_H
#warning "Improbable header present, probably a fault in the build system"
@ -11,5 +15,11 @@
int main()
{
#if HAVE_IOSTREAM
std::cout << "You successfully built using build\n";
#elif HAVE_STDIO_H
printf("You successfully built using build (without iostream)\n");
#else
#warning "Building without <iostream> or <stdio.h>. Cross-compiling?"
#endif // HAVE_IOSTREAM
}

View File

@ -45,8 +45,8 @@ DIR:= $(subst $(BASEDIR),,$(FULLDIR))
PRETTY_DIR:= $(subst $(BASEDIR),[top],$(FULLDIR))
BASENAME_DIR:= $(shell basename $(FULLDIR))
BUILD_DATE:= $(shell /bin/date '+%Y%m%d-%H%M%S')
OBJROOT:= $(BUILDOBJ)/$(BUILDENV)/$(TARGET)$(BASE_EXTRA_DEPTH)
BUILD_LOG:= $(BUILD_LOGS)build-$(BUILDENV)-$(TARGET)-$(BUILD_DATE).log
OBJROOT:= $(BUILDOBJ)/$(BUILDENV)/$(CROSS_COMPILE:%=%-)$(TARGET)$(BASE_EXTRA_DEPTH)
BUILD_LOG:= $(BUILD_LOGS)build-$(BUILDENV)-$(CROSS_COMPILE:%=%-)$(TARGET)-$(BUILD_DATE).log
endif
# Configuration variables