Blame view

Makefile.am 3.17 KB
Andrew Savchenko authored
1
ACLOCAL_AMFLAGS = -I m4
Barak A. Pearlmutter authored
2
SUBDIRS = examples
Andrew Savchenko authored
3

Andrew Savchenko authored
4
if CLSYNC
redmine authored
5 6 7
bin_PROGRAMS = clsync gencompilerflags

gencompilerflags_SOURCES = gencompilerflags.c
Barak A. Pearlmutter authored
8

Barak A. Pearlmutter authored
9
clsync_SOURCES = calc.c cluster.c error.c fileutils.c glibex.c		\
redmine authored
10
	indexes.c main.c malloc.c rules.c stringex.c sync.c		\
redmine authored
11 12 13 14
	posix-hacks.c privileged.c pthreadex.c calc.h cluster.h		\
	fileutils.h glibex.h main.h port-hacks.h posix-hacks.h		\
	pthreadex.h stringex.h sync.h common.h control.h privileged.h	\
	rules.h syscalls.h
Barak A. Pearlmutter authored
15

redmine authored
16 17
clsync_CFLAGS  = $(AM_CFLAGS)
clsync_LDFLAGS = $(AM_LDFLAGS)
Barak A. Pearlmutter authored
18

redmine authored
19
if HAVE_KQUEUE
redmine authored
20
clsync_CFLAGS  += -DKQUEUE_SUPPORT
Barak A. Pearlmutter authored
21
clsync_SOURCES += mon_kqueue.c mon_kqueue.h
redmine authored
22 23
endif
if HAVE_INOTIFY
redmine authored
24
clsync_CFLAGS  += -DINOTIFY_SUPPORT
Barak A. Pearlmutter authored
25
clsync_SOURCES += mon_inotify.c mon_inotify.h
redmine authored
26
if INOTIFY_OLD
redmine authored
27
clsync_CFLAGS  += -DINOTIFY_OLD
redmine authored
28 29 30
endif
endif
if HAVE_FANOTIFY
redmine authored
31
clsync_CFLAGS  += -DFANOTIFY_SUPPORT
Barak A. Pearlmutter authored
32
clsync_SOURCES += mon_fanotify.c mon_fanotify.h
redmine authored
33 34
endif
if HAVE_BSM
redmine authored
35
clsync_CFLAGS  += -DBSM_SUPPORT
Barak A. Pearlmutter authored
36
clsync_SOURCES += mon_bsm.c mon_bsm.h
redmine authored
37
endif
redmine authored
38 39 40 41 42
if HAVE_GIO
clsync_CFLAGS  += -DGIO_SUPPORT $(GIO_CFLAGS)
clsync_LDFLAGS += $(GIO_LIBS)
clsync_SOURCES += mon_gio.c mon_gio.h
endif
redmine authored
43
if HAVE_DTRACEPIPE
redmine authored
44
clsync_CFLAGS  += -DDTRACEPIPE_SUPPORT
Barak A. Pearlmutter authored
45
clsync_SOURCES += mon_dtracepipe.c mon_dtracepipe.h
redmine authored
46
endif
redmine authored
47
if HAVE_BACKTRACE
redmine authored
48
clsync_CFLAGS  += -DBACKTRACE_SUPPORT
redmine authored
49
endif
redmine authored
50
if HAVE_CAPABILITIES
redmine authored
51
clsync_CFLAGS  += -DCAPABILITIES_SUPPORT
redmine authored
52 53 54
if HAVE_SECCOMP
clsync_CFLAGS  += -DSECCOMP_SUPPORT
endif
redmine authored
55
endif
redmine authored
56
if HAVE_GETMNTENT
redmine authored
57
clsync_CFLAGS  += -DGETMNTENT_SUPPORT
redmine authored
58
endif
redmine authored
59 60 61 62 63 64
if HAVE_UNSHARE
clsync_CFLAGS  += -DUNSHARE_SUPPORT
if HAVE_PIVOTROOT
clsync_CFLAGS  += -DPIVOTROOT_OPT_SUPPORT
endif
endif
redmine authored
65 66 67
#if HAVE_TRE
#clsync_CFLAGS  += -DTRE_SUPPORT
#endif
redmine authored
68 69 70 71
if HAVE_LIBCGROUP
clsync_CFLAGS  += -DCGROUP_SUPPORT
clsync_SOURCES += cgroup.c cgroup.h
endif
redmine authored
72

