[lvm-devel] master - tests: fix compilation of unit tests

Zdenek Kabelac zkabelac at sourceware.org
Thu Jun 8 10:03:46 UTC 2017


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f91ea96b4f221894008d196c1f87b93527c51311
Commit:        f91ea96b4f221894008d196c1f87b93527c51311
Parent:        ee5ecde35eca656e85ee5c83b15ad4029d0acf4d
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Tue Jun 6 15:38:45 2017 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Thu Jun 8 11:59:02 2017 +0200

tests: fix compilation of unit tests

Rule for TARGET compiling got missing and needs to be explicitely
expressed, otherwise default unsuitable rule is applied.
---
 test/unit/Makefile.in |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/unit/Makefile.in b/test/unit/Makefile.in
index 70b7e79..7aa180f 100644
--- a/test/unit/Makefile.in
+++ b/test/unit/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2015 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2011-2017 Red Hat, Inc. All rights reserved.
 #
 # This file is part of LVM2.
 #
@@ -24,15 +24,15 @@ UNITS = \
 	string_t.c\
 	run.c
 
-include $(top_builddir)/make.tmpl
-
-ifeq ($(MAKECMDGOALS),distclean)
+ifeq ("@TESTING@", "yes")
 SOURCES = $(UNITS)
+TARGETS = run
 endif
 
-ifeq ("$(TESTING)", "yes")
+include $(top_builddir)/make.tmpl
+
+ifeq ($(MAKECMDGOALS),distclean)
 SOURCES = $(UNITS)
-TARGETS = run
 endif
 
 ifeq ("$(TESTING)", "yes")
@@ -42,6 +42,8 @@ CFLAGS += @CUNIT_CFLAGS@
 check: unit
 
 $(TARGETS): $(OBJECTS) $(top_builddir)/libdm/libdevmapper.$(LIB_SUFFIX)
+	$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) -L$(top_builddir)/libdm \
+	      -o $@ $(OBJECTS) $(LDLIBS)
 
 unit: $(TARGETS)
 	@echo Running unit tests




More information about the lvm-devel mailing list