File: Makefile

package info (click to toggle)
sntop 1.4.2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 184 kB
  • ctags: 78
  • sloc: ansic: 679; makefile: 106; sh: 5
file content (93 lines) | stat: -rw-r--r-- 2,179 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
# Generated automatically from Makefile.in by configure.
# simple network top - a top-like console network status tool
#  robert m love	<rml@tech9.net>
#  chris m rivera	<cmrivera@ufl.edu>
#
# http://sntop.sourceforge.net - homepage
# ftp://sntop.sourceforge.net/pub/sntop/ - anon ftp
#
# 05.12.2000 - 08.01.2000
#
# Makefile
#
# targets:
#  make/make all/make sntop
#	compile and link to create sntop executable
#  make install
#	install sntop
#  make clean
#	remove remaining object files
#  make proper
#	make clean ; make

all: sntop

srcdir = .

prefix = /usr
exec_prefix = ${prefix}

CC = gcc
CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DRETSIGTYPE=void -DHAVE_LIBNCURSES=1 -DHAVE_GETOPT_LONG=1 
INCLUDE = .
INSTDIR = ${exec_prefix}/bin
ETCDIR = /etc
LIBS = -lncurses 
OBJS = 
DOWENEEDGETOPT = 
MANDIR = ${prefix}/share/man/man1

proper: clean sntop

sntop: sntop.o
	$(CC) -o sntop sntop.o $(OBJS) $(LIBS)
	@echo "sntop: done compiling, now install with 'make install'"

sntop.o: sntop.c
	@if [ "${DOWENEEDGETOPT}" = getopt_long.o ]; \
		then \
		$(CC) -I$(INCLUDE) $(CFLAGS) -c getopt_long.c; \
	fi
	$(CC) -I$(INCLUDE) $(CFLAGS) -c sntop.c

clean:
	-rm sntop.o
	-rm getopt_long.o

install: sntop
	@if [ -d $(INSTDIR) ]; \
		then \
		cp sntop $(INSTDIR); \
		chmod 755 $(INSTDIR)/sntop; \
	else \
		echo "sntop: $(INSTDIR) does not exist"; false; \
	fi
	@if [ -d $(ETCDIR) ]; \
		then \
		if [ ! -f $(ETCDIR)/sntoprc ]; \
			then \
			cp sntoprc.EXAMPLE $(ETCDIR)/sntoprc; \
			chmod 644 $(ETCDIR)/sntoprc; \
			echo "sntop: Config installed in $(ETCDIR)"; \
		else \
			echo "sntop: conf file exists at $(ETCDIR)/sntoprc, we wont overwrite it"; \
		fi \
	else \
		echo "sntop: $(ETCDIR) does not exist"; false; \
	fi
	@if [ -d $(MANDIR) ]; \
		then \
		cp sntop.1.gz $(MANDIR); \
		chmod 644 $(MANDIR)/sntop.1.gz; \
		echo "sntop: Man file installed in $(MANDIR)"; \
	else \
		echo "sntop: $(MANDIR) does not exist, not installing man file"; \
	fi
	@if [ -f $(INSTDIR)/sntop ]; \
		then \
		echo "sntop: Executable installed in $(INSTDIR)"; \
	else \
		echo "sntop: Install to $(INSTDIR) failed"; false; \
	fi

# EOF