topdir.mk: Cleanup, add static code check targets
- Apply some style fixup to topdir.mk. Notably beautify indentation and move the target area down below the area with the include statements.- Add the following targets:
format: check-syntax: check-format: check: check-syntax check-formatThese targets currently don't do anything and are meant as hooks for individual linters to add dependencies.- Make .PHONY depend on all phony non-pattern targets
- Make all phony pattern-targets depend on FORCE
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
07e31015b5
commit
22d87143a3
1 changed files with 64 additions and 20 deletions
|
|
@ -1,15 +1,51 @@
|
||||||
all: config
|
.PHONY: \
|
||||||
install: topdir.install
|
FORCE \
|
||||||
clean: topdir.clean
|
all \
|
||||||
distclean: topdir.distclean
|
format \
|
||||||
config:
|
check-syntax \
|
||||||
mrproper:distclean topdir.mrproper
|
check-format \
|
||||||
|
check \
|
||||||
|
install \
|
||||||
|
clean \
|
||||||
|
distclean \
|
||||||
|
config \
|
||||||
|
mrproper \
|
||||||
|
unlocal \
|
||||||
|
topdir.distclean \
|
||||||
|
topdir.clean \
|
||||||
|
topdir.mrproper \
|
||||||
|
topdir.install \
|
||||||
|
do-install-links \
|
||||||
|
install-links \
|
||||||
|
get-maintainer \
|
||||||
|
get-official \
|
||||||
|
get-pub \
|
||||||
|
git-init \
|
||||||
|
git-init-from-cvs \
|
||||||
|
git-config \
|
||||||
|
git-clone-to-remote \
|
||||||
|
git-import \
|
||||||
|
git-init-remote \
|
||||||
|
git-descr \
|
||||||
|
git-update-project-description \
|
||||||
|
install-deps-devel \
|
||||||
|
streamline \
|
||||||
|
git-ssh \
|
||||||
|
git-get-official \
|
||||||
|
git-get-maintainer \
|
||||||
|
git-get-pub \
|
||||||
|
pkg-manager-refresh \
|
||||||
|
pkg-install-build-deps \
|
||||||
|
pkg-install-release-deps \
|
||||||
|
pkg-install-testbuild-deps \
|
||||||
|
recache-vars \
|
||||||
|
canonicalize-remotes
|
||||||
|
|
||||||
ifeq ($(ORDERED_SUBDIRS),)
|
ifeq ($(ORDERED_SUBDIRS),)
|
||||||
SUBDIRS ?= $(dir $(wildcard $(addsuffix /Makefile,\
|
SUBDIRS ?= $(dir $(wildcard $(addsuffix /Makefile,\
|
||||||
inst/pre make scripts contrib src libsrc \
|
inst/pre make scripts contrib src libsrc \
|
||||||
tools include lib bin util exe plugins conf config cfg \
|
tools include lib bin util exe plugins conf config cfg \
|
||||||
images htdocs tmpl doc test inst/post)))
|
images htdocs tmpl doc test inst/post)))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_USER_URL),true)
|
ifeq ($(USE_USER_URL),true)
|
||||||
|
|
@ -25,10 +61,10 @@ INTERACTIVE ?= auto
|
||||||
PKG_MANAGER ?= $(JW_PKG_PY) --interactive=$(INTERACTIVE) pkg
|
PKG_MANAGER ?= $(JW_PKG_PY) --interactive=$(INTERACTIVE) pkg
|
||||||
|
|
||||||
ifeq ($(OPT_JANWARE_PROJECT),-j)
|
ifeq ($(OPT_JANWARE_PROJECT),-j)
|
||||||
REMOTE_GIT_FLAVOUR ?= proj
|
REMOTE_GIT_FLAVOUR ?= proj
|
||||||
else
|
else
|
||||||
OPT_JANWARE_PROJECT =
|
OPT_JANWARE_PROJECT =
|
||||||
REMOTE_GIT_FLAVOUR ?= priv
|
REMOTE_GIT_FLAVOUR ?= priv
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(wildcard $(TOPDIR)/make/defs.mk),)
|
ifneq ($(wildcard $(TOPDIR)/make/defs.mk),)
|
||||||
|
|
@ -71,7 +107,18 @@ STREAMLINE_PROJECT ?= bash $(JWB_SCRIPT_DIR)/streamline-project.sh
|
||||||
|
|
||||||
INSTALLED_TOPDIR_FILES = $(addprefix $(INSTALL_DOCDIR)/, $(DOCS))
|
INSTALLED_TOPDIR_FILES = $(addprefix $(INSTALL_DOCDIR)/, $(DOCS))
|
||||||
|
|
||||||
local-%:
|
all: config
|
||||||
|
format:
|
||||||
|
check-syntax:
|
||||||
|
check-format:
|
||||||
|
check: check-syntax check-format
|
||||||
|
install: topdir.install
|
||||||
|
clean: topdir.clean
|
||||||
|
distclean: topdir.distclean
|
||||||
|
config:
|
||||||
|
mrproper:distclean topdir.mrproper
|
||||||
|
|
||||||
|
local-%: FORCE
|
||||||
find . -name $@.mk | \
|
find . -name $@.mk | \
|
||||||
while read f; do (\
|
while read f; do (\
|
||||||
cd `dirname $$f` ;\
|
cd `dirname $$f` ;\
|
||||||
|
|
@ -168,7 +215,7 @@ git-descr: $(GIT_DESCR)
|
||||||
git-update-project-description:
|
git-update-project-description:
|
||||||
ssh $(JANWARE_USER)@devgit.janware.com "/opt/jw-pkg/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) update-descriptions $(PROJECT)"
|
ssh $(JANWARE_USER)@devgit.janware.com "/opt/jw-pkg/bin/git-srv-admin.sh $(OPT_JANWARE_PROJECT) update-descriptions $(PROJECT)"
|
||||||
|
|
||||||
projects-%:
|
projects-%: FORCE
|
||||||
$(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py projects build $* $(PROJECT)
|
$(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py projects build $* $(PROJECT)
|
||||||
|
|
||||||
install-deps-devel:
|
install-deps-devel:
|
||||||
|
|
@ -197,7 +244,7 @@ prefix.done:
|
||||||
echo-build-deps:
|
echo-build-deps:
|
||||||
$(Q)echo $(call proj_query, required-os-pkg --quote "build" $(PROJECT))
|
$(Q)echo $(call proj_query, required-os-pkg --quote "build" $(PROJECT))
|
||||||
|
|
||||||
git-ssh-%:
|
git-ssh-%: FORCE
|
||||||
bash -c "`git remote get-url --push $* | sed 's|ssh://||; s|\([^/]\+\)/\(.*\)|LC_CDPATH=/\2 ssh -o SendEnv=LC_CDPATH \1|'`"
|
bash -c "`git remote get-url --push $* | sed 's|ssh://||; s|\([^/]\+\)/\(.*\)|LC_CDPATH=/\2 ssh -o SendEnv=LC_CDPATH \1|'`"
|
||||||
git-ssh: git-ssh-origin
|
git-ssh: git-ssh-origin
|
||||||
|
|
||||||
|
|
@ -212,7 +259,7 @@ git-get-pub:
|
||||||
JW_PKG_SSH_EXTRA_OPTS="" git pull pub master ;\
|
JW_PKG_SSH_EXTRA_OPTS="" git pull pub master ;\
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git-get-%:
|
git-get-%: FORCE
|
||||||
PGIT_SH_PROJECTS=. $(PGIT_SH) get --refspec $*:$(GIT_MAIN_BRANCH):current-branch
|
PGIT_SH_PROJECTS=. $(PGIT_SH) get --refspec $*:$(GIT_MAIN_BRANCH):current-branch
|
||||||
|
|
||||||
get-%: git-get-%
|
get-%: git-get-%
|
||||||
|
|
@ -230,9 +277,6 @@ pkg-install-release-deps:
|
||||||
pkg-install-testbuild-deps:
|
pkg-install-testbuild-deps:
|
||||||
$(PKG_MANAGER) install $(shell $(proj_query_cmd) pkg-requires --quote --skip-excluded --hide-self --syntax names-only --delimiter " " "build,run,devel,release" $(PROJECT))
|
$(PKG_MANAGER) install $(shell $(proj_query_cmd) pkg-requires --quote --skip-excluded --hide-self --syntax names-only --delimiter " " "build,run,devel,release" $(PROJECT))
|
||||||
|
|
||||||
echo-hash:
|
|
||||||
$(Q)/bin/bash $(PKG_SH_EXE) hash
|
|
||||||
|
|
||||||
recache-vars:
|
recache-vars:
|
||||||
rm -f $(TOPDIR)/make clean-cache cache
|
rm -f $(TOPDIR)/make clean-cache cache
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue