Made as generic script.
Change-Id: I7e73de7badfaade6fad29476275dd69aa523e6c9
# Copyright (C) 2015, 2016 "IoT.bzh"
# Author "Romain Forlot" <romain.forlot@iot.bzh>
#
# Copyright (C) 2015, 2016 "IoT.bzh"
# Author "Romain Forlot" <romain.forlot@iot.bzh>
#
# limitations under the License.
BUILD_DIR := build
# limitations under the License.
BUILD_DIR := build
+PACKAGING_DIR := packaging/wgt
+PACKAGING_FILE := $(PACKAGING_DIR)/package.in
+PKG_FILELIST := $(shell cat $(PACKAGING_FILE))
-.PHONY: all clean mrproper ${BUILD_DIR}/Makefile
+VPATH = etc:$(PACKAGING_DIR):$(PACKAGING_DIR)/etc:$(BUILD_DIR)
+.PHONY: all clean mrproper package
+
+all: build
clean:
@([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} clean) || echo Nothing to clean
clean:
@([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} clean) || echo Nothing to clean
build: ${BUILD_DIR}/Makefile
cmake --build ${BUILD_DIR} --clean-first
build: ${BUILD_DIR}/Makefile
cmake --build ${BUILD_DIR} --clean-first
-
-package:
- cmake --build ${BUILD_DIR} --target widget
+package: config.xml icon.png | $(PKG_FILELIST)
+ mkdir -p ${BUILD_DIR}/$@/{bin,etc,lib,htdocs,data}
+ cp -r $(filter %.so, $|) ${BUILD_DIR}/$@/lib
+ cp -r $(filter %.cfg %.conf %.cnf %.ini, $|) ${BUILD_DIR}/$@/etc
${BUILD_DIR}/Makefile:
@[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR}
${BUILD_DIR}/Makefile:
@[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR}