clean left include file after modification that isn't needed anymore
[apps/agl-service-can-low-level.git] / CAN-binder / AGLBuild.mk
1 #!/usr/bin/make -f
2 # Copyright (C) 2015, 2016 "IoT.bzh"
3 # Author "Romain Forlot" <romain.forlot@iot.bzh>
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #        http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 BUILD_DIR   := build
18 PACKAGING_DIR := packaging/wgt
19 PACKAGING_FILE := $(PACKAGING_DIR)/package.in
20 PKG_FILELIST := $(shell cat $(PACKAGING_FILE))
21
22 VPATH = etc:$(PACKAGING_DIR):$(PACKAGING_DIR)/etc:$(BUILD_DIR)
23
24 .PHONY: all clean mrproper package
25
26 all: build
27
28 clean:
29         @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} clean) || echo Nothing to clean
30
31 mrproper:
32         rm -rf ${BUILD_DIR}
33
34 build:  ${BUILD_DIR}/Makefile
35         cmake --build ${BUILD_DIR} --clean-first
36
37 package: config.xml icon.png | $(PKG_FILELIST)
38         mkdir -p ${BUILD_DIR}/$@/{bin,etc,lib,htdocs,data}
39         cp -r $(filter %.so, $|) ${BUILD_DIR}/$@/lib
40         cp -r $(filter %.cfg %.conf %.cnf %.ini, $|) ${BUILD_DIR}/$@/etc
41
42 ${BUILD_DIR}/Makefile:
43         @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR}
44         @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && cmake ${CMAKE_OPTS} ..)