#
# %Z%%M% %I% %E% 1990 by Robin Miller
#
#/****************************************************************************
# * *
# * COPYRIGHT (c) 1990 - 2004 *
# * This Software Provided *
# * By *
# * MILLER W J & ASSOCIATES *
# * *
# * Permission to use, copy, modify, distribute and sell this software and *
# * its documentation for any purpose and without fee is hereby granted *
# * provided that the above copyright notice appear in all copies and that *
# * both that copyright notice and this permission notice appear in the *
# * supporting documentation, and that the name of the author not be used *
# * in advertising or publicity pertaining to distribution of the software *
# * without specific, written prior permission. *
# * *
# * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *
# * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN *
# * NO EVENT SHALL HE BE LIABLE FOR ANY SPECIAL, 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. *
# * *
# ****************************************************************************/
#
# Makefile -- makefile for program 'dt'
#
# Modification History:
#
# April 14th, 2001 by Robin Miller.
# Changing linking from -non_shared to to shared, and now link with
# libaio instead of libaio_raw since we're linking shared. Linking against
# shared libraries reduces the executable size by more than half, which is
# important when using multiple processes (procs= or slices= options).
#
### MKMF:DEFINITIONS ###
# System makefile definitions for program makefiles
.SUFFIXES: .ln
.c.ln:
# @lint -i $(LINTFLAGS) $<
@lint -c $(LINTFLAGS) $<
#.c~.ln:
# @echo $<
# @$(GET) -G$*.c $(GFLAGS) $<
# @lint -i $(LINTFLAGS) $*.c
# @lint -c $(LINTFLAGS) $*.c
# @rm -f $*.c
PRINTER= lpr
PR_FLAGS= -p -P28
TR_PRINTER= $(PRINTER)
TR_FLAGS= -t -P28
# Libraries the program links to which are considered volatile
LIBS=
# Libraries considered static
#
# Linking with -laio is now done instead of -laio_raw, since
# when linking with shared libraries, the executuables are the
# same size, and this resolves issues using AIO to devices that
# don't have kernel support. In this case, the AIO library will
# automatically switch to using thread to emulate AIO's.
#
#EXTLIBS= -laio_raw -lbinlog
EXTLIBS= -laio -pthread -lbinlog
LINTLIBS=
# P or G flag ( override on command line by invoking make PORG=-g )
PORG= -O2 -g3
AWK= awk
#
# Compiler Options:
#
CFLAGS= $(PORG) -std -DAIO -DDEC -DEEI -DMMAP -DFIFO -DTTY -DRAND48
CPP= /lib/cpp
CPPOPTS= $(CFLAGS)
#CPPOPTS= -P
#
#
# Linker (loader) Options:
#
LDFLAGS=
#LDFLAGS= -non_shared
#
# Lint Options:
#
LINTFLAGS= -n -whCDPR -XE -Nn6000 -Nd8000 ${LINTOPTS}
# end of system makefile definitions
HDRS= dt.h
### MKMF:SOURCES ###
CFILES= \
dt.c \
dteei.c \
dtgen.c \
dtinfo.c \
dtread.c \
dtwrite.c \
dtstats.c \
dttty.c \
dtutil.c \
dtusage.c \
dtprocs.c \
dttape.c \
dtaio.c \
dtmmap.c \
dtfifo.c
### MKMF:OBJECTS ###
OBJS= ${CFILES:.c=.o}
### MKMF:LINTOBJS ###
LINTOBJS= ${CFILES:.c=.ln}
### MKMF:TARGETS ###
PROGRAM= dt
#
# System Targets:
#
$(PROGRAM): $(OBJS) $(XOBJS) $(LIBS)
$(CC) -o $(PROGRAM) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) $(EXTLIBS)
size $(PROGRAM)
file $(PROGRAM)
odump -Dl $(PROGRAM)
@echo done
print:;
@$(PRINTER) $(PRINTFLAGS) $(CFILES)
prettyprint:;
@vgrind $(CFILES) | $(TROFFPRINTER) $(TROFFPRINTERFLAGS)
lint: $(LINTOBJS)
lint $(LINTFLAGS) $(LINTOBJS) $(LINTLIBS)
touch lint
clean:;
@rm -f $(OBJS) $(PROGRAM)
tags: $(CFILES) $(HDRS)
ctags -wt $(CFILES) $(HDRS)
# end of system targets for program makefile
depend: makedep
echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
echo '$$r makedep' >>eddep
echo 'w' >>eddep
cp Makefile Makefile.bak
ex - Makefile < eddep
rm eddep makedep makedep1 makedeperrs
makedep: ${CFILES}
@cat /dev/null >makedep
-(for i in ${CFILES} ; do \
${CPP} -M ${CPPOPTS} $$i >> makedep; done) \
2>makedeperrs
sed \
-e 's,^.*genassym\.o:,assym.s assym.L:,' \
-e 's,^\(.*\)\.o:,\1.o \1.ln:,' makedep > makedep1
${AWK} ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
else { if (length(rec $$3) > 78) { print rec; rec = $$0; } \
else rec = rec " " $$3 } } \
END { print rec } ' makedep1 > makedep
@cat makedeperrs
@(if [ -s makedeperrs ]; then false; fi)
# DO NOT DELETE THIS LINE
syntax highlighted by Code2HTML, v. 0.9.1