]> arthur.barton.de Git - ngircd-alex.git/blob - Makefile.am
Fix memory leak in portabtest Check_strtok_r()
[ngircd-alex.git] / Makefile.am
1 #
2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 # Please read the file COPYING, README and AUTHORS for more information.
10 #
11
12 AUTOMAKE_OPTIONS = gnu
13
14 SUBDIRS = doc src man contrib
15
16 EXTRA_DIST = autogen.sh configure.ng .clang_complete .mailmap
17
18 clean-local: osxpkg-clean
19         rm -f build-stamp*
20
21 maintainer-clean-local:
22         rm -rf autom4te.cache
23         rm -f Makefile.in Makefile aclocal.m4 configure configure.ac
24         rm -f ar-lib mkinstalldirs missing depcomp install-sh
25         rm -f config.log debian
26
27 testsuite:
28         cd src/testsuite && make check
29
30 lint:
31         cd src/ngircd && make lint
32
33 srcdoc:
34         cd doc && make srcdoc
35
36 have-xcodebuild:
37         @xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -list \
38          >/dev/null 2>&1 \
39          || ( echo; echo "Error: \"xcodebuild\" not found!"; echo; exit 1 )
40
41 have-packagemaker:
42         @packagemaker >/dev/null 2>&1; [ $$? -le 1 ] \
43          || ( echo; echo "Error: \"packagemaker\" not found!"; echo; exit 2)
44
45 xcode: have-xcodebuild
46         rel=`git describe|sed -e 's/rel-//g'|sed -e 's/-/~/'`; \
47          def="GCC_PREPROCESSOR_DEFINITIONS=\"VERSION=\\\"$$rel\\\"\""; \
48          xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -alltargets \
49          -configuration Default $$def build
50
51 xcode-clean: have-xcodebuild
52         xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -alltargets \
53          -configuration Default clean
54         rm -fr contrib/MacOSX/build
55
56 rpm: distcheck
57         rpm -ta ngircd-*.tar.gz
58
59 deb:
60         [ -f debian/rules ] || ln -s contrib/Debian debian
61         dpkg-buildpackage -rfakeroot -i
62
63 osxpkg: have-packagemaker osxpkg-dest
64         cd contrib/MacOSX && packagemaker --no-recommend \
65          --doc ngIRCd.pmdoc \
66          --out ../../$(distdir).mpkg
67         rm -f $(distdir).mpkg.zip
68         zip -ro9 $(distdir).mpkg.zip $(distdir).mpkg
69         make osxpkg-clean
70
71 osxpkg-clean:
72         [ ! -r ngircd.dest ] || sudo -n rm -rf ngircd.dest
73         rm -rf ngircd.dest $(distdir).mpkg
74
75 osxpkg-dest: have-xcodebuild osxpkg-clean clean
76         ./configure --prefix=/opt/ngircd
77         make xcode
78         make -C contrib/MacOSX de.barton.ngircd.plist
79         mkdir -p ngircd.dest/opt/ngircd/sbin
80         DESTDIR="$$PWD/ngircd.dest" make -C doc install
81         DESTDIR="$$PWD/ngircd.dest" make -C contrib install
82         DESTDIR="$$PWD/ngircd.dest" make -C man install
83         cp contrib/MacOSX/build/Default/ngIRCd \
84          ngircd.dest/opt/ngircd/sbin/ngircd
85         rm ngircd.dest/opt/ngircd/etc/ngircd.conf
86         echo "Have a nice day IRCing!" >ngircd.dest/opt/ngircd/etc/ngircd.motd
87         chmod -R a-s,og-w,a+rX ngircd.dest
88         sudo chown -R root:wheel ngircd.dest
89
90 .PHONY: deb have-packagemaker have-xcodebuild lint osxpkg osxpkg-clean \
91         osxpkg-dest rpm srcdoc testsuite xcode xcode-clean
92
93 # -eof-