mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
Improvements to make support, added debug target.
This commit is contained in:
20
Makefile
20
Makefile
@@ -54,16 +54,22 @@
|
||||
# rest are arguments to pass to the makefile generated
|
||||
# by cmake in the subdirectory
|
||||
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
||||
j ?= 1
|
||||
j ?= 4
|
||||
|
||||
# Functions
|
||||
# --------------------------------------------------------------------
|
||||
# define a make function to describe how to build a cmake config
|
||||
# describe how to build a cmake config
|
||||
define cmake-build
|
||||
+mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -DCONFIG=$(1)
|
||||
+make -C $(PWD)/build_$@ --no-print-directory $(ARGS)
|
||||
+make -j$(j) -C $(PWD)/build_$@ --no-print-directory $(ARGS)
|
||||
endef
|
||||
|
||||
# create empty targets to avoid msgs for targets passed to cmake
|
||||
define cmake-targ
|
||||
$(1):
|
||||
@#
|
||||
.PHONY: $(1)
|
||||
endef
|
||||
|
||||
# ADD CONFIGS HERE
|
||||
# --------------------------------------------------------------------
|
||||
@@ -104,12 +110,10 @@ clean:
|
||||
rm -rf build_*/
|
||||
|
||||
# targets handled by cmake
|
||||
test: ;
|
||||
upload: ;
|
||||
package: ;
|
||||
package_source: ;
|
||||
cmake_targets = test upload packag package_source debug check_weak
|
||||
$(foreach targ,$(cmake_targets),$(eval $(call cmake-targ,$(targ))))
|
||||
|
||||
.PHONY: clean test upload package package_source
|
||||
.PHONY: clean
|
||||
|
||||
CONFIGS:=$(shell ls cmake/configs | sed -e "s~.*/~~" | sed -e "s~\..*~~")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user