summaryrefslogtreecommitdiffstats
path: root/patches/hping3-20051105/clean_makefile.diff
blob: 899524fe97c44b82bb8b1ec42ff7d997c7cf60bd (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Subject: Don't be smarter than make
From: Juergen Beisert <jbe@pengutronix.de>

Simplify the makefile and use embedded rules.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
[mkl: install relative links only]
Singed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

---
 Makefile.in |   29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

Index: Makefile.in
===================================================================
--- Makefile.in.orig
+++ Makefile.in
@@ -9,7 +9,7 @@
 CC= gcc
 AR=/usr/bin/ar
 RANLIB=/usr/bin/ranlib
-CCOPT= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
+CFLAGS= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
 DEBUG= -g
 #uncomment the following if you need libpcap based build under linux
 #(not raccomanded)
@@ -50,21 +50,18 @@ libars.a: $(ARSOBJ)
 	$(RANLIB) $@
 
 hping3: byteorder.h $(OBJ)
-	$(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
+	$(CC) -o hping3 $(LDFLAGS) $(DEBUG) $(OBJ) $(PCAP) $(LDLIBS) @SOLARISLIB@ @TCL_LIB@
 	@echo
-	./hping3 -v
-	@echo "use \`make strip' to strip hping3 binary"
-	@echo "use \`make install' to install hping3"
+#	./hping3 -v
+#	@echo "use \`make strip' to strip hping3 binary"
+#	@echo "use \`make install' to install hping3"
 
 hping3-static: byteorder.h $(OBJ)
-	$(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
+	$(CC) -static -o hping3-static $(LDFLAGS) $(CCOPT) $(DEBUG) $(OBJ) $(PCAP) $(LDLIBS) @SOLARISLIB@ @TCL_LIB@ -ldl
 
 byteorder.h:
 	./configure
 
-.c.o:
-	$(CC) -c $(CCOPT) $(DEBUG) $(COMPILE_TIME) $<
-
 clean:
 	rm -rf hping3 *.o libars.a
 
@@ -72,13 +69,13 @@ distclean:
 	rm -rf hping3 *.o byteorder byteorder.h systype.h Makefile libars.a .depend
 
 install: hping3
-	cp -f hping3 /usr/sbin/
-	chmod 755 /usr/sbin/hping3
-	ln -s /usr/sbin/hping3 /usr/sbin/hping
-	ln -s /usr/sbin/hping3 /usr/sbin/hping2
-	@if [ -d ${INSTALL_MANPATH}/man8 ]; then \
-		cp ./docs/hping3.8 ${INSTALL_MANPATH}/man8; \
-		chmod 644 ${INSTALL_MANPATH}/man8/hping3.8; \
+	cp -f hping3 $(DESTDIR)/usr/sbin/
+	chmod 755 $(DESTDIR)/usr/sbin/hping3
+	ln -sf hping3 $(DESTDIR)/usr/sbin/hping
+	ln -sf hping3 $(DESTDIR)/usr/sbin/hping2
+	@if [ -d $(DESTDIR)${INSTALL_MANPATH}/man8 ]; then \
+		cp ./docs/hping3.8 $(DESTDIR)/${INSTALL_MANPATH}/man8; \
+		chmod 644 $(DESTDIR)/${INSTALL_MANPATH}/man8/hping3.8; \
 	else \
 		echo "@@@@@@ WARNING @@@@@@"; \
 		echo "Can't install the man page: ${INSTALL_MANPATH}/man8 does not exist"; \