Code

change so make-dist works in subdirs
[nagiosplug.git] / Makefile.am
1 ## Process this file with automake to produce Makefile.in
3 SUBDIRS = intl lib plugins plugins-scripts po
5 EXTRA_DIST = config.rpath \
6         ABOUT-NLS CODING FAQ LEGAL REQUIREMENTS SUPPORT THANKS \
7         Helper.pm contrib pkg nagios-plugins.spec
9 ACLOCAL_AMFLAGS = -I lib
11 localedir = $(datadir)/locale
12 DEFS = -DLOCALEDIR=\"$(localedir)\"
14 dist-hook:
15         make THANKS nagios-plugins.spec
17 test:
18         cd plugins; $(MAKE) test
19         cd plugins-scripts; $(MAKE) test
21 nagios-plugins.spec: nagios-plugins.spec.in
22         sed "s/%%{VERSION}/${VERSION}/;s/%%{RELEASE}/${RELEASE}/;" $? > $@
24 # Solaris pkgmk
25 BUILDDIR = build-solaris
26 PACKDIR = build-pkg
27 PKGSCRIPT = pkg/solaris/solpkg
29 solpkg:
30         if [ ! -d $(BUILDDIR) ] ; then mkdir $(BUILDDIR); fi
31         if [ ! -d $(PACKDIR) ] ; then mkdir $(PACKDIR); fi
32         $(MAKE) all
33         $(MAKE) DESTDIR=$$PWD/$(BUILDDIR) install
34         $(INSTALL) pkg/solaris/pkginfo $(BUILDDIR)
35         cd $(BUILDDIR) && $(PERL) ../$(PKGSCRIPT) ../$(PACKDIR)
37 THANKS: AUTHORS
38         @echo "This software is brought to you by the Nagios Plugins Development Team. However," > $@
39         @echo "there have been many contributors to this project. Everyone below has helped in " >> $@
40         @echo "raising bug reports, creating patches or contributing new plugins." >> $@
41         @echo "" >> $@
42         perl -e ' while (<>) { print STDERR "Duplicate: $$_",$$/ if ($$a{$$_}) ; $$a{$$_}++}; print sort by_last_field (keys %a); sub by_last_field { ($$a1) = $$a =~ /\s(\w+)$$/; ($$b1) = $$b =~ /\s(\w+)$$/; $$a1 cmp $$b1}' $? >> $@
44 pkgclean:
45         rm -rf $(BUILDDIR) $(PACKDIR)