Add arm-linux-gnu cross-compiler support
(No support for selecting include and library path yet)
This commit is contained in:
parent
4cabbde4b4
commit
131463c503
|
@ -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
|
|
@ -22,13 +22,13 @@
|
||||||
# Tools
|
# Tools
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
CC= gcc
|
CC= $(CROSS_COMPILE:%=%-)gcc
|
||||||
CXX= g++
|
CXX= $(CROSS_COMPILE:%=%-)g++
|
||||||
LD= $(CXX)
|
LD= $(CXX)
|
||||||
CPP= $(CC) -E
|
CPP= $(CC) -E
|
||||||
PYTHON= python
|
PYTHON= python
|
||||||
AR= ar -rcs
|
AR= $(CROSS_COMPILE:%=%-)ar -rcs
|
||||||
RANLIB= ranlib
|
RANLIB= $(CROSS_COMPILE:%=%-)ranlib
|
||||||
LIBTOOL= libtool -no_warning_for_no_symbols
|
LIBTOOL= libtool -no_warning_for_no_symbols
|
||||||
INSTALL= install
|
INSTALL= install
|
||||||
|
|
||||||
|
|
10
hello.cpp
10
hello.cpp
|
@ -1,5 +1,9 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#if HAVE_IOSTREAM
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#elif HAVE_STDIO_H
|
||||||
|
#include <stdio.h>
|
||||||
|
#endif // IO
|
||||||
|
|
||||||
#if HAVE_SYS_IMPROBABLE_H
|
#if HAVE_SYS_IMPROBABLE_H
|
||||||
#warning "Improbable header present, probably a fault in the build system"
|
#warning "Improbable header present, probably a fault in the build system"
|
||||||
|
@ -11,5 +15,11 @@
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
#if HAVE_IOSTREAM
|
||||||
std::cout << "You successfully built using build\n";
|
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
|
||||||
}
|
}
|
||||||
|
|
4
rules.mk
4
rules.mk
|
@ -45,8 +45,8 @@ DIR:= $(subst $(BASEDIR),,$(FULLDIR))
|
||||||
PRETTY_DIR:= $(subst $(BASEDIR),[top],$(FULLDIR))
|
PRETTY_DIR:= $(subst $(BASEDIR),[top],$(FULLDIR))
|
||||||
BASENAME_DIR:= $(shell basename $(FULLDIR))
|
BASENAME_DIR:= $(shell basename $(FULLDIR))
|
||||||
BUILD_DATE:= $(shell /bin/date '+%Y%m%d-%H%M%S')
|
BUILD_DATE:= $(shell /bin/date '+%Y%m%d-%H%M%S')
|
||||||
OBJROOT:= $(BUILDOBJ)/$(BUILDENV)/$(TARGET)$(BASE_EXTRA_DEPTH)
|
OBJROOT:= $(BUILDOBJ)/$(BUILDENV)/$(CROSS_COMPILE:%=%-)$(TARGET)$(BASE_EXTRA_DEPTH)
|
||||||
BUILD_LOG:= $(BUILD_LOGS)build-$(BUILDENV)-$(TARGET)-$(BUILD_DATE).log
|
BUILD_LOG:= $(BUILD_LOGS)build-$(BUILDENV)-$(CROSS_COMPILE:%=%-)$(TARGET)-$(BUILD_DATE).log
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Configuration variables
|
# Configuration variables
|
||||||
|
|
Loading…
Reference in New Issue