summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2017-01-12 14:44:58 -0600
committerDavid Teigland <teigland@redhat.com>2017-01-12 16:05:20 -0600
commitec10518c962cad72ea4a83ede78b6cce4ed52d17 (patch)
tree80183e5a40a19b254b8e001ef471725e92d08685
parentec00ec2c77a9594318f437ab4bd97338f69e32c4 (diff)
downloadlvm2-ec10518c962cad72ea4a83ede78b6cce4ed52d17.tar.gz
Makefile: clean up create-command parts
-rw-r--r--tools/Makefile.in18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 887bc697a..6e2594bc2 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -101,7 +101,7 @@ CLEAN_TARGETS = liblvm2cmd.$(LIB_SUFFIX) $(TARGETS_DM) \
liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION) lvm-static.o \
liblvm2cmd-static.a dmsetup.static lvm.static \
$(LDDEPS) .exported_symbols_generated \
- ccmd command-lines.h command-lines-count.h
+ create-commands command-lines.h command-lines-count.h
ifeq ("@CMDLIB@", "yes")
TARGETS += liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION)
@@ -140,6 +140,8 @@ all: device-mapper
CFLAGS_lvm.o += $(EXTRA_EXEC_CFLAGS)
CFLAGS_lvmcmdline.o += $(VALGRIND_CFLAGS)
+INCLUDES += -I$(top_builddir)/tools
+
lvm: $(OBJECTS) lvm.o $(top_builddir)/lib/liblvm-internal.a
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS) -o $@ $(OBJECTS) lvm.o \
$(LVMLIBS) $(READLINE_LIBS) $(LIBS) -rdynamic
@@ -173,12 +175,16 @@ liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION): liblvm2cmd.$(LIB_SUFFIX)
$(CC) -E -P $(srcdir)/cmdnames.h 2> /dev/null | \
egrep -v '^ *(|#.*|config|devtypes|dumpconfig|formats|fullreport|help|lastlog|lvpoll|pvdata|segtypes|systemid|tags|version) *$$' > .commands
-ccmd: create-commands.c
- $(CC) create-commands.c -o ccmd
+create-commands: $(srcdir)/create-commands.c
+ $(CC) $(srcdir)/create-commands.c -o create-commands
+
+command-lines.h: $(srcdir)/command-lines.in create-commands
+ $(top_builddir)/tools/create-commands --output struct $(srcdir)/command-lines.in > command-lines.h
+
+command-lines-count.h: $(srcdir)/command-lines.in create-commands
+ $(top_builddir)/tools/create-commands --output count $(srcdir)/command-lines.in > command-lines-count.h
-command-lines.h: ccmd
- ./ccmd --output struct command-lines.in > command-lines.h
- ./ccmd --output count command-lines.in > command-lines-count.h
+$(OBJECTS): command-lines.h command-lines-count.h
ifneq ("$(CFLOW_CMD)", "")
CFLOW_SOURCES = $(addprefix $(srcdir)/, $(SOURCES))