Skip to content

Commit

Permalink
[build] split tests, man pages and build dirs
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Jan 30, 2018
1 parent d697ef2 commit e538e02
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 24 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Expand Up @@ -450,6 +450,9 @@ AC_CONFIG_FILES([
init/Makefile
libnozzle/Makefile
libnozzle/libnozzle.pc
libnozzle/tests/Makefile
libnozzle/man/Doxyfile
libnozzle/man/Makefile
kronosnetd/Makefile
kronosnetd/kronosnetd.logrotate
libknet/Makefile
Expand Down
30 changes: 6 additions & 24 deletions libnozzle/Makefile.am
Expand Up @@ -10,16 +10,17 @@ MAINTAINERCLEANFILES = Makefile.in

include $(top_srcdir)/build-aux/check.mk


SYMFILE = libnozzle_exported_syms

EXTRA_DIST = $(SYMFILE) tap_updown_bad tap_updown_good api-test-coverage
EXTRA_DIST = $(SYMFILE)

sources = libnozzle.c
if BUILD_LIBNOZZLE

SUBDIRS = . tests man

libversion = 1:0:0

if BUILD_LIBNOZZLE
sources = libnozzle.c

include_HEADERS = libnozzle.h

Expand All @@ -44,25 +45,6 @@ libnozzle_la_LDFLAGS = $(AM_LDFLAGS) \

libnozzle_la_LIBADD = $(PTHREAD_LIBS)

check_PROGRAMS = nozzle_test

TESTS = $(check_PROGRAMS)

noinst_PROGRAMS = $(check_PROGRAMS)

check-local: check-api-test-coverage

check-api-test-coverage:
chmod u+x $(top_srcdir)/libnozzle/api-test-coverage
$(top_srcdir)/libnozzle/api-test-coverage $(top_srcdir) $(top_builddir)

nozzle_test_SOURCES = $(sources)

nozzle_test_CPPFLAGS = -DTEST \
-DABSBUILDDIR=\"$(abs_builddir)\"

nozzle_test_CFLAGS = $(PTHREAD_CFLAGS)

nozzle_test_LDFLAGS = $(PTHREAD_LIBS)
dist_man_MANS = man

endif
17 changes: 17 additions & 0 deletions libnozzle/man/Doxyfile.in
@@ -0,0 +1,17 @@
#
# Copyright (C) 2017 Red Hat, Inc. All rights reserved.
#
# Author: Fabio M. Di Nitto <fabbione@kronosnet.org>
# Christine Caulfield <ccaulfie@redhat.com>
#
# This software licensed under GPL-2.0+, LGPL-2.0+
#
PROJECT_NAME = @PACKAGE_NAME@
PROJECT_NUMBER = @PACKAGE_VERSION@
INPUT = @srcdir@/../libnozzle.h
XML_OUTPUT = @abs_builddir@/xml
GENERATE_XML = YES
XML_PROGRAMLISTING = NO
AUTOLINK_SUPPORT = NO
GENERATE_HTML = NO
GENERATE_LATEX = NO
27 changes: 27 additions & 0 deletions libnozzle/man/Makefile.am
@@ -0,0 +1,27 @@
#
# Copyright (C) 2017 Red Hat, Inc. All rights reserved.
#
# Authors: Fabio M. Di Nitto <fabbione@kronosnet.org>
#
# This software licensed under GPL-2.0+, LGPL-2.0+
#

MAINTAINERCLEANFILES = Makefile.in

include $(top_srcdir)/build-aux/check.mk

dist_man_MANS =

update-man-pages: doxyfile.stamp

doxyfile.stamp: Doxyfile
if MANPAGEUPDATES
$(DOXYGEN) Doxyfile
$(DOXY2MAN) -o $(abs_srcdir) -s 3 --short-pkg @PACKAGE_NAME@ --pkg "Kronosnet Programmer's Manual" $(builddir)/xml/libnozzle_8h.xml
else
@echo this system does not have doxy2man or doxygen installed. Unable to update man pages automatically.
endif
touch doxyfile.stamp

clean-local:
rm -rf doxyfile.stamp xml
38 changes: 38 additions & 0 deletions libnozzle/tests/Makefile.am
@@ -0,0 +1,38 @@
#
# Copyright (C) 2010-2017 Red Hat, Inc. All rights reserved.
#
# Author: Fabio M. Di Nitto <fabbione@kronosnet.org>
#
# This software licensed under GPL-2.0+, LGPL-2.0+
#

MAINTAINERCLEANFILES = Makefile.in

include $(top_srcdir)/build-aux/check.mk

EXTRA_DIST = tap_updown_bad tap_updown_good api-test-coverage

if BUILD_LIBNOZZLE

check_PROGRAMS = nozzle_test

TESTS = $(check_PROGRAMS)

noinst_PROGRAMS = $(check_PROGRAMS)

check-local: check-api-test-coverage

check-api-test-coverage:
chmod u+x $(top_srcdir)/libnozzle/api-test-coverage
$(top_srcdir)/libnozzle/api-test-coverage $(top_srcdir) $(top_builddir)

nozzle_test_SOURCES = ../libnozzle.c

nozzle_test_CPPFLAGS = -DTEST \
-DABSBUILDDIR=\"$(abs_builddir)\"

nozzle_test_CFLAGS = $(PTHREAD_CFLAGS)

nozzle_test_LDFLAGS = $(PTHREAD_LIBS)

endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e538e02

Please sign in to comment.