1## Process this file with automake to produce Makefile.in
2
3AUTOMAKE_OPTIONS := subdir-objects
4ACLOCAL_AMFLAGS = -I m4
5
6
7SUBDIRS = deps/ae deps/inih deps/murmurhash .
8
9
10CLEANFILES = test_runner
11
12AM_CFLAGS = -g -std=gnu99 -pthread -D_GNU_SOURCE -DLOG_PERROR=0 -O3 -pthread -lm @LINK_TO_RT@ -Ideps/inih/ -Ideps/ae/ -Isrc/
13
14#=========================================================
15# statsite, the binary itself
16
17src_statsite_SOURCES = \
18       src/hashmap.c \
19       src/heap.c \
20       src/radix.c \
21       src/hll_constants.c \
22       src/hll.c \
23       src/set.c \
24       src/cm_quantile.c \
25       src/timer.c \
26       src/counter.c \
27       src/metrics.c \
28       src/streaming.c \
29       src/config.c \
30       src/networking.c \
31       src/conn_handler.c \
32       src/statsite.c
33
34
35src_statsite_LDADD = deps/ae/libae.a deps/inih/libinih.a deps/murmurhash/libmurmur.a
36
37
38# Standard compiler options from the scons file, for reference
39#CFLAGS = '-g -std=c99 -D_GNU_SOURCE -Wall -Werror -Wstrict-aliasing=0 -O3 -pthread -Ideps/inih/ -Ideps/ae/ -Isrc/'
40#CFLAGS_WITHOUT_ERR = '-g -std=c99 -D_GNU_SOURCE -O3 -pthread -Ideps/inih/ -Ideps/ae/ -Isrc/'
41
42# Compiler options for SunOS from the scons file
43##    statsite_with_err_cc_flags = '-g -std=gnu99 -D_GNU_SOURCE -DLOG_PERROR=0 -Wall -Wstrict-aliasing=0 -Wformat=0 -O3 -pthread -Ideps/inih/ -Ideps/ae/ -Isrc/'
44##    statsite_without_err_cc_flags = '-g -std=gnu99 -D_GNU_SOURCE -DLOG_PERROR=0 -O3 -pthread -Ideps/inih/ -Ideps/ae/ -Isrc/'
45
46
47
48## Install directions:
49# This makes statsite the result for make install, also allows for make uninstall if needed
50bin_PROGRAMS = src/statsite
51
52# This adds the sinks on make install, also allows for make uninstall if needed
53nobase_pkgdata_DATA = sinks/*
54
55
56## Stuff we want to include for the default dist task (not sdist)
57EXTRA_DIST = .
58
59# Targets
60scons-build:
61	scons statsite
62
63test:
64	scons test_runner
65	./test_runner
66
67integ: build test
68	py.test integ/
69
70sdist: clean
71	mkdir -vp /tmp/statsite-@STATSITE_VERSION@
72	cp -R . /tmp/statsite-@STATSITE_VERSION@
73	tar -zcv --exclude='.git' --exclude='.gitignore' -f statsite-@STATSITE_VERSION@.tar.gz -C /tmp statsite-@STATSITE_VERSION@
74
75RPMBUILDROOT=/tmp/rpm-build
76rpms: sdist build
77	mkdir -vp $(RPMBUILDROOT)
78	cp -v *.tar.gz $(RPMBUILDROOT)
79	cp -v rpm/statsite.spec $(RPMBUILDROOT)
80	rpmbuild --define "_topdir $(RPMBUILDROOT)" \
81        --define "_builddir %{_topdir}" \
82        --define "_rpmdir %{_topdir}" \
83        --define "_srcrpmdir %{_topdir}" \
84        --define "_specdir %{_topdir}" \
85        --define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \
86        --define "_sourcedir  %{_topdir}" \
87        -ba $(RPMBUILDROOT)/statsite.spec
88
89.PHONY: all test clean sdist build
90