Gitweb:
http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=08017837...
Commit: 0801783702c5d100bd1f3d1150552873676d7c0d
Parent: a5500be36aeaf39eaebe96a4db901335b88e3131
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Sep 30 13:34:48 2011 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Sep 30 13:34:48 2011 -0500
dlm_controld: makefile adjustments
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/Makefile | 41 ++++++++++++++++++++++++++++-------------
1 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
index a89c7b3..d47f71b 100644
--- a/dlm_controld/Makefile
+++ b/dlm_controld/Makefile
@@ -1,6 +1,7 @@
-TARGET = dlm_controld
+BIN_TARGET = dlm_controld
+MAN_TARGET = dlm_controld.8
-SOURCE = \
+BIN_SOURCE = \
action.c \
cpg.c \
crc.c \
@@ -11,7 +12,7 @@ SOURCE = \
logging.c \
rbtree.c
-CFLAGS += -D_GNU_SOURCE -g \
+BIN_CFLAGS += -D_GNU_SOURCE -g \
-Wall \
-Wformat \
-Wformat-security \
@@ -32,19 +33,33 @@ CFLAGS += -D_GNU_SOURCE -g \
-fasynchronous-unwind-tables \
-fdiagnostics-show-option \
-CFLAGS += -fPIE -DPIE
-CFLAGS += `xml2-config --cflags`
-CFLAGS += -I../dlm/libdlm -I../dlm/libdlmcontrol
+BIN_CFLAGS += -fPIE -DPIE
+BIN_CFLAGS += `xml2-config --cflags`
+BIN_CFLAGS += -I../dlm/libdlm -I../dlm/libdlmcontrol
-LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
-LDFLAGS += `xml2-config --libs`
-LDFLAGS += -lpthread -llogthread -lcpg -lconfdb -lcfg -lquorum -lfenced
+BIN_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
+BIN_LDFLAGS += `xml2-config --libs`
+BIN_LDFLAGS += -lpthread -llogthread -lcpg -lconfdb -lcfg -lquorum -lfenced
-all: $(TARGET)
+all: $(BIN_TARGET)
-$(TARGET): $(SOURCE)
- $(CC) $(CFLAGS) $(LDFLAGS) $(SOURCE) -o $@ -L.
+$(BIN_TARGET): $(BIN_SOURCE)
+ $(CC) $(BIN_CFLAGS) $(BIN_LDFLAGS) $(BIN_SOURCE) -o $@ -L.
clean:
- rm -f *.o *.so *.so.* $(TARGET)
+ rm -f *.o *.so *.so.* $(BIN_TARGET)
+
+
+INSTALL=$(shell which install)
+
+DESTDIR=
+BINDIR=/usr/sbin
+MANDIR=/usr/share/man
+
+.PHONY: install
+install: all
+ $(INSTALL) -d $(DESTDIR)/$(BINDIR)
+ $(INSTALL) -d $(DESTDIR)/$(MANDIR)/man8
+ $(INSTALL) -c -m 755 $(BIN_TARGET) $(DESTDIR)/$(BINDIR)
+ $(INSTALL) -m 644 $(MAN_TARGET) $(DESTDIR)/$(MANDIR)/man8/