]> arthur.barton.de Git - ngircd-alex.git/blob - Makefile.am
Change build system to support new and old GNU automake
[ngircd-alex.git] / Makefile.am
1 #
2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001-2011 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 clean-local:
17         rm -f build-stamp*
18         rm -rf ngircd.dest
19
20 maintainer-clean-local:
21         rm -rf autom4te.cache
22         rm -f Makefile.in Makefile aclocal.m4 configure
23         rm -f mkinstalldirs missing depcomp install-sh
24         rm -f config.log debian
25
26 testsuite:
27         make -C src/testsuite check
28
29 lint:
30         make -C src/ngircd lint
31
32 srcdoc:
33         make -C doc srcdoc
34
35 have-xcodebuild:
36         @xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -list \
37          >/dev/null 2>&1 \
38          || ( echo; echo "Error: \"xcodebuild\" not found!"; echo; exit 1 )
39
40 have-packagemaker:
41         @packagemaker >/dev/null 2>&1; [ $$? -le 1 ] \
42          || ( echo; echo "Error: \"packagemaker\" not found!"; echo; exit 2)
43
44 xcode: have-xcodebuild
45         rel=`git describe|sed -e 's/rel-//g'|sed -e 's/-/~/'`; \
46          def="GCC_PREPROCESSOR_DEFINITIONS=\"VERSION=\\\"$$rel\\\"\""; \
47          xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -alltargets \
48          -configuration Default $$def build
49
50 xcode-clean: have-xcodebuild
51         xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -alltargets \
52          -configuration Default clean
53         rm -fr contrib/MacOSX/build
54
55 rpm: distcheck
56         rpm -ta ngircd-*.tar.gz
57
58 deb:
59         [ -f debian/rules ] || ln -s contrib/Debian debian
60         dpkg-buildpackage -rfakeroot -i
61
62 osxpkg: have-packagemaker osxpkg-dest
63         cd contrib/MacOSX && packagemaker \
64          --doc ngIRCd.pmdoc \
65          --out ../../$(distdir).mpkg
66         rm -f $(distdir).mpkg.zip
67         zip -ro9 $(distdir).mpkg.zip $(distdir).mpkg
68         rm -rf ngircd.dest $(distdir).mpkg
69
70 osxpkg-dest: have-xcodebuild clean
71         ./configure --prefix=/opt/ngircd
72         make xcode
73         make -C contrib/MacOSX de.barton.ngircd.plist
74         mkdir -p ngircd.dest/opt/ngircd/sbin
75         DESTDIR="$$PWD/ngircd.dest" make -C doc install
76         DESTDIR="$$PWD/ngircd.dest" make -C contrib install
77         DESTDIR="$$PWD/ngircd.dest" make -C man install
78         cp contrib/MacOSX/build/Default/ngIRCd \
79          ngircd.dest/opt/ngircd/sbin/ngircd
80         rm ngircd.dest/opt/ngircd/etc/ngircd.conf
81         echo "Have a nice day IRCing!" >ngircd.dest/opt/ngircd/etc/ngircd.motd
82         chmod -R a-s,og-w,a+rX ngircd.dest
83
84 .PHONY: deb have-packagemaker have-xcodebuild lint osxpkg osxpkg-dest rpm \
85         srcdoc testsuite xcode xcode-clean
86
87 # -eof-