diff options
author | fulup <fulup.arfoll@iot.bzh> | 2017-07-01 00:22:00 +0200 |
---|---|---|
committer | fulup <fulup.arfoll@iot.bzh> | 2017-07-01 00:22:00 +0200 |
commit | c326a053cdf8a4a9ce0fb02448293b45083d553c (patch) | |
tree | aa1209094f735e96ad506615fe04d375b773543a /conf.d | |
parent | 10c42e135b22bf323836100ede042ec47ddb22a1 (diff) |
Ongoing work
Diffstat (limited to 'conf.d')
m--------- | conf.d/app-templates | 0 | ||||
-rwxr-xr-x | conf.d/autobuild/agl/autobuild | 47 | ||||
-rwxr-xr-x | conf.d/autobuild/linux/autobuild | 47 | ||||
-rw-r--r-- | conf.d/cmake/config.cmake (renamed from conf.d/config.cmake) | 18 |
4 files changed, 109 insertions, 3 deletions
diff --git a/conf.d/app-templates b/conf.d/app-templates -Subproject 0d3bfaf0888cb350f8721db4a4115ecb8dc4f00 +Subproject 011277d2af3cfee674b50fa8a7362e91e8ad29e diff --git a/conf.d/autobuild/agl/autobuild b/conf.d/autobuild/agl/autobuild new file mode 100755 index 0000000..31e29f7 --- /dev/null +++ b/conf.d/autobuild/agl/autobuild @@ -0,0 +1,47 @@ +#!/usr/bin/make -f +# Copyright (C) 2015, 2016 "IoT.bzh" +# Author "Romain Forlot" <romain.forlot@iot.bzh> +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +THISFILE := $(lastword $(MAKEFILE_LIST)) +BUILD_DIR := $(abspath $(dir $(THISFILE)/../../../../..)/build) + +.PHONY: all clean distclean configure build package + +all: build + +clean: + @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} clean) || echo Nothing to clean + +distclean: + @rm -rf ${BUILD_DIR} + +configure: ${BUILD_DIR}/Makefile + +build: configure + @cmake --build ${BUILD_DIR} ${BUILD_ARGS} --target all + +package: build + @mkdir -p ${BUILD_DIR}/$@/bin + @mkdir -p ${BUILD_DIR}/$@/etc + @mkdir -p ${BUILD_DIR}/$@/lib + @mkdir -p ${BUILD_DIR}/$@/htdocs + @mkdir -p ${BUILD_DIR}/$@/data + @[ "${DEST}" ] && mkdir -p ${DEST} + @cmake --build ${BUILD_DIR} --target widget + @[ "${DEST}" ] && cp ${BUILD_DIR}/*wgt ${DEST} + +${BUILD_DIR}/Makefile: + @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} + @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && cmake ${CONFIGURE_ARGS} ..) diff --git a/conf.d/autobuild/linux/autobuild b/conf.d/autobuild/linux/autobuild new file mode 100755 index 0000000..31e29f7 --- /dev/null +++ b/conf.d/autobuild/linux/autobuild @@ -0,0 +1,47 @@ +#!/usr/bin/make -f +# Copyright (C) 2015, 2016 "IoT.bzh" +# Author "Romain Forlot" <romain.forlot@iot.bzh> +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +THISFILE := $(lastword $(MAKEFILE_LIST)) +BUILD_DIR := $(abspath $(dir $(THISFILE)/../../../../..)/build) + +.PHONY: all clean distclean configure build package + +all: build + +clean: + @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} clean) || echo Nothing to clean + +distclean: + @rm -rf ${BUILD_DIR} + +configure: ${BUILD_DIR}/Makefile + +build: configure + @cmake --build ${BUILD_DIR} ${BUILD_ARGS} --target all + +package: build + @mkdir -p ${BUILD_DIR}/$@/bin + @mkdir -p ${BUILD_DIR}/$@/etc + @mkdir -p ${BUILD_DIR}/$@/lib + @mkdir -p ${BUILD_DIR}/$@/htdocs + @mkdir -p ${BUILD_DIR}/$@/data + @[ "${DEST}" ] && mkdir -p ${DEST} + @cmake --build ${BUILD_DIR} --target widget + @[ "${DEST}" ] && cp ${BUILD_DIR}/*wgt ${DEST} + +${BUILD_DIR}/Makefile: + @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} + @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && cmake ${CONFIGURE_ARGS} ..) diff --git a/conf.d/config.cmake b/conf.d/cmake/config.cmake index 8ced9f6..e9367bc 100644 --- a/conf.d/config.cmake +++ b/conf.d/cmake/config.cmake @@ -29,13 +29,17 @@ set(PROJECT_AUTHOR_MAIL "fulup@iot.bzh") set(PROJECT_LICENCE "Apache-V2") set(PROJECT_LANGUAGES,"C") + # Where are stored default templates files from submodule or subtree app-templates in your project tree # relative to the root project directory set(PROJECT_APP_TEMPLATES_DIR "conf.d/app-templates") -# Compilation Mode (DEBUG, RELEASE) +# Use any directory that does not start with _ as valid source rep +set(PROJECT_SRC_DIR_PATTERN "[^_]*") + +# Compilation Mode (AFB_DEBUG, RELEASE) # ---------------------------------- -set(CMAKE_BUILD_TYPE "DEBUG") +set(CMAKE_BUILD_TYPE "AFB_DEBUG") # Static constante definition # ----------------------------- @@ -61,6 +65,9 @@ set (PKG_REQUIRED_LIST # set(CMAKE_C_FLAGS "") # set(CMAKE_CXX_FLAGS "") +# Do not optimise when debugging +set(CMAKE_C_FLAGS_DEBUG "-g -ggdb -Wp,-U_FORTIFY_SOURCE") + # Define CONTROL_CDEV_NAME should match MOST driver values # --------------------------------------------------------- add_compile_options(-DCONTROL_CDEV_TX="/dev/inic-usb-ctx") @@ -68,7 +75,7 @@ set (PKG_REQUIRED_LIST # Print a helper message when every thing is finished # ---------------------------------------------------- -set(CLOSING_MESSAGE "Test with: afb-daemon --ldpaths=. --port=1234 --workdir=.. --roothttp=./htdocs --tracereq=common --token='' --verbose") +set(CLOSING_MESSAGE "Debug in ./buid: afb-daemon --port=1234 --ldpaths=. --workdir=. --roothttp=../htdocs --tracereq=common --token='' --verbose") # (BUG!!!) as PKG_CONFIG_PATH does not work [should be an env variable] # --------------------------------------------------------------------- @@ -120,3 +127,8 @@ set(WIDGET_TYPE application/vnd.agl.service) # Optional force binding Linking flag # ------------------------------------ # set(BINDINGS_LINK_FLAG LinkOptions ) + +# This include is mandatory and MUST happens at the end +# of this file, else you expose you to unexpected behavior +# ----------------------------------------------------------- +include(${PROJECT_APP_TEMPLATES_DIR}/cmake/common.cmake) |