From f91ea96b4f221894008d196c1f87b93527c51311 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 6 Jun 2017 15:38:45 +0200 Subject: [PATCH] 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 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/unit/Makefile.in b/test/unit/Makefile.in index 70b7e79c1..7aa180f9c 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 -- 2.43.5