File: Makefile

package info (click to toggle)
host 20000331-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 540 kB
  • ctags: 998
  • sloc: ansic: 7,543; sh: 389; makefile: 133
file content (240 lines) | stat: -rw-r--r-- 6,877 bytes parent folder | download | duplicates (4)
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
#	@(#)Makefile            e07@nikhef.nl (Eric Wassenaar) 991515

# ----------------------------------------------------------------------
# Adapt the installation directories to your local standards.
# ----------------------------------------------------------------------

# This is where the host executable will go.
DESTBIN = /usr/local/bin

# This is where the host manual page will go.
DESTMAN = /usr/local/man

BINDIR = $(DESTBIN)
MANDIR = $(DESTMAN)/man1

# ----------------------------------------------------------------------
# Special compilation options may be needed only on a few platforms.
# See also the header file port.h for portability issues.
# ----------------------------------------------------------------------

#if defined(_AIX)
SYSDEFS = -D_BSD -D_BSD_INCLUDES -U__STR__ -DBIT_ZERO_ON_LEFT
#endif
 
#if defined(SCO) && You have either OpenDeskTop 3 or OpenServer 5
SYSDEFS = -DSYSV
#endif
 
#if defined(ultrix) && You are using the default ultrix <resolv.h>
SYSDEFS = -DULTRIX_RESOLV
#endif
 
#if defined(solaris) && You do not want to use BSD compatibility mode
SYSDEFS = -DSYSV
#endif
 
#if defined(solaris) && You are using its default broken resolver library
SYSDEFS = -DNO_YP_LOOKUP
#endif

SYSDEFS =

# ----------------------------------------------------------------------
# Configuration definitions.
# See also the header file conf.h for more configuration definitions.
# ----------------------------------------------------------------------

#if defined(BIND_49) && __res_state is still shipped as struct state
CONFIGDEFS = -DOLD_RES_STATE
#endif

#if defined(BIND_48) && You want to use the default bind res_send()
CONFIGDEFS = -DBIND_RES_SEND
#endif

#if defined(BIND_49) && You want to use the special host res_send()
CONFIGDEFS = -DHOST_RES_SEND
#endif

# This is the default in either case if you compile stand-alone.
CONFIGDEFS = -DHOST_RES_SEND

# ----------------------------------------------------------------------
# Include file directories.
# This program must be compiled with the same include files that
# were used to build the resolver library you are linking with.
# ----------------------------------------------------------------------

INCL = ../../include
INCL = .

COMPINCL = ../../compat/include
COMPINCL = .

INCLUDES = -I$(INCL) -I$(COMPINCL)

# ----------------------------------------------------------------------
# Compilation definitions.
# ----------------------------------------------------------------------

DEFS = $(CONFIGDEFS) $(SYSDEFS) $(INCLUDES)

COPTS =
COPTS = -O -DDEBUG
COPTS = -O

CFLAGS = $(COPTS) $(DEFS)

# Select your favorite compiler.
CC = /usr/ucb/cc			#if defined(solaris) && BSD
CC = /bin/cc -arch m68k -arch i386	#if defined(next)
CC = /bin/cc -Olimit 1000		#if defined(ultrix)
CC = /bin/cc
CC = cc

# ----------------------------------------------------------------------
# Linking definitions.
# libresolv.a should contain the resolver library of BIND 4.8.2 or later.
# Link it in only if your default library is different.
# SCO keeps its own default resolver library inside libsocket.a
#
# lib44bsd.a contains various utility routines, and comes with BIND 4.9.*
# You may need it if you link with the 4.9.* resolver library.
#
# libnet.a contains the getnet...() getserv...() getproto...() calls.
# It is safe to leave it out and use your default library.
# With BIND 4.9.3 the getnet...() calls are in the resolver library.
# ----------------------------------------------------------------------

RES = -lsocket				#if defined(SCO) && default
RES =
RES = ../../res/libresolv.a
RES = -lresolv

