mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-10-29 17:32:49 +00:00
Add an error-checking template for Makefile shell calls onlpm --find-file.
Makefiles that call $(shell onlpm --find-file *) have always failed poorly when the file cannot be found. The onlp_find_file template can be called to both assign and check the results. If an error occurred in getting the value then a Makefile error is raised.
This commit is contained in:
@@ -89,3 +89,5 @@ ONL_MAKE := $(MAKE) $(ONL_MAKE_FLAGS)
|
||||
#
|
||||
export SUBMODULE_INFRA := $(ONL)/sm/infra
|
||||
export SUBMODULE_BIGCODE := $(ONL)/sm/bigcode
|
||||
|
||||
include $(ONL)/make/templates.mk
|
||||
|
||||
6
make/templates.mk
Normal file
6
make/templates.mk
Normal file
@@ -0,0 +1,6 @@
|
||||
define onlpm_find_file
|
||||
$(1) := $$(shell $(ONLPM) --find-file $(2) $(3))
|
||||
ifeq ($$($(1)),)
|
||||
$$(error $(2):$(3) not found)
|
||||
endif
|
||||
endef
|
||||
Reference in New Issue
Block a user