chiark / gitweb /
Do not use ports >512 even if configured. (rshd)
[authbind.git] / Makefile
index 5618a5fadb87a2fc8699deb8e7e6565688153306..193234882c2548cc96e1c50452cd2b8742b2fc75 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,73 @@
+# Makefile for authbind
+# 
+# authbind is Copyright (C) 1998 Ian Jackson
 #
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
+#
+# $Id$
+
+prefix=/usr/local
+
+bin_dir=$(prefix)/bin
+lib_dir=$(prefix)/lib/authbind
+
+share_dir=$(prefix)/share
+man_dir=$(share_dir)/man
+man1_dir=$(man_dir)/man1
+man8_dir=$(man_dir)/man8
+
+etc_dir=/etc/authbind
+
 OPTIMISE=      -O2
 CFLAGS=                -g $(OPTIMISE) \
                -Wall -Wwrite-strings -Wpointer-arith -Wimplicit \
                -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes
+CPPFLAGS=      -DMAJOR_VER='"$(MAJOR)"' -DMINOR_VER='"$(MINOR)"' \
+               -DLIBAUTHBIND='"$(lib_dir)/$(LIBCANON)"' \
+               -DHELPER='"$(lib_dir)/helper"' -DCONFIGDIR='"$(etc_dir)"'
+
+MAJOR=1
+MINOR=0
+LIBCANON=      libauthbind.so.$(MAJOR)
+LIBTARGET=     $(LIBCANON).$(MINOR)
 
-TARGETS=               authbind helper libauthbind.so.0.1
+TARGETS=               authbind helper $(LIBTARGET)
+MANPAGES_1=            authbind.1
+MANPAGES_8=            authbind-helper.8
 
 all:                   $(TARGETS)
 
+install:               $(TARGETS)
+               install -o root -g root -m 755 -d $(lib_dir) $(man1_dir) $(man8_dir)
+               install -o root -g root -m 755 -s authbind $(bin_dir)/.
+               install -o root -g root -m 755 $(LIBTARGET) $(lib_dir)/.
+               strip --strip-unneeded $(lib_dir)/$(LIBTARGET)
+               ln -sf $(LIBTARGET) $(lib_dir)/$(LIBCANON)
+               install -o root -g root -m 4755 -s helper $(lib_dir)/.
+               install -o root -g root -m 755 -d $(etc_dir) \
+                       $(etc_dir)/byport $(etc_dir)/byaddr $(etc_dir)/byuid
+
+install_man:           $(MANPAGES_1) $(MANPAGES_8)
+               install -o root -g root -m 644 $(MANPAGES_1) $(man1_dir)/.
+               install -o root -g root -m 644 $(MANPAGES_8) $(man8_dir)/.
+
 libauthbind.o:         libauthbind.c
-               gcc -D_REENTRANT -g $(CFLAGS) -c -o libauthbind.o -fPIC libauthbind.c
+               $(CC) -D_REENTRANT $(CFLAGS) $(CPPFLAGS) -c -o $@ -fPIC $<
 
-libauthbind.so.0.1:    libauthbind.o
-               gcc -g -shared -Wl,-soname,libauthbind.so.0.1 -o libauthbind.so.0.1 libauthbind.o -ldl -lc
+$(LIBTARGET):          libauthbind.o
+               gcc -g -shared -Wl,-soname,$(LIBCANON) -o $@ $< -ldl -lc
 
-clean distclean: 
-               rm -f $(TARGETS) *.o *~ ./#*# *.bak debian/*~
-               rm -f core libauthbind.so*
+clean distclean:
+               rm -f $(TARGETS) *.o *~ ./#*# *.bak *.new core libauthbind.so*