2
# %Z%%M% %I% %E% 1990 by Robin Miller
4
#/****************************************************************************
6
# * COPYRIGHT (c) 1990 - 2004 *
7
# * This Software Provided *
9
# * Robin's Nest Software Inc. *
11
# * Permission to use, copy, modify, distribute and sell this software and *
12
# * its documentation for any purpose and without fee is hereby granted *
13
# * provided that the above copyright notice appear in all copies and that *
14
# * both that copyright notice and this permission notice appear in the *
15
# * supporting documentation, and that the name of the author not be used *
16
# * in advertising or publicity pertaining to distribution of the software *
17
# * without specific, written prior permission. *
19
# * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *
20
# * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN *
21
# * NO EVENT SHALL HE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL *
22
# * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR *
23
# * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS *
24
# * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF *
27
# ****************************************************************************/
29
# Makefile -- makefile for program 'dt'
31
# Updated by W Liu 8/16/05 for MAC Darwin
32
# Added -DMacDarwin to CFLAGS.
33
# Note: No AIO supported
35
# System makefile definitions for program makefiles
40
# @lint -c $(LINTFLAGS) $<
44
# @$(GET) -G$*.c $(GFLAGS) $<
45
# @lint -c $(LINTFLAGS) $*.c
52
TR_PRINTER= $(PRINTER)
56
# Libraries the program links to which are considered volatile
60
# Libraries considered static
64
# This library is necessary for AIO functions, but it is being
65
# omitted (for now), since AIO isn't working quite right (yet)!
66
# [ Note: I'm pretty sure the AIO failures are not 'dt's fault. ]
67
# BTW: The failure is showing up as a data compare error, when
68
# 32-bit file offsets are used, or a get a premature EOF
69
# when _FILE_OFFSET_BITS=64 is defined :-) damn!
75
# P or G flag ( override on command line by invoking make PORG=-g )
80
CFLAGS+= $(PORG) -DFIFO -DMMAP -DTTY -DMacDarwin -DFreeBSD -D_BSD_SOURCE
85
# end of system makefile definitions
111
OBJS= ${CFILES:.c=.o}
114
### MKMF:LINTOBJS ###
116
LINTOBJS= ${CFILES:.c=.ln}
121
# system targets for program makefile
123
$(PROGRAM): $(OBJS) $(XOBJS) $(LIBS)
124
@echo -n loading $(PROGRAM) ...
125
@$(CC) -o $(PROGRAM) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) $(EXTLIBS)
129
@$(PRINTER) $(PRINTFLAGS) $(CFILES)
132
@vgrind $(CFILES) | $(TROFFPRINTER) $(TROFFPRINTERFLAGS)
135
lint $(LINTFLAGS) $(LINTOBJS) $(LINTLIBS)
139
@rm -f $(OBJS) $(PROGRAM)
141
tags: $(CFILES) $(HDRS)
142
ctags $(CFILES) $(HDRS)
143
etags $(CFILES) $(HDRS)
145
# end of system targets for program makefile
148
echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
149
echo '$$r makedep' >>eddep
151
cp Makefile Makefile.bak
152
ed - Makefile < eddep
153
rm eddep makedep makedep1 makedeperrs
156
@cat /dev/null >makedep
157
-(for i in ${CFILES} ; do \
158
${CPP} -M ${CPPOPTS} $(CFLAGS) $$i >> makedep; done) \
161
-e 's,^.*genassym\.o:,assym.s assym.L:,' \
162
-e 's,^\(.*\)\.o:,\1.o \1.ln:,' makedep > makedep1
163
${AWK} ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
164
else { if (length(rec $$3) > 78) { print rec; rec = $$0; } \
165
else rec = rec " " $$3 } } \
166
END { print rec } ' makedep1 > makedep
168
@(if [ -s makedeperrs ]; then false; fi)
171
# DO NOT DELETE THIS LINE