blob: d4150fd775f7b99680ccddc38124f3d2abf5857d (
plain)
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
|
From c0e35d05c691171569b102e5cb0db0a8e3fc9320 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Wed, 7 Dec 2011 20:56:37 +0300
Subject: [PATCH 2/4] makefile: restect user's LDFLAGS, CXXFLAGS and other
variables
Distros like to push extra LDFLAGS and CXXFLAGS to allow user
more freedom on optimization, debugging techniquires and
just clever random hacks.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
trunk/src/Makefile | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/trunk/src/Makefile b/trunk/src/Makefile
index ca8148f..db2026a 100644
--- a/trunk/src/Makefile
+++ b/trunk/src/Makefile
@@ -1,21 +1,19 @@
DESTDIR=
-PREFIX=/usr
-BINDIR=$(PREFIX)/bin
-LIBDIR=${PREFIX}/lib
-CXXFLAGS=-O2
+PREFIX ?= /usr
+BINDIR ?= $(PREFIX)/bin
+LIBDIR ?= ${PREFIX}/lib
+CXXFLAGS += -O2
all: bpatch libbdelta.so bdelta
libbdelta.so: libbdelta.cpp compatibility.h container.h checksum.h file.h
- ${CC} -shared -fPIC ${CXXFLAGS} $< -o $@
+ $(CXX) -shared -fPIC $(CXXFLAGS) $(LDFLAGS) $< -o $@
bdelta: bdelta.cpp bdelta.h compatibility.h container.h file.h
- ${CC} $< -o $@ ${CXXFLAGS} -L. -lbdelta -lstdc++
+ $(CXX) $< -o $@ $(CXXFLAGS) $(LDFLAGS) -L. -lbdelta
bpatch: bpatch.cpp compatibility.h bdelta.h file.h
% : %.cpp
- ${CC} $< -o $@ ${CXXFLAGS} -lstdc++
+ $(CXX) $< -o $@ $(CXXFLAGS) $(LDFLAGS)
install: libbdelta.so bdelta bpatch
mkdir -p $(DESTDIR)$(BINDIR)
install -m 755 libbdelta.so $(DESTDIR)$(LIBDIR)
install -m 755 bdelta $(DESTDIR)$(BINDIR)
install -m 755 bpatch $(DESTDIR)$(BINDIR)
-
-
--
1.7.8
|