File: Makefile

package info (click to toggle)
arping 2.01-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 148 kB
  • ctags: 192
  • sloc: ansic: 1,646; sh: 176; makefile: 113
file content (98 lines) | stat: -rw-r--r-- 2,568 bytes parent folder | download
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# $Id: Makefile,v 1.24 2003/06/21 16:42:02 marvin Exp $
TARGETS=arping

USE_NETIF=0
FINDIF=1
OPENBSD=0
LINUX=0
SOLARIS=0
FREEBSD=0
MACOSX=0

CC=gcc
# explicit pcap include dir is for redhat which is fux0red
CFLAGS=-g -I/usr/local/include -L/usr/local/lib -DFINDIF=$(FINDIF) -DUSE_NETIF=$(USE_NETIF) -DOPENBSD=$(OPENBSD) -DLINUX=$(LINUX) -DSOLARIS=$(SOLARIS) -DFREEBSD=$(FREEBSD) -DMACOSX=$(MACOSX) -I/usr/include/pcap

all: message arping2

message:
	@echo ""
	@echo "Will now try to compile arping 2.x. If you have Libnet 1.0.x"
	@echo "(as opposed to 1.1.x) then this will fail and you should try"
	@echo "compiling arping 1.x."
	@echo ""
	@echo "Note that arping 1.x has been tested *A LOT* more than "
	@echo "arping 2.x, so if you have problems (especially compilation"
	@echo "problems), then try arping 1.x with libnet 1.0.x. Also, mail"
	@echo "me about it. thomas@habets.pp.se"
	@echo ""
	@echo "For information on how to compile arping 1.x, type "
	@echo "'make arping1'"
	@echo ""
	sleep 3

arping1:
	@echo
	@echo "usage: make [ target ]"
	@echo "Target can be one of: "
	@echo "freebsd, openbsd, netbsd, linux, solaris or macosx"
	@echo
	@echo "Important note!"
	@echo
	@echo "   Arping 1.x will only work with libnet 1.0.x, not 1.1.x"
	@echo "   BUT, arping 2.x will work with 1.1.x."
	@echo
	@echo "   Create arping 2.x by typing 'make'"
	@echo "   Arping 2.x has been known to work most architectures"
	@echo "   that arping 1.x works on, but arping 1.x has been tested"
	@echo "   more"
	@echo
	@echo "   Read README for more details."
	@echo

doc: arping.yodl
	yodl2man -o arping.8 arping.yodl

linux-nofindif:
	make USE_NETIF=1 LINUX=1 FINDIF=0 arping1-make
linux:
	make USE_NETIF=1 LINUX=1 arping1-make

freebsd:
	make USE_NETIF=1 FREEBSD=1 arping1-make

macosx:
	make USE_NETIF=1 MACOSX=1 arping1-make

openbsd:
	make OPENBSD=1 arping1-make
netbsd:
	make openbsd

solaris:
	make USE_NETIF=0 SOLARIS=1 arping1-make

install:
	install -c arping /usr/local/bin/arping
	install arping.8 /usr/local/man/man8/arping.8

arping.o: arping.c
	$(CC) -Wall $(CFLAGS) -c `libnet-config --defines` `libnet-config --cflags` arping.c

O_arping=arping.o
arping1-make: $(O_arping)
	$(CC) $(CFLAGS) -g -o arping $(O_arping) `libnet-config --libs` -lpcap

O_arping2=arping-2/arping.c
arping2: arping-2/arping
arping-2/arping: $(O_arping2)
	$(CC) `libnet-config --libs --defines --cflags` -o arping arping-2/arping.c -lnet -lpcap

clean:
	rm -f *.o $(TARGETS)

distclean: clean
	rm -f config{.cache,.h,.log,.status}

maintainerclean: distclean
	rm -f config{.h.in,ure}