]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUILD] Added support for 'make install'
authorChristian Wiese <morfoh@opensde.org>
Wed, 12 Mar 2008 13:25:35 +0000 (15:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 17 Mar 2008 07:59:06 +0000 (08:59 +0100)
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)

Makefile

index 4976ffd264658d978413b27cebbeba6339e56bfc..f74f8f85be7268bfd069239bc4906a761c4fc2fa 100644 (file)
--- a/Makefile
+++ b/Makefile
 #          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.
 #   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=<target_name> 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