1if BUILD_MASTER
2MASTERDIR=mfsmaster mfsmetatools
3else
4MASTERDIR=
5endif
6
7if BUILD_METALOGGER
8METALOGGERDIR=mfsmetalogger
9else
10METALOGGERDIR=
11endif
12
13if BUILD_SUPERVISOR
14SUPERVISORDIR=mfssupervisor
15else
16SUPERVISORDIR=
17endif
18
19
20if BUILD_CHUNKSERVER
21CHUNKSERVERDIR=mfschunkserver
22else
23CHUNKSERVERDIR=
24endif
25
26if BUILD_CLIENT
27CLIENTDIR=mfsclient
28else
29CLIENTDIR=
30endif
31
32if BUILD_SCRIPTS
33SCRIPTSDIR=mfsscripts
34else
35SCRIPTSDIR=
36endif
37
38if BUILD_NETDUMP
39NETDUMPDIR=mfsnetdump
40else
41NETDUMPDIR=
42endif
43
44if WITH_SYSTEMD
45SYSTEMDDIR=systemd
46else
47SYSTEMDDIR=
48endif
49
50RELEASE = @release@
51BUILDNO = @buildno@
52
53ACLOCAL_AMFLAGS = -I m4
54
55SUBDIRS=mfstests mfsdata mfsmanpages $(MASTERDIR) $(METALOGGERDIR) $(SUPERVISORDIR) $(CHUNKSERVERDIR) $(CLIENTDIR) $(SCRIPTSDIR) $(NETDUMPDIR) $(SYSTEMDDIR)
56
57EXTRA_DIST=m4/ax_pthread.m4 m4/ax_check_compile_flag.m4 debian rpm macosx freebsd debian_sysv_to_systemd.sh linux_build.sh macosx_build.sh freebsd_build.sh sanitize_build.sh README.md buildno.txt
58
59distclean-local:
60	-rm -rf mfscommon/$(DEPDIR)
61
62dist-hook:
63	TODAY=`date "+%B %Y"` ; \
64	for f in $(distdir)/mfsmanpages/*.[1-8] ; do \
65		mv $$f tmp ; sed -e "1s#MooseFS [1-9]\{1,5\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}-[0-9]\{1,2\}#MooseFS $(VERSION)-$(RELEASE)#" -e "1s#[A-Z][a-z]* [0-9][0-9][0-9][0-9]#$$TODAY#" < tmp | grep -v MFS_PRO_MARKER > $$f ; \
66	done ; \
67	for f in $(distdir)/mfsdata/*.cfg* ; do \
68		mv $$f tmp ; grep -v MFS_PRO_MARKER < tmp > $$f ; \
69	done ; \
70	mv $(distdir)/debian/control tmp ; grep -v '^#' < tmp > $(distdir)/debian/control ; \
71	mv $(distdir)/rpm/mfs.spec tmp ; grep -v '^##' < tmp > $(distdir)/rpm/mfs.spec ; \
72	rm -f tmp
73
74mfsdist: dist
75	mv $(distdir).tar.gz ../moosefs-dist/$(distdir)-b$(BUILDNO).tar.gz ; \
76	if grep -q '(WIP)' NEWS; then \
77		ln -sf $(distdir)-b$(BUILDNO).tar.gz ../moosefs-dist/$(distdir)-WIP.tar.gz ; \
78		ln -sf $(distdir)-b$(BUILDNO).tar.gz ../moosefs-dist/moosefs-3.x-LATEST.tar.gz ; \
79	else \
80		ln -sf $(distdir)-b$(BUILDNO).tar.gz ../moosefs-dist/$(distdir).tar.gz ; \
81		ln -sf $(distdir)-b$(BUILDNO).tar.gz ../moosefs-dist/$(distdir)-$(RELEASE).tar.gz ; \
82		ln -sf $(distdir)-b$(BUILDNO).tar.gz ../moosefs-dist/moosefs-3.x-LATEST.tar.gz ; \
83	fi
84