1 # Makefile for authbind
3 # authbind is Copyright (C) 1998 Ian Jackson
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)
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.
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.
24 lib_dir=$(prefix)/lib/authbind
26 share_dir=$(prefix)/share
27 man_dir=$(share_dir)/man
28 man1_dir=$(man_dir)/man1
29 man8_dir=$(man_dir)/man8
34 CFLAGS= -g $(OPTIMISE) \
35 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit \
36 -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes
37 CPPFLAGS= -DMAJOR_VER='"$(MAJOR)"' -DMINOR_VER='"$(MINOR)"' \
38 -DLIBAUTHBIND='"$(lib_dir)/$(LIBCANON)"' \
39 -DHELPER='"$(lib_dir)/helper"' -DCONFIGDIR='"$(etc_dir)"'
43 LIBCANON= libauthbind.so.$(MAJOR)
44 LIBTARGET= $(LIBCANON).$(MINOR)
46 TARGETS= authbind helper $(LIBTARGET)
47 MANPAGES_1= authbind.1
48 MANPAGES_8= authbind-helper.8
53 install -o root -g root -m 755 -d $(lib_dir) $(man1_dir) $(man8_dir)
54 install -o root -g root -m 755 -s authbind $(bin_dir)/.
55 install -o root -g root -m 755 $(LIBTARGET) $(lib_dir)/.
56 strip --strip-unneeded $(lib_dir)/$(LIBTARGET)
57 ln -s $(LIBTARGET) $(lib_dir)/$(LIBCANON)
58 install -o root -g root -m 4755 -s helper $(lib_dir)/.
59 install -o root -g root -m 755 -d $(etc_dir) \
60 $(etc_dir)/byport $(etc_dir)/byaddr $(etc_dir)/byuid
62 install_man: $(MANPAGES_1) $(MANPAGES_8)
63 install -o root -g root -m 644 $(MANPAGES_1) $(man1_dir)/.
64 install -o root -g root -m 644 $(MANPAGES_8) $(man8_dir)/.
66 libauthbind.o: libauthbind.c
67 $(CC) -D_REENTRANT $(CFLAGS) $(CPPFLAGS) -c -o $@ -fPIC $<
69 $(LIBTARGET): libauthbind.o
70 gcc -g -shared -Wl,-soname,$(LIBCANON) -o $@ $< -ldl -lc
73 rm -f $(TARGETS) *.o *~ ./#*# *.bak *.new core libauthbind.so*