COMPLIB = ../../compat/lib/lib44bsd.a
COMPLIB = -lnet
COMPLIB =

LIBS = -lsocket -lnsl			#if defined(solaris) && not BSD
LIBS =

LIBRARIES = $(RES) $(COMPLIB) $(LIBS)

LDFLAGS =

# ----------------------------------------------------------------------
# Compatibility for compilation via the BIND master Makefile.
# ----------------------------------------------------------------------

# redefined by bind
CDEBUG = $(COPTS) $(CONFIGDEFS)
CDEFS = $(SYSDEFS) $(INCLUDES)
CFLAGS = $(CDEBUG) $(CDEFS)

# ----------------------------------------------------------------------
# Miscellaneous definitions.
# ----------------------------------------------------------------------

MAKE = make $(MFLAGS)

# This assumes the BSD install.
INSTALL = install -c

# Grrr
SHELL = /bin/sh

# ----------------------------------------------------------------------
# Files.
# ----------------------------------------------------------------------

PROG =	host
HDRS =	port.h conf.h exit.h type.h rrec.h defs.h host.h glob.h
SRCS =	main.c info.c list.c addr.c geth.c util.c misc.c test.c \
	file.c send.c vers.c
OBJS =	main.o info.o list.o addr.o geth.o util.o misc.o test.o \
	file.o send.o vers.o
MANS =	host.1
DOCS =	RELEASE_NOTES

UTILS = nslookup mxlookup rblookup
MISCS = malloc.c README_NT

FILES = Makefile $(DOCS) $(HDRS) $(SRCS) $(MANS) $(UTILS) $(MISCS)

PACKAGE = host
TARFILE = $(PACKAGE).tar

CLEANUP = $(PROG) $(OBJS) $(TARFILE) $(TARFILE).Z

# ----------------------------------------------------------------------
# Rules for installation.
# ----------------------------------------------------------------------

OWNER = root
GROUP = staff
MODE  = 755
STRIP = -s

all: $(PROG)

$(OBJS): $(HDRS)

$(PROG): $(OBJS)
	$(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBRARIES)

install: $(PROG)
	$(INSTALL) -m $(MODE) -o $(OWNER) -g $(GROUP) $(STRIP) $(PROG) $(BINDIR)

man: $(MANS)
	$(INSTALL) -m 444 host.1 $(MANDIR)

clean:
	rm -f $(CLEANUP) *.o a.out core

# ----------------------------------------------------------------------
# host may be called with alternative names, querytype names and "zone".
# A few frequently used abbreviations are handy.
# ----------------------------------------------------------------------

ABBREVIATIONS = a ns cname soa wks ptr hinfo mx txt	# standard
ABBREVIATIONS = mb mg mr minfo				# deprecated
ABBREVIATIONS = md mf null gpos				# obsolete
ABBREVIATIONS = rp afsdb x25 isdn rt nsap nsap-ptr	# new
ABBREVIATIONS = sig key px aaaa loc nxt srv kx cert	# very new
ABBREVIATIONS = eid nimloc atma naptr			# draft
ABBREVIATIONS = uinfo uid gid unspec			# nonstandard
ABBREVIATIONS = maila mailb any				# filters

ABBREVIATIONS = mx ns soa zone

links:
	for i in $(ABBREVIATIONS) ; do \
		(cd $(BINDIR) ; ln -s $(PROG) $$i) ; \
	done

# ----------------------------------------------------------------------
# Rules for maintenance.
# ----------------------------------------------------------------------

lint:
	lint $(DEFS) $(SRCS)

alint:
	alint $(DEFS) $(SRCS)

llint:
	lint $(DEFS) $(SRCS) -lresolv

print:
	lpr -J $(PACKAGE) -p Makefile $(DOCS) $(HDRS) $(SRCS)

dist:
	tar cf $(TARFILE) $(FILES)
	compress $(TARFILE)

depend:
	mkdep $(DEFS) $(SRCS)

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.