File: Makefile

package info (click to toggle)
remote-tty 4.0-13
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, sid, stretch, wheezy
  • size: 212 kB
  • ctags: 219
  • sloc: ansic: 2,100; sh: 340; makefile: 131
file content (124 lines) | stat: -rw-r--r-- 3,886 bytes parent folder | download | duplicates (3)
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# $Id: Makefile,v 1.17 2001/03/24 21:14:24 vixie Exp $

# Copyright (c) 1996,1997 by Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.

VERSION = 4.0

VPATH = ../src

DESTROOT =
DESTPATH = $(DESTROOT)/usr
DESTBIN  = $(DESTPATH)/bin
DESTSBIN = $(DESTPATH)/sbin
DESTETC  = /etc

#CC = cc
CDEBUG = -O
#
# use -U to undefine, -D to define
#	DEBUG		include code to help debug this software
#	WANT_TCP	insecure network transparency
#	NEED_BITYPES_H	if you aren't on BSD/386 1.1, BSD 4.4, or SGI IRIX5
#	NEED_INET_ATON	if your C library is pretty old wrt BSD 4.4
#	NO_SOCKADDR_LEN	if your "struct sockaddr_in" lacks a sin_len field
#	NO_HSTRERROR	if your C library has no hstrerror() function
#
CDEFS = -UDEBUG -UWANT_TCPIP -UNEED_BITYPES_H -UNEED_INET_ATON \
	-UNO_SOCKADDR_LEN -UNO_HSTRERROR
#
CFLAGS += $(CDEBUG) $(CDEFS) -I/usr/local/include
LIBS = -lcrypt
#(if WANT_TCPIP defined and this isn't in your libc)
# -lresolv
#(if the resolver needs it, which BIND>=4.9's will on BSD>=4.4 systems)
# -l44bsd

BINARY = ttysrv rtty locbrok
SCRIPT = Startup console startsrv agelogs agelog
ALL = $(BINARY) $(SCRIPT)

all: $(ALL)

clean:
	rm -f $(ALL) version.c
	rm -f *.o *.BAK *.CKP *~

kit:; shar README Makefile *.c *.h *.sh > kit

bin.tar:; tar cf bin.tar $(ALL)

install: $(ALL) Makefile
	-set -x; test -d $(DESTPATH) || mkdir $(DESTPATH)
	-set +e -x; for x in bin dev sock log pid opt out; do \
		test -d $(DESTPATH)/$$x || mkdir $(DESTPATH)/$$x; \
	done
	set -x; for x in $(BINARY); do \
		install -c -m 111 $$x $(DESTBIN)/$$x; \
	done
	set -x; for x in $(SCRIPT); do \
		install -c -m 555 $$x $(DESTBIN)/$$x; \
	done

ttysrv: ttysrv.o ttyprot.o connutil.o misc.o version.o
	$(CC) -o ttysrv ttysrv.o ttyprot.o connutil.o misc.o version.o $(LIBS)

rtty: rtty.o ttyprot.o connutil.o misc.o version.o
	$(CC) -o rtty rtty.o ttyprot.o connutil.o misc.o version.o $(LIBS)

locbrok: locbrok.o misc.o version.o
	$(CC) -o locbrok locbrok.o misc.o version.o $(LIBS)

console: console.sh Makefile
	sed -e 's:DESTPATH:$(DESTPATH):g' <$@.sh >$@
	chmod +x $@

startsrv: startsrv.sh Makefile
	sed -e 's:DESTPATH:$(DESTPATH):g' <$@.sh >$@
	chmod +x $@

agelogs: agelogs.sh Makefile
	sed -e 's:DESTPATH:$(DESTPATH):g' <$@.sh >$@
	chmod +x $@

Startup: Startup.sh Makefile
	sed -e 's:DESTPATH:$(DESTPATH):g' <$@.sh >$@
	chmod +x $@

agelog: agelog.sh Makefile
	cat <$@.sh >$@
	chmod +x $@

ttysrv_saber:; #load $(CFLAGS) ttysrv.c ttyprot.c connutil.c
rtty_saber:; #load $(CFLAGS) rtty.c ttyprot.c connutil.c
locbrok_saber:; #load $(CFLAGS) locbrok.c

ttysrv.o:	Makefile ttysrv.c ttyprot.h rtty.h misc.h
rtty.o:		Makefile rtty.c ttyprot.h rtty.h misc.h
ttyprot.o:	Makefile ttyprot.c ttyprot.h rtty.h misc.h
locbrok.o:	Makefile locbrok.c locbrok.h rtty.h misc.h
connutil.o:	Makefile connutil.c rtty.h misc.h
misc.o:		Makefile misc.c rtty.h ttyprot.h misc.h

version.c: Makefile
	rm -f version.c
	( \
	  echo "#ifndef LINT"; \
	  echo "char Copyright[] ="; \
	  echo '  "Copyright 1996,1997,2001 by Internet Software Consortium, Inc.";'; \
	  echo "char Version[] ="; \
	  echo '  "Version $(VERSION) ('`whoami`'@'`hostname`' '`date`')";'; \
	  echo "#endif"; \
	) >version.c