1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
From: "Bernhard R. Link" <brlink@debian.org>
Date: Sat, 12 Mar 2011 17:11:13 +0100
Subject: add install target
---
Makefile | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 89ebbe8..b60e992 100644
--- a/Makefile
+++ b/Makefile
@@ -20,11 +20,11 @@ CFLAGS=-Wall -O3 -fomit-frame-pointer -funroll-loops
#CFLAGS=-fast
# GCC:
-SHLDFLAGS = --shared -Wl,--soname=libcliquer.so.1 -Wl,--version-script=libcliquer.map
+SHLDFLAGS = --shared -Wl,--soname=$(SONAME) -Wl,--version-script=libcliquer.map
SHCFLAGS = -fPIC -fvisibility=hidden
# SunOS:
-#SHLDFLAGS = --shared -Wl,--soname=libcliquer.so.1 -Wl,--version-script=libcliquer.map
+#SHLDFLAGS = --shared -Wl,--soname=$(SONAME) -Wl,--version-script=libcliquer.map
#SHCFLAGS = -fPIC
CPPFLAGS =
@@ -42,7 +42,7 @@ LONGOPTS = -DENABLE_LONG_OPTIONS
all: cliquer libcliquer.so
libcliquer_OBJECTS = cliquer.o graph.o reorder.o
-
+SONAME=libcliquer.so.1
testcases: testcases.o cliquer.o graph.o reorder.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ testcases.o cliquer.o graph.o reorder.o
@@ -74,3 +74,20 @@ backup:
test: testcases
./testcases
+
+DESTDIR=
+INSTALL=install
+INSTALL_DATA=$(INSTALL) -m644
+MKDIR_P=mkdir -p
+prefix=/usr/local
+
+install: cliquer libcliquer.so
+ $(MKDIR_P) $(DESTDIR)$(prefix)/bin
+ $(MKDIR_P) $(DESTDIR)$(prefix)/lib
+ $(MKDIR_P) $(DESTDIR)$(prefix)/include/cliquer
+ $(INSTALL) cliquer $(DESTDIR)$(prefix)/bin/
+ $(INSTALL) libcliquer.so $(DESTDIR)$(prefix)/lib/$(SONAME)
+ ln -s $(SONAME) $(DESTDIR)$(prefix)/lib/libcliquer.so
+ # users should #include <cliquer/cliquer.h>
+ $(INSTALL_DATA) cliquer.h set.h graph.h misc.h reorder.h \
+ cliquerconf.h $(DESTDIR)$(prefix)/include/cliquer/
|