diff --git a/share/Makefile.headers b/share/Makefile.headers index ea3826c56bfac3d9b437c40401f04ca20ff877ab..5afbe5a533a97eba7aaee60396db746ed39b46ab 100644 --- a/share/Makefile.headers +++ b/share/Makefile.headers @@ -123,10 +123,10 @@ endif ## HDRCK HDRCK.HAS_GIT:=$(shell git rev-parse --is-inside-work-tree 2> /dev/null) +HDRCK.ENABLED=yes ifneq ($(HDRCK.HAS_GIT),true) ifeq ($(HDRCK_FILES_INPUT),) -$(error "Cannot check or make headers: not a Git repository, \ - you should specify HDRCK_FILES_INPUT") +HDRCK.ENABLED=no endif endif @@ -136,6 +136,8 @@ else HDRCK.COLLECT=cat $(HDRCK_FILES_INPUT) endif +ifeq ($(HDRCK.ENABLED),yes) + .PHONY: check-headers check-headers: $(HDRCK.COLLECT) | $(HDRCK.CMD) $(HDRCK.OPTS) $(HDRCK_EXTRA) @@ -144,6 +146,20 @@ check-headers: headers: $(HDRCK.COLLECT) | $(HDRCK.CMD) -update $(HDRCK.OPTS) $(HDRCK_EXTRA) +else + +.PHONY: check-headers +check-headers: + $(error "Cannot check-headers: not a Git repository, \ + you should specify HDRCK_FILES_INPUT") + +.PHONY: headers +headers: + $(error "Cannot make headers: not a Git repository, \ + you should specify HDRCK_FILES_INPUT") + +endif + ################################# .PHONY: headers.info diff --git a/share/Makefile.linting b/share/Makefile.linting index 7b9ea957390a96aa4715cb4d0de0cbbbd48c8372..2384a35f18664f7eb0767887e86c0a86a5c33e53 100644 --- a/share/Makefile.linting +++ b/share/Makefile.linting @@ -56,10 +56,10 @@ endif ## LINT LINTCK.HAS_GIT:=$(shell git rev-parse --is-inside-work-tree 2> /dev/null) +LINTCK.ENABLED=yes ifneq ($(LINTCK.HAS_GIT),true) ifeq ($(LINTCK_FILES_INPUT),) -$(error "Cannot lint: not a Git repository, \ - you should specify LINTCK_FILES_INPUT") +LINTCK.ENABLED=no endif endif @@ -69,6 +69,8 @@ else LINTCK.COLLECT=cat $(LINTCK_FILES_INPUT) endif +ifeq ($(LINTCK.ENABLED),yes) + .PHONY: lint lint: $(LINTCK.COLLECT) | $(LINTCK.CMD) $(LINTCK_EXTRA) @@ -77,6 +79,20 @@ lint: fix-lint: $(LINTCK.COLLECT) | $(LINTCK.CMD) -u $(LINTCK_EXTRA) +else + +.PHONY: lint +lint: + $(error "Cannot lint: not a Git repository, \ + you should specify LINTCK_FILES_INPUT") + +.PHONY: fix-lint +fix-lint: + $(error "Cannot fix-lint: not a Git repository, \ + you should specify LINTCK_FILES_INPUT") + +endif + ########################################################################## .PHONY: lint.info