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.
22 lib_dir=$(prefix)/lib/authbind
23 libexec_dir=$(lib_dir)
25 share_dir=$(prefix)/share
26 man_dir=$(share_dir)/man
27 man1_dir=$(man_dir)/man1
28 man8_dir=$(man_dir)/man8
32 INSTALL_FILE ?= install -o root -g root -m 644
33 INSTALL_PROGRAM ?= install -o root -g root -m 755 -s
34 INSTALL_DIR ?= install -o root -g root -m 755 -d
40 CFLAGS= -g $(OPTIMISE) \
41 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit \
42 -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes
43 CPPFLAGS= -DMAJOR_VER='"$(MAJOR)"' -DMINOR_VER='"$(MINOR)"' \
44 -DLIBAUTHBIND='"$(lib_dir)/$(LIBCANON)"' \
45 -DHELPER='"$(libexec_dir)/$(HELPER)"' -DCONFIGDIR='"$(etc_dir)"' \
50 LIBCANON= libauthbind.so.$(MAJOR)
51 LIBTARGET= $(LIBCANON).$(MINOR)
55 TARGETS= $(BINTARGETS) $(HELPER) $(LIBTARGET)
56 MANPAGES_1= authbind.1
57 MANPAGES_8= authbind-helper.8
62 $(INSTALL_DIR) $(lib_dir) $(man1_dir) $(man8_dir)
63 $(INSTALL_PROGRAM) $(BINTARGETS) $(bin_dir)/.
64 $(INSTALL_FILE) $(LIBTARGET) $(lib_dir)/.
65 $(STRIP) --strip-unneeded $(lib_dir)/$(LIBTARGET)
66 ln -sf $(LIBTARGET) $(lib_dir)/$(LIBCANON)
67 $(INSTALL_PROGRAM) $(HELPER) $(libexec_dir)/.
68 chmod u+s $(libexec_dir)/$(HELPER)
69 $(INSTALL_DIR) $(etc_dir) \
70 $(etc_dir)/byport $(etc_dir)/byaddr $(etc_dir)/byuid
72 install_man: $(MANPAGES_1) $(MANPAGES_8)
73 $(INSTALL_FILE) $(MANPAGES_1) $(man1_dir)/.
74 $(INSTALL_FILE) $(MANPAGES_8) $(man8_dir)/.
76 libauthbind.o: libauthbind.c authbind.h
77 $(CC) -D_REENTRANT $(CFLAGS) $(CPPFLAGS) -c -o $@ -fPIC $<
82 helper.o authbind.o: authbind.h
84 $(LIBTARGET): libauthbind.o
85 ld -shared -soname $(LIBCANON) -o $@ $< $(LIBS)
88 rm -f $(TARGETS) *.o *~ ./#*# *.bak *.new core
89 rm -f libauthbind.so* *.core