redmine authored
73 74 75 76
if HLLOCKS
clsync_CFLAGS  += -DHL_LOCKS
endif

redmine authored
77
if SOCKET
Barak A. Pearlmutter authored
78
clsync_SOURCES += socket.c control.c program.h
redmine authored
79
endif
Barak A. Pearlmutter authored
80

redmine authored
81 82 83 84 85 86
gencompilerflags_CFLAGS = $(clsync_CFLAGS)

main.o: compilerflags.h

compilerflags.h: gencompilerflags
	./gencompilerflags > compilerflags.h
Barak A. Pearlmutter authored
87

Barak A. Pearlmutter authored
88
dist_man_MANS = man/man1/clsync.1
Andrew Savchenko authored
89 90
endif

Barak A. Pearlmutter authored
91
dist_doc_DATA = CONTRIB DEVELOPING LICENSE PROTOCOL README.md TODO
Barak A. Pearlmutter authored
92

Barak A. Pearlmutter authored
93
EXTRA_DIST = .doxygen .travis.sh .travis.yml NOTES SHORTHANDS freebsd debian gentoo
Andrew Savchenko authored
94 95 96

if LIBCLSYNC
lib_LTLIBRARIES = libclsync.la
Artyom A Anikeev authored
97
libclsync_la_SOURCES = malloc.c libclsync.c socket.c error.c
Andrew Savchenko authored
98 99
libclsync_la_LDFLAGS = -version-info 0:0:0
endif
redmine authored
100

redmine authored
101 102 103 104 105
REVISION=$(shell [ -d .git ] &&\
	(echo -n \
		'\".'$$(($$(git log 2>/dev/null \
			| grep -c ^commit \
			| tr -d "\n" \
redmine authored
106
			)-1083 \
redmine authored
107
		))'\"' \
redmine authored
108
	) || echo -n '\"-release\"' )
redmine authored
109 110

AM_CFLAGS := -DREVISION=$(REVISION)
Barak A. Pearlmutter authored
111

redmine authored
112
clsync_includedir = $(includedir)/clsync
Andrew Savchenko authored
113
libclsync_includedir = $(includedir)/libclsync
redmine authored
114

Andrew Savchenko authored
115
if CLSYNC
redmine authored
116 117
clsync_include_HEADERS = \
	clsync.h \
redmine authored
118
	port-hacks.h \
Andrew Savchenko authored
119
	configuration.h \
Andrew Savchenko authored
120 121 122
	ctx.h \
	error.h \
	indexes.h \
redmine authored
123 124 125
	malloc.h \
	compilerflags.h

Andrew Savchenko authored
126 127
if SOCKET
clsync_include_HEADERS += \
Andrew Savchenko authored
128
	socket.h
Andrew Savchenko authored
129 130 131
endif
endif
if LIBCLSYNC
Andrew Savchenko authored
132 133 134
libclsync_include_HEADERS = \
	clsync.h \
	ctx.h \
Andrew Savchenko authored
135
	libclsync.h \
Andrew Savchenko authored
136
	malloc.h \
Andrew Savchenko authored
137
	socket.h
Andrew Savchenko authored
138
endif
Andrew Savchenko authored
139 140 141

doc:
	doxygen .doxygen
redmine authored
142

Andrew Savchenko authored
143
if LIBCLSYNC
Barak A. Pearlmutter authored
144
pkgconfig_DATA = pkgconfig/libclsync.pc
Andrew Savchenko authored
145
endif
redmine authored
146

redmine authored
147
CLEANFILES = compilerflags.h gencompilerflags
Andrew Savchenko authored
148
if CLSYNC
Barak A. Pearlmutter authored
149
CLEANFILES += examples/rules
redmine authored
150
clean-local:
redmine authored
151
	-rm -rf examples/testdir examples/*.o examples/*.so examples/*.xz doc/doxygen
Andrew Savchenko authored
152
endif