X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=authbind.git;a=blobdiff_plain;f=Makefile;h=37a8673de9aa8779abe22f38f3f939bd4f8bc9e2;hp=1d9a011d22bf958e75bdf2a7756dbd7efce0c73d;hb=refs%2Fheads%2Fmaster;hpb=3ef208a026336d54ab371c4e7221ba44ce14ff8b diff --git a/Makefile b/Makefile index 1d9a011..37a8673 100644 --- a/Makefile +++ b/Makefile @@ -15,13 +15,12 @@ # 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 +libexec_dir=$(lib_dir) share_dir=$(prefix)/share man_dir=$(share_dir)/man @@ -30,26 +29,30 @@ man8_dir=$(man_dir)/man8 etc_dir=/etc/authbind -INSTALL_FILE=install -o root -g root -m 644 -INSTALL_PROGRAM=install -o root -g root -m 755 -s -INSTALL_DIR=install -o root -g root -m 755 -d +INSTALL_FILE ?= install -o root -g root -m 644 +INSTALL_PROGRAM ?= install -o root -g root -m 755 -s +INSTALL_DIR ?= install -o root -g root -m 755 -d +STRIP ?= strip OPTIMISE= -O2 LDFLAGS= -g +LIBS= -ldl -lc 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)"' \ + -DHELPER='"$(libexec_dir)/$(HELPER)"' -DCONFIGDIR='"$(etc_dir)"' \ -D_GNU_SOURCE MAJOR=1 MINOR=0 LIBCANON= libauthbind.so.$(MAJOR) LIBTARGET= $(LIBCANON).$(MINOR) +BINTARGETS= authbind +HELPER= helper -TARGETS= authbind helper $(LIBTARGET) +TARGETS= $(BINTARGETS) $(HELPER) $(LIBTARGET) MANPAGES_1= authbind.1 MANPAGES_8= authbind-helper.8 @@ -57,12 +60,12 @@ all: $(TARGETS) install: $(TARGETS) $(INSTALL_DIR) $(lib_dir) $(man1_dir) $(man8_dir) - $(INSTALL_PROGRAM) authbind $(bin_dir)/. + $(INSTALL_PROGRAM) $(BINTARGETS) $(bin_dir)/. $(INSTALL_FILE) $(LIBTARGET) $(lib_dir)/. - strip --strip-unneeded $(lib_dir)/$(LIBTARGET) + $(STRIP) --strip-unneeded $(lib_dir)/$(LIBTARGET) ln -sf $(LIBTARGET) $(lib_dir)/$(LIBCANON) - $(INSTALL_PROGRAM) helper $(lib_dir)/. - chmod u+s $(lib_dir)/helper + $(INSTALL_PROGRAM) $(HELPER) $(libexec_dir)/. + chmod u+s $(libexec_dir)/$(HELPER) $(INSTALL_DIR) $(etc_dir) \ $(etc_dir)/byport $(etc_dir)/byaddr $(etc_dir)/byuid @@ -79,7 +82,8 @@ helper: helper.o helper.o authbind.o: authbind.h $(LIBTARGET): libauthbind.o - ld -shared -soname $(LIBCANON) -o $@ $< -ldl -lc + $(LD) -shared -soname $(LIBCANON) -o $@ $< $(LIBS) clean distclean: - rm -f $(TARGETS) *.o *~ ./#*# *.bak *.new core libauthbind.so* + rm -f $(TARGETS) *.o *~ ./#*# *.bak *.new core + rm -f libauthbind.so* *.core