Makefile 1.37 KB
Newer Older
chris's avatar
""    
chris committed
1
#
pdw's avatar
iftop  
pdw committed
2
# Makefile:
chris's avatar
""    
chris committed
3
4
5
6
# Makefile for iftop.
#
# $Id$
#
pdw's avatar
iftop  
pdw committed
7

chris's avatar
""    
chris committed
8
# C compiler to use.
pdw's avatar
iftop  
pdw committed
9
10
#CC = gcc

chris's avatar
""    
chris committed
11
12
13
14
15
16
17
18
19
20
# Give the location of pcap.h here:
CFLAGS += -I/usr/include/pcap

# Give the location of libpcap here if it's not in one of the standard
# directories:
#LDFLAGS += -L/usr/local/lib

# PREFIX specifies the base directory for the installation.
#PREFIX = /usr/local
PREFIX = /software
pdw's avatar
iftop  
pdw committed
21

chris's avatar
""    
chris committed
22
23
24
25
26
27
28
29
30
31
32
# BINDIR is where the binary lives. No leading /.
BINDIR = sbin

# MANDIR is where the manual page goes.
MANDIR = man
#MANDIR = share/man     # FHS-ish

# You shouldn't need to change anything below this point.
CFLAGS  += -g -Wall 
LDFLAGS += -g 
LDLIBS += -lpcap -lpthread -lcurses -lm
pdw's avatar
iftop  
pdw committed
33
34
35
36
37
38
39

SRCS =  iftop.c \
        addr_hash.c \
	hash.c \
	ns_hash.c \
	resolver.c \
	ui.c \
chris's avatar
""    
chris committed
40
        util.c \
pdw's avatar
iftop  
pdw committed
41
42
43
44
45
46
47
48
49
50
51
	sorted_list.c

OBJS = $(SRCS:.c=.o)

HDRS =  addr_hash.h	

# If you do not have makedepend, you will need to remove references to depend
# and nodepend below.
iftop: depend $(OBJS) Makefile
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) 

chris's avatar
""    
chris committed
52
53
54
55
56
57
58
install: iftop
	install -D iftop   $(PREFIX)/$(BINDIR)
	install -D iftop.8 $(PREFIX)/$(MANDIR)/man8

uninstall:
	rm -f $(PREFIX)/$(BINDIR)/iftop $(PREFIX)/$(MANDIR)/man8/iftop.8

pdw's avatar
iftop  
pdw committed
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%.o: %.c Makefile
	$(CC) $(CFLAGS) -c -o $@ $<

clean: nodepend
	rm -f *~ *.o core iftop

tags :
	etags *.c *.h

depend:
	makedepend -- $(CFLAGS) -- $(SRCS)
	touch depend

nodepend:
	makedepend -- --
	rm -f depend
 
# DO NOT DELETE