main - make: move cmds.h
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c1ab9fb37faee56cee278ccd94cb958d30d61b94 Commit: c1ab9fb37faee56cee278ccd94cb958d30d61b94 Parent: fd05b79aad6ccf89f85bd85f5a4b32e1275ce785 Author: David Teigland <[email protected]> AuthorDate: Tue Sep 27 09:06:06 2022 -0500 Committer: David Teigland <[email protected]> CommitterDate: Tue Sep 27 09:06:06 2022 -0500
make: move cmds.h
generate the header in the include dir so it
can be easily used from both lib and tools dirs.
--- Makefile.in | 2 +- include/Makefile.in | 18 +++++++++++++++++- lib/commands/cmd_enum.h | 4 ++-- tools/Makefile.in | 18 ++++-------------- tools/command.c | 4 ++-- 5 files changed, 26 insertions(+), 20 deletions(-)
Makefile.in +1 -1
@@ -47,7 +47,7 @@ include $(top_srcdir)/base/Makefile include $(top_srcdir)/device_mapper/Makefile include $(top_srcdir)/test/unit/Makefile -lib: libdaemon $(BASE_TARGET) $(DEVICE_MAPPER_TARGET) +lib: include libdaemon $(BASE_TARGET) $(DEVICE_MAPPER_TARGET) daemons: lib libdaemon tools scripts: lib tools: lib libdaemon
include/Makefile.in +17 -1
@@ -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
lib/commands/cmd_enum.h +2 -2
@@ -2,7 +2,7 @@#define _CMD_ENUM_H/* -* tools/cmds.h is generated by the Makefile. For each command definition +* include/cmds.h is generated by the Makefile. For each command definition * in command-lines.in, cmds.h contains: * cmd(foo_CMD, foo) *
@@ -12,7 +12,7 @@ enum { #define cmd(a, b) a , -#include "../tools/cmds.h" +#include "../../include/cmds.h" #undef cmd };
tools/Makefile.in +4 -14
@@ -98,7 +98,7 @@ CLEAN_TARGETS = liblvm2cmd.$(LIB_SUFFIX) $(TARGETS_DM) \ liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION) lvm-static.o \ liblvm2cmd-static.a lvm.static \ $(LDDEPS) .exported_symbols_generated \ - cmds.h command-lines-input.h command-count.h man-generator.c + command-lines-input.h command-count.h man-generator.c ifeq ("@CMDLIB@", "yes") TARGETS += liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION)
@@ -175,16 +175,6 @@ command-count.h: $(srcdir)/command-lines.in Makefile $(GREP) '^ID:' $< | $(WC) -l \ ) > $@ -cmds.h: $(srcdir)/command-lines.in Makefile - @echo " [GEN] $@" - $(Q) set -o pipefail && \ - ( cat $(srcdir)/license.inc && \ - echo "/* Do not edit. This file is generated by the Makefile. */" && \ - echo "cmd(CMD_NONE, none)" && \ - $(GREP) '^ID:' $(srcdir)/command-lines.in | LC_ALL=C $(SORT) -u | $(AWK) '{print "cmd(" $$2 "_CMD, " $$2 ")"}' && \ - echo "cmd(CMD_COUNT, count)" \ - ) > $@ - command-lines-input.h: $(srcdir)/command-lines.in Makefile @echo " [GEN] $@" $(Q) set -o pipefail && \
@@ -195,9 +185,9 @@ command-lines-input.h: $(srcdir)/command-lines.in Makefile echo "\\n\\n\";" \ ) > $@ -$(SOURCES:%.c=%.d) $(SOURCES2:%.c=%.d): command-lines-input.h command-count.h cmds.h -$(SOURCES:%.c=%.o) $(SOURCES2:%.c=%.o): command-lines-input.h command-count.h cmds.h -lvm.cflow lvm.xref lvm.tree lvm.xref: command-lines-input.h command-count.h cmds.h +$(SOURCES:%.c=%.d) $(SOURCES2:%.c=%.d): command-lines-input.h command-count.h +$(SOURCES:%.c=%.o) $(SOURCES2:%.c=%.o): command-lines-input.h command-count.h +lvm.cflow lvm.xref lvm.tree lvm.xref: command-lines-input.h command-count.h .PHONY: install_cmdlib_dynamic install_cmdlib_static install_cmdlib_include \ install_tools_dynamic install_tools_static
tools/command.c +2 -2
@@ -149,7 +149,7 @@ static inline int dumptype_arg(struct cmd_context *cmd __attribute__((unused)), enum { #define cmd(a, b) a , -#include "cmds.h" +#include "../include/cmds.h" #undef cmd };
@@ -238,7 +238,7 @@ struct lv_type lv_types[LVT_COUNT + 1] = { struct cmd_name cmd_names[CMD_COUNT + 1] = { #define cmd(a, b) { # a, a, # b }, -#include "cmds.h" +#include "../include/cmds.h" #undef cmd };