chiark / gitweb /
Allow bind() to port 0 !
[authbind.git] / Makefile
index 12aae95198406832f2d694cf0fdffe6f192911f8..18a092696ae06b9d8351debabcfa9963da3766b7 100644 (file)
--- a/Makefile
+++ b/Makefile
 # $Id$
 
 prefix=/usr/local
-share_dir=$(prefix)/share
-etc_dir=/etc/authbind
+
+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
+LDFLAGS=       -g
 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='"$(prefix)/helper"' -DCONFIGDIR='"$(etc_dir)"'
+               -DHELPER='"$(lib_dir)/helper"' -DCONFIGDIR='"$(etc_dir)"'
 
 MAJOR=1
 MINOR=0
@@ -40,18 +45,18 @@ LIBCANON=   libauthbind.so.$(MAJOR)
 LIBTARGET=     $(LIBCANON).$(MINOR)
 
 TARGETS=               authbind helper $(LIBTARGET)
-MANPAGES_1=            authbind
-MANPAGES_8=            authbind-helper
+MANPAGES_1=            authbind.1
+MANPAGES_8=            authbind-helper.8
 
 all:                   $(TARGETS)
 
 install:               $(TARGETS)
-               install -o root -g root -m 755 -d $(lib_dir) $(man_dir)
-               install -o root -g root -m 755 authbind $(bin_dir)/.
+               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 -s $(LIBTARGET) $(lib_dir)/$(LIBCANON)
-               install -o root -g root -m 4755 helper $(lib_dir)/.
+               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
 
@@ -59,11 +64,16 @@ 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
+libauthbind.o:         libauthbind.c authbind.h
                $(CC) -D_REENTRANT $(CFLAGS) $(CPPFLAGS) -c -o $@ -fPIC $<
 
+authbind:              authbind.o
+helper:                        helper.o
+
+helper.o authbind.o:   authbind.h
+
 $(LIBTARGET):          libauthbind.o
-               gcc -g -shared -Wl,-soname,$(LIBCANON) -o $@ $< -ldl -lc
+               ld -shared -soname $(LIBCANON) -o $@ $< -ldl -lc
 
 clean distclean:
                rm -f $(TARGETS) *.o *~ ./#*# *.bak *.new core libauthbind.so*