diff options
-rwxr-xr-x | autobuild/agl/autobuild | 48 | ||||
-rwxr-xr-x | autobuild/linux/autobuild | 92 |
2 files changed, 109 insertions, 31 deletions
diff --git a/autobuild/agl/autobuild b/autobuild/agl/autobuild index e87a1c3..e659a2f 100755 --- a/autobuild/agl/autobuild +++ b/autobuild/agl/autobuild @@ -16,9 +16,12 @@ THISFILE := $(lastword $(MAKEFILE_LIST)) BUILD_DIR := $(abspath $(dir $(THISFILE))/../../build) +BUILD_DIR_TEST := $(abspath $(dir $(THISFILE))/../../build-test) +BUILD_DIR_DEBUG := $(abspath $(dir $(THISFILE))/../../build-debug) +BUILD_DIR_COVERAGE := $(abspath $(dir $(THISFILE))/../../build-coverage) DEST := ${BUILD_DIR} -.PHONY: all clean distclean configure build package help +.PHONY: all clean distclean configure build package help configure-debug configure-coverage build-debug build-coverage package-test package-debug package-coverage package-debug package-all all: help @@ -40,19 +43,58 @@ clean: @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} ${CLEAN_ARGS} clean) || echo Nothing to clean distclean: + @[ -d ${DEST} ] && find ${DEST} -name "*.wgt" -delete @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} distclean) || echo Nothing to distclean configure: @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && qmake ${CONFIGURE_ARGS} ..) +configure-test: + @[ -d ${BUILD_DIR_TEST} ] || mkdir -p ${BUILD_DIR_TEST} + @[ -f ${BUILD_DIR_TEST}/Makefile ] || (cd ${BUILD_DIR_TEST} && qmake ${CONFIGURE_ARGS} ..) + +configure-debug: + @[ -d ${BUILD_DIR_DEBUG} ] || mkdir -p ${BUILD_DIR_DEBUG} + @[ -f ${BUILD_DIR_DEBUG}/Makefile ] || (cd ${BUILD_DIR_DEBUG} && qmake ${CONFIGURE_ARGS} ..) + +configure-coverage: + @[ -d ${BUILD_DIR_COVERAGE} ] || mkdir -p ${BUILD_DIR_COVERAGE} + @[ -f ${BUILD_DIR_COVERAGE}/Makefile ] || (cd ${BUILD_DIR_COVERAGE} && qmake ${CONFIGURE_ARGS} ..) + build: configure @make -C ${BUILD_DIR} ${BUILD_ARGS} all +build-test: configure-test + @make -C ${BUILD_DIR_TEST} ${BUILD_ARGS} all + +build-debug: configure-debug + @make -C ${BUILD_DIR_DEBUG} ${BUILD_ARGS} all + +build-coverage: configure-coverage + @make -C ${BUILD_DIR_COVERAGE} ${BUILD_ARGS} all + +install: build + @make -C ${BUILD_DIR} ${INSTALL_ARGS} install + package: build @if [ "${DEST}" != "${BUILD_DIR}/$@" ]; then \ mkdir -p ${DEST} && cp ${BUILD_DIR}/$@/*.wgt ${DEST}; \ fi -install: build - @make -C ${BUILD_DIR} ${INSTALL_ARGS} install +package-test: build-test + @if [ "${DEST}" != "${BUILD_DIR_TEST}" ]; then \ + mkdir -p ${DEST} && cp ${BUILD_DIR_TEST}/package/*.wgt ${DEST}; \ + fi + +package-debug: build-debug + @if [ "${DEST}" != "${BUILD_DIR_DEBUG}" ]; then \ + mkdir -p ${DEST} && cp ${BUILD_DIR_DEBUG}/package/*.wgt ${DEST}; \ + fi + +package-coverage: build-coverage + @if [ "${DEST}" != "${BUILD_DIR_COVERAGE}" ]; then \ + mkdir -p ${DEST} && cp ${BUILD_DIR_COVERAGE}/package/*.wgt ${DEST}; \ + fi + +package-all: package package-test package-coverage package-debug diff --git a/autobuild/linux/autobuild b/autobuild/linux/autobuild index 035db15..9c03d99 100755 --- a/autobuild/linux/autobuild +++ b/autobuild/linux/autobuild @@ -1,12 +1,12 @@ #!/usr/bin/make -f -# Copyright (C) 2015, 2016 "IoT.bzh" +# Copyright (C) 2015 - 2018 "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 +# 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, @@ -16,9 +16,12 @@ THISFILE := $(lastword $(MAKEFILE_LIST)) BUILD_DIR := $(abspath $(dir $(THISFILE))/../../build) -DEST := ${BUILD_DIR}/target +BUILD_DIR_TEST := $(abspath $(dir $(THISFILE))/../../build-test) +BUILD_DIR_DEBUG := $(abspath $(dir $(THISFILE))/../../build-debug) +BUILD_DIR_COVERAGE := $(abspath $(dir $(THISFILE))/../../build-coverage) +DEST := ${BUILD_DIR} -.PHONY: all clean distclean configure build package help update +.PHONY: all clean distclean configure build package help configure-debug configure-coverage build-debug build-coverage package-test package-debug package-coverage package-debug package-all all: help @@ -29,39 +32,72 @@ help: @echo "- clean" @echo "- distclean" @echo "- configure" - @echo "- build: compilation, link and prepare files for package into a widget" + @echo "- build: compilation, link and prepare files for package into a widget" @echo "- package: output a widget file '*.wgt'" - @echo "- install: install in your ${CMAKE_INSTALL_DIR} directory" + @echo "- install: install in your defined DEST directory" @echo "" - @echo "Usage: ./conf.d/autobuild/agl/autobuild package DEST=${HOME}/opt" - @echo "Don't use your build dir as DEST as wgt file is generated at this location" + @echo "Usage: ./autobuild/agl/autobuild package DEST=${HOME}/opt" + @echo "Don't use your build dir as DEST as wgt file is generated at this location" -update: configure - @cmake --build ${BUILD_DIR} --target autobuild - -clean: - @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} clean) || echo Nothing to clean + clean: + @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} ${CLEAN_ARGS} clean) || echo Nothing to clean distclean: - @rm -rf ${BUILD_DIR} + @[ -d ${DEST} ] && find ${DEST} -name "*.wgt" -delete + @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} distclean) || echo Nothing to distclean + +configure: + @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} + @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && qmake ${CONFIGURE_ARGS} ..) + +configure-test: + @[ -d ${BUILD_DIR_TEST} ] || mkdir -p ${BUILD_DIR_TEST} + @[ -f ${BUILD_DIR_TEST}/Makefile ] || (cd ${BUILD_DIR_TEST} && qmake ${CONFIGURE_ARGS} ..) -configure: ${BUILD_DIR}/Makefile +configure-debug: + @[ -d ${BUILD_DIR_DEBUG} ] || mkdir -p ${BUILD_DIR_DEBUG} + @[ -f ${BUILD_DIR_DEBUG}/Makefile ] || (cd ${BUILD_DIR_DEBUG} && qmake ${CONFIGURE_ARGS} ..) + +configure-coverage: + @[ -d ${BUILD_DIR_COVERAGE} ] || mkdir -p ${BUILD_DIR_COVERAGE} + @[ -f ${BUILD_DIR_COVERAGE}/Makefile ] || (cd ${BUILD_DIR_COVERAGE} && qmake ${CONFIGURE_ARGS} ..) build: configure - @cmake --build ${BUILD_DIR} ${BUILD_ARGS} --target all + @make -C ${BUILD_DIR} ${BUILD_ARGS} 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 - @cmake --build ${BUILD_DIR} --target widget - @mkdir -p ${DEST} && cp ${BUILD_DIR}/*wgt ${DEST} +build-test: configure-test + @make -C ${BUILD_DIR_TEST} ${BUILD_ARGS} all + +build-debug: configure-debug + @make -C ${BUILD_DIR_DEBUG} ${BUILD_ARGS} all + +build-coverage: configure-coverage + @make -C ${BUILD_DIR_COVERAGE} ${BUILD_ARGS} all install: build - @cmake --build ${BUILD_DIR} --target install + @if [ "${DEST}" != "${BUILD_DIR}" ]; then \ + mkdir -p ${DEST} && cp -rf ${BUILD_DIR}/package/root/* ${DEST}; \ + fi + +package: build + @if [ "${DEST}" != "${BUILD_DIR}/$@" ]; then \ + mkdir -p ${DEST} && cp ${BUILD_DIR}/$@/*.wgt ${DEST}; \ + fi + +package-test: build-test + @if [ "${DEST}" != "${BUILD_DIR_TEST}/$@" ]; then \ + mkdir -p ${DEST} && cp ${BUILD_DIR_TEST}/package/*.wgt ${DEST}; \ + fi + +package-debug: build-debug + @if [ "${DEST}" != "${BUILD_DIR_DEBUG}/package" ]; then \ + mkdir -p ${DEST} && cp ${BUILD_DIR_DEBUG}/package/*.wgt ${DEST}; \ + fi + +package-coverage: build-coverage + @if [ "${DEST}" != "${BUILD_DIR_COVERAGE}/package" ]; then \ + mkdir -p ${DEST} && cp ${BUILD_DIR_COVERAGE}/package/*.wgt ${DEST}; \ + fi + +package-all: package package-test package-coverage package-debug -${BUILD_DIR}/Makefile: - @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} - @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && cmake ${CONFIGURE_ARGS} ..) |