1if BUILD_MASTER
2MASTERDIR=mfsmaster mfsmetadump
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_MOUNT
27MOUNTDIR=mfsmount
28else
29MOUNTDIR=
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@
51
52ACLOCAL_AMFLAGS = -I m4
53
54SUBDIRS=mfstests mfsdata mfsmanpages $(MASTERDIR) $(METALOGGERDIR) $(SUPERVISORDIR) $(CHUNKSERVERDIR) $(MOUNTDIR) $(SCRIPTSDIR) $(NETDUMPDIR) $(SYSTEMDDIR)
55
56EXTRA_DIST=m4/ax_pthread.m4 debian rpm macosx freebsd linux_build.sh macosx_build.sh freebsd_build.sh
57
58distclean-local:
59	-rm -rf mfscommon/$(DEPDIR)
60
61dist-hook:
62	TODAY=`date "+%B %Y"` ; \
63	for f in $(distdir)/mfsmanpages/*.[1-8] ; do \
64		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 ; \
65	done ; \
66	for f in $(distdir)/mfsdata/*.cfg* ; do \
67		mv $$f tmp ; grep -v MFS_PRO_MARKER < tmp > $$f ; \
68	done ; \
69	mv $(distdir)/debian/control tmp ; grep -v '^#' < tmp > $(distdir)/debian/control ; \
70	mv $(distdir)/rpm/mfs.spec tmp ; grep -v '^##' < tmp > $(distdir)/rpm/mfs.spec ; \
71	rm -f tmp
72
73mfsdist: dist
74	mv $(distdir).tar.gz ../moosefs-dist/$(distdir)-$(RELEASE).tar.gz
75	ln -sf $(distdir)-$(RELEASE).tar.gz ../moosefs-dist/$(distdir).tar.gz
76