From: Christian Wiese Date: Wed, 12 Mar 2008 13:25:35 +0000 (+0200) Subject: [BUILD] Added support for 'make install' X-Git-Tag: v1.3.15~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a184aa273c67410967b1fc8608bc3382ff0a93ee;p=thirdparty%2Fhaproxy.git [BUILD] Added support for 'make install' To be flexible while installing haproxy following variables have been added to the Makefile: - DESTDIR useful i.e. while installing in a sandbox (not set by default) - PREFIX defines the default install prefix (default: /usr/local) - SBINDIR defines the dir the haproxy binary gets installed (default: $PREFIX/sbin) --- diff --git a/Makefile b/Makefile index 4976ffd264..f74f8f85be 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,12 @@ # by "haproxy -vv" in CFLAGS. # SILENT_DEFINE may be used to specify other defines which will not be # reported by "haproxy -vv". +# DESTDIR is not set by default and is used for installation only. +# It might be useful to set DESTDIR if you want to install haproxy +# in a sandbox. +# PREFIX is set to "/usr/local" by default and is used for installation only. +# SBINDIR is set to "$(PREFIX)/sbin" by default and is used for installation +# only. # # Other variables : # DLMALLOC_SRC : build with dlmalloc, indicate the location of dlmalloc.c. @@ -48,6 +54,10 @@ # SUBVERS : add a sub-version (eg: platform, model, ...). # VERDATE : force haproxy's release date. +#### Installation options. +DESTDIR = +PREFIX = /usr/local +SBINDIR = $(PREFIX)/sbin #### TARGET system # Use TARGET= to optimize for a specifc target OS among the @@ -462,6 +472,10 @@ src/haproxy.o: src/haproxy.c src/dlmalloc.o: $(DLMALLOC_SRC) $(CC) $(COPTS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $< +install: all + install -d $(DESTDIR)/$(SBINDIR) + install haproxy $(DESTDIR)/$(SBINDIR) + clean: rm -f *.[oas] src/*.[oas] core haproxy test for dir in . src include/* doc; do rm -f $$dir/*~ $$dir/*.rej;done