From df375149fc8ae3289c40abeaae6566809e63b1d9 Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Tue, 6 Sep 2016 10:17:56 +0200 Subject: [PATCH] build: Add install feature for downstream Bug: https://jira.iotivity.org/browse/IOT-524 Change-Id: Ice8f4de89ffdaad5a83aa80ca266edc836fbf6a0 Origin: https://gerrit.iotivity.org/gerrit/#/c/11813/ Signed-off-by: Philippe Coval --- Makefile | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..894e3f9 --- /dev/null +++ b/Makefile @@ -0,0 +1,178 @@ +#!/usr/bin/make -f +name?=iotivity + +default/%: + @echo "# $@ ignored" + + +default: all + +# Overide variables +host_arch?=$(shell arch || echo "default") +OSTYPE?=$(shell echo "$${OSTYPE}") +uname?=$(shell echo `uname -s` || echo "") + +TARGET_OS?=${uname} +ifeq ("",${TARGET_OS}) +TARGET_OS=${OSTYPE} +endif + +ifeq ("linux-gnu","${TARGET_OS}") +TARGET_OS=linux +endif +ifeq ("Linux","${TARGET_OS}") +TARGET_OS=linux +endif +ifeq ("",${TARGET_OS}) +TARGET_OS=default +endif + +ifeq ("i386","${host_arch}") +TARGET_ARCH?=x86 +else +ifeq ("i486","${host_arch}") +TARGET_ARCH?=x86 +else +ifeq ("i586","${host_arch}") +TARGET_ARCH?=x86 +else +ifeq ("i686","${host_arch}") +TARGET_ARCH?=x86 +else +ifeq ("armel","${host_arch}") +TARGET_ARCH?=arm +else +ifeq ("armhf","${host_arch}") +TARGET_ARCH?=arm +endif +ifeq ("aarch64","${host_arch}") +TARGET_ARCH?=arm64 +endif +ifeq ("armv7l","${host_arch}") +TARGET_ARCH?=arm +endif +endif +endif +endif +endif +endif + +# Default variables to overide before +LOGGING?=0 +RELEASE?=1 +SECURED?=0 +TARGET_ARCH?=${host_arch} +TARGET_OS?=${uname} +TARGET_TRANSPORT?=IP +_includedir?=/usr/include +_libdir?=/usr/lib +_sbindir?=/usr/sbin +buildroot?=${DESTDIR} + +ifeq (1,${RELEASE}) +build_dir?=release +else +build_dir?=debug +endif + +all: SConstruct + scons \ + LOGGING=${LOGGING} \ + RELEASE=${RELEASE} \ + SECURED=${SECURED} \ + TARGET_ARCH=${TARGET_ARCH} \ + TARGET_OS=${TARGET_OS} \ + TARGET_TRANSPORT=${TARGET_TRANSPORT} \ + V=1 \ + VERBOSE=1 \ + #eol + + +check: auto_build.sh + ${