chiark / gitweb /
Much new build world.
[authbind.git] / Makefile
1 # Makefile for authbind
2
3 # authbind is Copyright (C) 1998 Ian Jackson
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, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
18 #
19 # $Id$
20
21 prefix=/usr/local
22 share_dir=$(prefix)/share
23 etc_dir=/etc/authbind
24 lib_dir=$(prefix)/lib/authbind
25 man_dir=$(share_dir)/man
26 man1_dir=$(man_dir)/man1
27 man8_dir=$(man_dir)/man8
28
29 OPTIMISE=       -O2
30 CFLAGS=         -g $(OPTIMISE) \
31                 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit \
32                 -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes
33 CPPFLAGS=       -DMAJOR_VER='"$(MAJOR)"' -DMINOR_VER='"$(MINOR)"' \
34                 -DLIBAUTHBIND='"$(lib_dir)/$(LIBCANON)"' \
35                 -DHELPER='"$(prefix)/helper"' -DCONFIGDIR='"$(etc_dir)"'
36
37 MAJOR=1
38 MINOR=0
39 LIBCANON=       libauthbind.so.$(MAJOR)
40 LIBTARGET=      $(LIBCANON).$(MINOR)
41
42 TARGETS=                authbind helper $(LIBTARGET)
43 MANPAGES_1=             authbind
44 MANPAGES_8=             authbind-helper
45
46 all:                    $(TARGETS)
47
48 install:                $(TARGETS)
49                 install -o root -g root -m 755 -d $(lib_dir) $(man_dir)
50                 install -o root -g root -m 755 authbind $(bin_dir)/.
51                 install -o root -g root -m 755 $(LIBTARGET) $(lib_dir)/.
52                 strip --strip-unneeded $(lib_dir)/$(LIBTARGET)
53                 ln -s $(LIBTARGET) $(lib_dir)/$(LIBCANON)
54                 install -o root -g root -m 4755 helper $(lib_dir)/.
55                 install -o root -g root -m 755 -d $(etc_dir) \
56                         $(etc_dir)/byport $(etc_dir)/byaddr $(etc_dir)/byuid
57
58 install_man:            $(MANPAGES_1) $(MANPAGES_8)
59                 install -o root -g root -m 644 $(MANPAGES_1) $(man1_dir)/.
60                 install -o root -g root -m 644 $(MANPAGES_8) $(man8_dir)/.
61
62 libauthbind.o:          libauthbind.c
63                 $(CC) -D_REENTRANT $(CFLAGS) $(CPPFLAGS) -c -o $@ -fPIC $<
64
65 $(LIBTARGET):           libauthbind.o
66                 gcc -g -shared -Wl,-soname,$(LIBCANON) -o $@ $< -ldl -lc
67
68 clean distclean:
69                 rm -f $(TARGETS) *.o *~ ./#*# *.bak *.new core libauthbind.so*