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