xref: /onnv-gate/usr/src/cmd/man/src/util/instant.src/tptregexp/Makefile (revision 0:68f95e015346)
1#
2#pragma ident	"%Z%%M%	%I%	%E% SMI"
3#
4#
5# Copyright (c) 1994
6# Open Software Foundation, Inc.
7#
8# Permission is hereby granted to use, copy, modify and freely distribute
9# the software in this file and its documentation for any purpose without
10# fee, provided that the above copyright notice appears in all copies and
11# that both the copyright notice and this permission notice appear in
12# supporting documentation.  Further, provided that the name of Open
13# Software Foundation, Inc. ("OSF") not be used in advertising or
14# publicity pertaining to distribution of the software without prior
15# written permission from OSF.  OSF makes no representations about the
16# suitability of this software for any purpose.  It is provided "as is"
17# without express or implied warranty.
18#
19#
20# Copyright (c) 1995
21# Dalrymple Consulting
22#
23#
24#  $Header: /usr/src/docbook-to-man/Instant/tptregexp/RCS/Makefile,v 1.2 1996/06/15 22:55:56 fld Exp $
25#
26include ../../../../../Makefile.cmd
27
28ROOT	= /usr/lib/sgml
29
30MAKE	= make
31SHELL	= /bin/sh
32
33LIBDIR	= $(ROOT)/lib
34#CC	= gcc
35
36# Things you might want to put in ENV and LENV:
37# -Dvoid=int		compilers that don't do void
38# -DCHARBITS=0377	compilers that don't do unsigned char
39# -DSTATIC=extern	compilers that don't like "static foo();" as forward decl
40# -DSTRCSPN		library does not have strcspn()
41# -Dstrchr=index	library does not have strchr()
42# -DERRAVAIL		have utzoo-compatible error() function and friends
43#ENV=-Dvoid=int -DCHARBITS=0377 -DSTATIC=extern
44#LENV=-Dvoid=int -DCHARBITS=0377
45
46# Things you might want to put in TEST:
47# -DDEBUG		debugging hooks
48# -I.			tptregexp.h from current directory, not /usr/include
49TEST=	-I.
50
51# Things you might want to put in PROF:
52# -Dstatic='/* */'	make everything global so profiler can see it.
53# -p			profiler
54PROF=
55
56OPT=
57
58CFLAGS += $(OPT) $(ENV) $(TEST) $(PROF)
59LINTFLAGS = $(LENV) $(TEST) -ha
60LDFLAGS =
61
62OBJ=regexp.o regsub.o regerror.o strerror.o
63LSRC=regexp.c regsub.c regerror.c strerror.c
64DTR=README dMakefile regexp.3 tptregexp.h regexp.c regsub.c regerror.c \
65	regmagic.h try.c timer.c tests
66
67all: libtptregexp.a
68install: libtptregexp.a
69#	@echo "No install of regex lib - install in a lib directory by hand if desired."
70	cp libtptregexp.a $(LIBDIR)
71
72try:	try.o $(OBJ)
73	$(CC) $(LDFLAGS) try.o $(OBJ) -o try
74
75# Making timer will probably require putting stuff in $(PROF) and then
76# recompiling everything; the following is just the final stage.
77timer:	timer.o $(OBJ)
78	$(CC) $(LDFLAGS) $(PROF) timer.o $(OBJ) -o timer
79
80timer.o:	timer.c timer.t.h
81
82timer.t.h:	tests
83	sed 's/	/","/g;s/\\/&&/g;s/.*/{"&"},/' tests >timer.t.h
84
85# Regression test.
86r:	try tests
87	@echo 'No news is good news...'
88	try <tests
89
90lint:	timer.t.h
91	@echo 'Complaints about multiply-declared regerror() are legit.'
92	lint $(LINTFLAGS) $(LSRC) try.c
93	lint $(LINTFLAGS) $(LSRC) timer.c
94
95regexp.o:	regexp.c tptregexp.h regmagic.h
96regsub.o:	regsub.c tptregexp.h regmagic.h
97
98clean:
99	rm -f *.o core mon.out timer.t.h dMakefile dtr try timer
100
101clobber:	clean
102	rm -f libtptregexp.a
103
104dtr:	r makedtr $(DTR)
105	makedtr $(DTR) >dtr
106
107dMakefile:	Makefile
108	sed '/^L*ENV=/s/ *-DERRAVAIL//' Makefile >dMakefile
109
110
111lib:	libtptregexp.a
112libtptregexp.a: $(OBJ)
113	ar rcv $@ $(OBJ)
114	if [ -f /usr/bin/ranlib ] ; then ranlib $@ ; else true ; fi
115
116.PARALLEL:	$(OBJ)
117
118