2018-12-27 17:02:19 +00:00
|
|
|
ifndef DEV_UTILS_MK_INCLUDED
|
2019-03-03 18:12:28 +00:00
|
|
|
DEV_UTILS_MK_INCLUDED = true
|
2018-12-27 17:02:19 +00:00
|
|
|
|
2019-03-03 18:12:28 +00:00
|
|
|
MAKEFILE_INDENT_EQUAL_POS ?= 30
|
|
|
|
|
MAKEFILE_INDENT_NAME_REGEX ?= (\.mk$$|makefile$$|Makefile$$|GNUmakefile$$)
|
|
|
|
|
MAKEFILE_INDENT_ROOT ?= .
|
2019-03-03 16:13:24 +00:00
|
|
|
|
2018-11-27 15:10:18 +00:00
|
|
|
all:
|
|
|
|
|
install:
|
|
|
|
|
clean distclean:
|
|
|
|
|
|
|
|
|
|
echo-vars:
|
|
|
|
|
make -p nothing | grep -B1 "^[A-Z_]* *[?:+]*="
|
|
|
|
|
|
|
|
|
|
echo-makefiles:
|
2018-12-27 17:30:10 +00:00
|
|
|
$(Q)strace -f make nothing 2>&1 | sed '/open\(at\)*(.*\(GNUmakefile\|makefile\|Makefile\|\.mk\)/ !d; s/.*open("//; s/.*openat([A-Z_]\+, "//; s/", O_.*//'
|
2018-11-27 15:10:18 +00:00
|
|
|
|
|
|
|
|
cat-makefiles:
|
|
|
|
|
Q=@ make --no-print-directory echo-makefiles | while read f; do echo "# =================================================== $$f"; sed 's/^include/#cat include/' $$f; done
|
|
|
|
|
|
|
|
|
|
link-in:
|
|
|
|
|
DEVELOPMENT=false INSTALL_LINK=1 make install
|
|
|
|
|
|
|
|
|
|
install-to-system:
|
|
|
|
|
sudo make DEVELOPMENT=false install
|
|
|
|
|
for s in $(RESTART_SERVICES); do \
|
|
|
|
|
sudo systemctl restart $$s ;\
|
|
|
|
|
done
|
|
|
|
|
|
2019-03-03 16:13:24 +00:00
|
|
|
indent-makefiles:
|
|
|
|
|
$(PYTHON) /opt/jw-python/bin/process-text-files.py \
|
|
|
|
|
indent-makefiles \
|
|
|
|
|
--equal-pos $(MAKEFILE_INDENT_EQUAL_POS) \
|
|
|
|
|
--skip-short 6 \
|
|
|
|
|
--name-regex="$(MAKEFILE_INDENT_NAME_REGEX)" \
|
|
|
|
|
--root=$(MAKEFILE_INDENT_ROOT) \
|
|
|
|
|
--min-assignments=4
|
|
|
|
|
|
2018-12-27 17:02:19 +00:00
|
|
|
endif # ifndef DEV_UTILS_MK_INCLUDED
|