File: 0001-Update-makefile-to-support-DESTDIR-and-debug-symbols.patch

package info (click to toggle)
httpry 0.1.8-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 436 kB
  • sloc: ansic: 1,358; perl: 1,336; sh: 155; makefile: 62
file content (53 lines) | stat: -rw-r--r-- 1,787 bytes parent folder | download | duplicates (4)
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
From c1d06dae9db1eaf80e57c703517acaf546cb9518 Mon Sep 17 00:00:00 2001
From: Janos Guljas <janos@debian.org>
Date: Mon, 3 Jul 2017 10:59:56 +0000
Subject: Update makefile to support DESTDIR and debug symbols

Last-Update: 2012-10-2
---
 Makefile | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 536b66d..922b712 100644
--- a/Makefile
+++ b/Makefile
@@ -6,8 +6,10 @@
 #  Copyright (c) 2005-2014 Jason Bittel <jason.bittel@gmail.com>
 #
 
+DESTDIR?=/usr/local
+
 CC		= gcc
-CCFLAGS  	= -Wall -O3 -funroll-loops -I/usr/include/pcap -I/usr/local/include/pcap
+CCFLAGS  	= -Wall -g -DDEBUG -O3 -funroll-loops -I/usr/include/pcap -I/usr/local/include/pcap
 DEBUGFLAGS	= -Wall -g -DDEBUG -I/usr/include/pcap -I/usr/local/include/pcap
 LIBS		= -lpcap -lm -pthread
 PROG		= httpry
@@ -18,7 +20,7 @@ FILES		= httpry.c format.c methods.c utility.c rate.c
 all: $(PROG)
 
 $(PROG): $(FILES)
-	$(CC) $(CCFLAGS) -o $(PROG) $(FILES) $(LIBS)
+	$(CC) $(CCFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(PROG) $(FILES) $(LIBS)
 
 debug: $(FILES)
 	@echo "--------------------------------------------------"
@@ -50,12 +52,13 @@ install: $(PROG)
 	@echo "a location of your choosing manually"
 	@echo "--------------------------------------------------"
 	@echo ""
-	cp -f $(PROG) /usr/sbin/
-	cp -f $(PROG).1 /usr/man/man1/ || cp -f $(PROG).1 /usr/local/man/man1/
+	mkdir -p $(DESTDIR)/usr/sbin/
+	cp -f $(PROG) $(DESTDIR)/usr/sbin/
+#	cp -f $(PROG).1 /usr/man/man1/ || cp -f $(PROG).1 /usr/local/man/man1/
 
 uninstall:
-	rm -f /usr/sbin/$(PROG)
-	rm -f /usr/man/man1/$(PROG).1 || rm -f /usr/local/man/man1/$(PROG).1
+	rm -f $(DESTDIR)/sbin/$(PROG)
+#	rm -f /usr/man/man1/$(PROG).1 || rm -f /usr/local/man/man1/$(PROG).1
 
 clean:
 	rm -f $(PROG)