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,17 +24,17 @@ UNITS = \ string_t.c\ run.c +ifeq ("@TESTING@", "yes") +SOURCES = $(UNITS) +TARGETS = run +endif + include $(top_builddir)/make.tmpl ifeq ($(MAKECMDGOALS),distclean) SOURCES = $(UNITS) endif -ifeq ("$(TESTING)", "yes") -SOURCES = $(UNITS) -TARGETS = run -endif - ifeq ("$(TESTING)", "yes") LDLIBS += -ldevmapper @CUNIT_LIBS@ CFLAGS += @CUNIT_CFLAGS@ @@ -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