File: Makefile

package info (click to toggle)
ttysnoop 0.12d-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 396 kB
  • ctags: 460
  • sloc: ansic: 5,419; makefile: 172
file content (64 lines) | stat: -rw-r--r-- 1,375 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
#
# Makefile for the ttysnoop programs
#

CC	= gcc

OS = $(shell uname -s)

PREFIX ?= /usr/sbin
MANPREFIX ?= /usr/share/man

# Without shadow support

#CCOPTS	= -O2
#LIBS	= -lcrypt # remove -lcrypt if your system doesn't have it

# For shadow support

CCOPTS	= -O2 -DSHADOW_PWD $(CPPFLAGS) $(CFLAGS)
LIBS	= -lcrypt

SERVEROBJS	= ttysnoops.o common.o
CLIENTOBJS	= ttysnoop.o common.o
SERVERSRCS	= ttysnoops.c
CLIENTSRCS	= ttysnoop.c
INCLUDES	= config.h common.h

ifeq "$(OS)" "SunOS"
	# At least for GNU/OpenSolaris
	LIBS += -lsocket
	SERVEROBJS += logwtmp.o
else
	# Hoping for Glibc
	LIBS += -lutil
endif

all:		ttysnoops ttysnoop

ttysnoops:	$(SERVEROBJS)
		$(CC) $(LDFLAGS) $(SERVEROBJS) -o ttysnoops $(LIBS)

ttysnoop:	$(CLIENTOBJS)
		$(CC) $(LDFLAGS) $(CLIENTOBJS) -o ttysnoop $(LIBS)

ttysnoops.o:	$(SERVERSRCS) $(INCLUDES)
		$(CC) $(CCOPTS) -c -o ttysnoops.o $(SERVERSRCS)

ttysnoop.o:	$(CLIENTSRCS) $(INCLUDES)
		$(CC) $(CCOPTS) -c -o ttysnoop.o $(CLIENTSRCS)

common.o:	common.c common.h
		$(CC) $(CCOPTS) -c -o common.o common.c

logwtmp.o:	logwtmp.c common.h
		$(CC) $(CCOPTS) -c -o logwtmp.o logwtmp.c

clean:
		rm -f *.o core ttysnoop ttysnoops

install:
		install -s ttysnoop $(DESTDIR)$(PREFIX)/
		install -s ttysnoops $(DESTDIR)$(PREFIX)/
		install -m 644 ttysnoop.8 $(DESTDIR)$(MANPREFIX)/man8/
		@echo ... copy snooptab.dist to /etc/snooptab and edit it ...