summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-07-02 12:38:33 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-07-02 12:38:33 +0000
commit3cb4106b13aa883f3b704aa4026b78fd36db3756 (patch)
tree7909fa214055aa344a71b515c8781c03db32ab79 /Makefile
parent42c3adc8841167026bb8409cb5e4390a32bff49a (diff)
downloadnsss-3cb4106b13aa883f3b704aa4026b78fd36db3756.tar.xz
Add test framework, fix some bugs
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index f755dbf..72677e7 100644
--- a/Makefile
+++ b/Makefile
@@ -61,7 +61,7 @@ ALL_INCLUDES := $(wildcard src/include/$(package)/*.h)
all: $(ALL_LIBS) $(ALL_BINS) $(ALL_INCLUDES) src/include/pwd.h src/include/grp.h src/include/shadow.h
clean:
- @exec rm -f $(ALL_LIBS) $(ALL_BINS) $(wildcard src/*/*.o src/*/*.lo) $(EXTRA_TARGETS)
+ @exec rm -f $(ALL_LIBS) $(ALL_BINS) $(wildcard src/*/*.o src/*/*.lo) $(TEST_BINS) $(EXTRA_TARGETS)
distclean: clean
@exec rm -f config.mak src/include/$(package)/config.h
@@ -90,6 +90,12 @@ install-lib: $(STATIC_LIBS:lib%.a.xyzzy=$(DESTDIR)$(libdir)/lib%.a)
install-include: $(ALL_INCLUDES:src/include/$(package)/%.h=$(DESTDIR)$(includedir)/$(package)/%.h) $(DESTDIR)$(includedir)/pwd.h $(DESTDIR)$(includedir)/grp.h $(DESTDIR)$(includedir)/shadow.h
install-data: $(ALL_DATA:src/etc/%=$(DESTDIR)$(datadir)/%)
+tests: $(TEST_BINS)
+
+check: tests
+ @for i in $(TEST_BINS) ; do ./tools/run-test.sh $$i || exit 1 ; done
+
+
ifneq ($(exthome),)
$(DESTDIR)$(exthome): $(DESTDIR)$(home)
@@ -145,7 +151,7 @@ $(DESTDIR)$(includedir)/shadow.h: src/include/shadow.h
%.lo: %.c
exec $(REALCC) $(CPPFLAGS_ALL) $(CFLAGS_ALL) $(CFLAGS_SHARED) -c -o $@ $<
-$(ALL_BINS):
+$(ALL_BINS) $(TEST_BINS):
exec $(REALCC) -o $@ $(CFLAGS_ALL) $(LDFLAGS_ALL) $(LDFLAGS_NOSHARED) $^ $(EXTRA_LIBS) $(LDLIBS)
lib%.a.xyzzy:
@@ -155,6 +161,6 @@ lib%.a.xyzzy:
lib%.so.xyzzy:
exec $(REALCC) -o $@ $(CFLAGS_ALL) $(CFLAGS_SHARED) $(LDFLAGS_ALL) $(LDFLAGS_SHARED) -Wl,-soname,$(patsubst lib%.so.xyzzy,lib%.so.$(version_M),$@) $^ $(EXTRA_LIBS) $(LDLIBS)
-.PHONY: it all clean distclean tgz strip install install-dynlib install-bin install-lib install-include install-data
+.PHONY: it all clean distclean tgz strip install install-dynlib install-bin install-lib install-include install-data tests check
.DELETE_ON_ERROR: