From c1ab9fb37faee56cee278ccd94cb958d30d61b94 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Tue, 27 Sep 2022 09:06:06 -0500 Subject: make: move cmds.h generate the header in the include dir so it can be easily used from both lib and tools dirs. --- include/Makefile.in | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/Makefile.in b/include/Makefile.in index d6c30d15b..88a06a934 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -18,6 +18,21 @@ top_builddir = @top_builddir@ include $(top_builddir)/make.tmpl +cmds.h: + @echo " [GEN] $@" + $(Q) set -o pipefail && \ + ( cat $(top_srcdir)/tools/license.inc && \ + echo "/* Do not edit. This file is generated by the Makefile. */" && \ + echo "cmd(CMD_NONE, none)" && \ + $(GREP) '^ID:' $(top_srcdir)/tools/command-lines.in | LC_ALL=C $(SORT) -u | $(AWK) '{print "cmd(" $$2 "_CMD, " $$2 ")"}' && \ + echo "cmd(CMD_COUNT, count)" \ + ) > $@ + +all: cmds.h + +clean: + rm -f cmds.h + DISTCLEAN_TARGETS += configure.h lvm-version.h CLEAN_TARGETS += \ .symlinks \ @@ -99,4 +114,5 @@ CLEAN_TARGETS += \ util.h \ uuid.h \ vg.h \ - xlate.h + xlate.h \ + cmds.h -- cgit v1.2.1