2 # Copyright (C) 2004 Christophe Varoqui, <christophe.varoqui@opensvc.com>
6 # Allow to force some libraries to be used statically. (Uncomment one of the
7 # following lines or define the values when calling make.)
10 # WITH_LOCAL_LIBSYSFS = 1
17 ifeq ($(shell test -d /lib64 && echo 1),1)
25 ifeq ($(shell test -L /var/run -o ! -d /var/run && echo 1),1)
33 ifeq ($(shell systemctl --version > /dev/null 2>&1 && echo 1), 1)
34 SYSTEMD = $(shell systemctl --version 2> /dev/null | sed -n 's/systemd \([0-9]*\)/\1/p')
43 exec_prefix = $(prefix)
44 bindir = $(exec_prefix)/sbin
45 libudevdir = $(prefix)/$(SYSTEMDPATH)/udev
46 udevrulesdir = $(libudevdir)/rules.d
47 multipathdir = $(TOPDIR)/libmultipath
48 man8dir = $(prefix)/usr/share/man/man8
49 man5dir = $(prefix)/usr/share/man/man5
50 man3dir = $(prefix)/usr/share/man/man3
51 syslibdir = $(prefix)/$(LIB)
52 incdir = $(prefix)/usr/include
53 libdir = $(prefix)/$(LIB)/multipath
54 unitdir = $(prefix)/$(SYSTEMDPATH)/systemd/system
55 mpathpersistdir = $(TOPDIR)/libmpathpersist
56 mpathcmddir = $(TOPDIR)/libmpathcmd
57 thirdpartydir = $(TOPDIR)/third-party
62 INSTALL_PROGRAM = install
64 OPTFLAGS = -O2 -g -pipe -Wall -Wextra -Wformat=2 \
65 -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \
66 -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector \
67 --param=ssp-buffer-size=4
69 CFLAGS = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\"
70 SHARED_FLAGS = -shared
73 $(CC) $(CFLAGS) -c -o $@ $<