1#
2# Copyright (C) 2014 Alexander Zimmermann <alexander.zimmermann@netapp.com>
3#
4# This file is part of Flowgrind.
5#
6# Flowgrind is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# Flowgrind is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Flowgrind.  If not, see <http://www.gnu.org/licenses/>.
18#
19
20CLEANFILES = gitversion.h doc/doxyfile.stamp
21CLEAN_LOCAL_FILES = doc/html doc/latex doc/html.timestamp
22MR_PROPER_FILES = Makefile.in aclocal.m4 build-aux config.h.in config.h.in~ \
23				  configure
24
25BUILT_SOURCES = gitversion.h
26
27bin_PROGRAMS = flowgrind flowgrind-stop
28sbin_PROGRAMS = flowgrindd
29noinst_HEADERS = src/common.h src/debug.h
30
31dist_man1_MANS = man/flowgrind.1 \
32				 man/flowgrindd.1 \
33				 man/flowgrind-stop.1
34
35AM_CFLAGS = -Wall -Wextra -Werror=implicit -std=gnu99 -fgnu89-inline
36
37# flowgrind controller
38flowgrind_SOURCES = src/common.h src/debug.c src/fg_error.h src/fg_error.c \
39					src/fg_progname.h src/fg_progname.c src/fg_socket.h \
40					src/fg_string.h src/fg_string.c src/fg_definitions.h \
41					src/fg_time.h src/fg_time.c src/flowgrind.h src/flowgrind.c \
42					src/fg_argparser.h src/fg_argparser.c src/fg_rpc_client.h \
43					src/fg_rpc_client.c src/fg_log.h src/fg_log.c src/fg_list.h src/fg_list.c
44flowgrind_LDADD = $(LIBS) $(CURL_LDADD) $(XMLRPC_C_CLIENT_LDADD) $(GSL_LDADD)
45flowgrind_CFLAGS = $(AM_CFLAGS) $(CURL_CFLAGS) $(XMLRPC_C_CLIENT_CFLAGS) $(GSL_CFLAGS)
46
47# flowgrind daemon
48flowgrindd_SOURCES = src/common.h src/daemon.h src/daemon.c src/debug.c \
49					 src/destination.h src/destination.c src/fg_error.h \
50					 src/fg_error.c src/fg_math.h src/fg_math.c \
51					 src/fg_progname.h src/fg_progname.c src/fg_socket.c \
52					 src/fg_socket.h src/fg_string.h src/fg_string.c \
53					 src/fg_time.c src/flowgrindd.c src/fg_log.h src/fg_log.c \
54					 src/source.h src/source.c src/trafgen.h src/trafgen.c \
55					 src/fg_argparser.h src/fg_argparser.c src/fg_list.h \
56					 src/fg_list.c src/fg_definitions.h src/fg_affinity.h \
57					 src/fg_affinity.c src/fg_rpc_server.h src/fg_rpc_server.c
58flowgrindd_LDADD = $(LIBS) $(XMLRPC_C_SERVER_LDADD) $(GSL_LDADD)
59flowgrindd_CFLAGS = $(AM_CFLAGS) $(XMLRPC_C_SERVER_CFLAGS) $(UUID_CFLAGS) $(GSL_CFLAGS)
60
61# flowgrind-stop
62flowgrind_stop_SOURCES = src/fg_error.h src/fg_error.c src/fg_progname.h \
63						 src/fg_progname.c src/flowgrind_stop.c \
64						 src/fg_argparser.h src/fg_argparser.c \
65						 src/fg_definitions.h src/fg_rpc_client.h \
66						 src/fg_rpc_client.c
67flowgrind_stop_LDADD = $(LIBS) $(CURL_LDADD) $(XMLRPC_C_CLIENT_LDADD)
68flowgrind_stop_CFLAGS = $(AM_CFLAGS) $(CURL_FLAGS) $(XMLRPC_C_CLIENT_CFLAGS)
69
70# configured w/ pcap
71if USE_LIBPCAP
72flowgrindd_SOURCES += src/fg_pcap.h src/fg_pcap.c
73flowgrindd_LDADD += $(PCAP_LDADD)
74flowgrindd_CFLAGS += $(PCAP_CFLAGS)
75if USE_FG_PTHREAD_BARRIER
76flowgrindd_SOURCES += src/fg_barrier.h src/fg_barrier.c
77endif
78endif
79
80.PHONY: gitversion.h mrproper html.timestamp clean-local
81
82gitversion.h:
83	$(shellL) ./scripts/make-version.sh
84
85mrproper: maintainer-clean
86	-rm -rf $(MR_PROPER_FILES)
87
88# configured w/ doxygen
89if USE_DOXYGEN
90html: html.timestamp
91
92html.timestamp:
93	$(DOXYGEN) doc/Doxyfile
94	touch doc/$@
95
96clean-local:
97	-rm -rf $(CLEAN_LOCAL_FILES)
98endif
99
100