File: Makefile

package info (click to toggle)
docbook-to-man 1%3A2.0.0-32
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,332 kB
  • ctags: 868
  • sloc: ansic: 5,819; sh: 1,371; makefile: 158
file content (113 lines) | stat: -rw-r--r-- 3,286 bytes parent folder | download | duplicates (5)
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
#
# Copyright (c) 1994  
# Open Software Foundation, Inc. 
#  
# Permission is hereby granted to use, copy, modify and freely distribute 
# the software in this file and its documentation for any purpose without 
# fee, provided that the above copyright notice appears in all copies and 
# that both the copyright notice and this permission notice appear in 
# supporting documentation.  Further, provided that the name of Open 
# Software Foundation, Inc. ("OSF") not be used in advertising or 
# publicity pertaining to distribution of the software without prior 
# written permission from OSF.  OSF makes no representations about the 
# suitability of this software for any purpose.  It is provided "as is" 
# without express or implied warranty. 
#
#
# Copyright (c) 1995
# Dalrymple Consulting
#
#
#  $Header: /aolnet/dev/src/CVS/sgml/docbook-to-man/Instant/tptregexp/Makefile,v 1.2 1999/02/23 22:21:27 db3l Exp $
#

ROOT	= /usr/local

MAKE	= make
SHELL	= /bin/sh

LIBDIR	= $(ROOT)/lib
CC	= gcc

# Things you might want to put in ENV and LENV:
# -Dvoid=int		compilers that don't do void
# -DCHARBITS=0377	compilers that don't do unsigned char
# -DSTATIC=extern	compilers that don't like "static foo();" as forward decl
# -DSTRCSPN		library does not have strcspn()
# -Dstrchr=index	library does not have strchr()
# -DERRAVAIL		have utzoo-compatible error() function and friends
# -DSTRERROR		library does not have strerror()   [ANS-db3l]
#ENV=-Dvoid=int -DCHARBITS=0377 -DSTATIC=extern
#LENV=-Dvoid=int -DCHARBITS=0377

# Things you might want to put in TEST:
# -DDEBUG		debugging hooks
# -I.			tptregexp.h from current directory, not /usr/include
TEST=	-I.

# Things you might want to put in PROF:
# -Dstatic='/* */'	make everything global so profiler can see it.
# -p			profiler
PROF=

CFLAGS=-O $(ENV)
LINTFLAGS=$(LENV) $(TEST) -ha
LDFLAGS=

OBJ=regexp.o regsub.o regerror.o strerror.o
LSRC=regexp.c regsub.c regerror.c strerror.c
DTR=README dMakefile regexp.3 tptregexp.h regexp.c regsub.c regerror.c \
	regmagic.h try.c timer.c tests

all: libtptregexp.a
install: libtptregexp.a
#	@echo "No install of regex lib - install in a lib directory by hand if desired."
	cp libtptregexp.a $(LIBDIR)

try:	try.o $(OBJ)
	$(CC) $(LDFLAGS) try.o $(OBJ) -o try

%.o : %.c
	$(CC) -c $(CFLAGS) $(TEST) $(PROF) $< -o $@

# Making timer will probably require putting stuff in $(PROF) and then
# recompiling everything; the following is just the final stage.
timer:	timer.o $(OBJ)
	$(CC) $(LDFLAGS) $(PROF) timer.o $(OBJ) -o timer

timer.o:	timer.c timer.t.h

timer.t.h:	tests
	sed 's/	/","/g;s/\\/&&/g;s/.*/{"&"},/' tests >timer.t.h

# Regression test.
r:	try tests
	@echo 'No news is good news...'
	try <tests

lint:	timer.t.h
	@echo 'Complaints about multiply-declared regerror() are legit.'
	lint $(LINTFLAGS) $(LSRC) try.c
	lint $(LINTFLAGS) $(LSRC) timer.c

regexp.o:	regexp.c tptregexp.h regmagic.h
regsub.o:	regsub.c tptregexp.h regmagic.h

clean:
	rm -f *.o core mon.out timer.t.h dMakefile dtr try timer

clobber:	clean
	rm -f libtptregexp.a

dtr:	r makedtr $(DTR)
	makedtr $(DTR) >dtr

dMakefile:	Makefile
	sed '/^L*ENV=/s/ *-DERRAVAIL//' Makefile >dMakefile


lib:	libtptregexp.a
libtptregexp.a: $(OBJ)
	ar rcv $@ $(OBJ)
	if [ -f /usr/bin/ranlib ] ; then ranlib $@ ; else true ; fi