~ubuntu-branches/ubuntu/hoary/pcre3/hoary-security

« back to all changes in this revision

Viewing changes to debian/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2004-03-12 13:23:02 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040312132302-id6ksx1l8dwssbw9
Tags: 4.5-1.1
* NMU to fix rc-bugs.
* Update libtool related files to fix build-error on mips, keep original
  config.in, as it is no generated file. (Closes: #237265)
* pcregrep replaces pgrep. (Closes: #237564)
* Bump shlibs, pcre 4.5 includes two new functions.
* Let pgrep's /usr/share/doc symlink point to the package it depends on,
  pcregrep.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/make -f
2
 
 
3
 
# Make file for PCRE (Perl-Compatible Regular Expression) library.
4
 
 
5
 
# Edit these definitions for your system
6
 
 
7
 
# Should shared libraries be built: uncomment this to build them
8
 
BUILD-SHARED = true
9
 
 
10
 
CFLAGS = -O2 -DSUPPORT_UTF8
11
 
 
12
 
# Command to build a static library
13
 
AR = ar cq
14
 
 
15
 
# Command used to index static libraries
16
 
RANLIB = ranlib
17
 
 
18
 
# Options for compiling shared library modules
19
 
CFLAGS-PIC = $(CFLAGS) -fPIC
20
 
 
21
 
# Command to build a shared library
22
 
# $@ will be replaced by the name of the library, eg libpcre.so.2
23
 
MK-SHARED-LIB = gcc -shared -Wl,-soname,$@ -o $@ -lc
24
 
 
25
 
# Options to add a run-time library path to a program. This is used when
26
 
# building pcretest, and allows the tests to be run with the libraries still
27
 
# in this directory. This allows the libraries to be tested before they're
28
 
# installed over the old working set!
29
 
RPATH = -Wl,-rpath,.
30
 
 
31
 
# Everything below this line should not need modification
32
 
##########################################################################
33
 
 
34
 
OBJ = maketables.o get.o study.o pcre.o
35
 
PICOBJ = maketables.o-pic get.o-pic study.o-pic pcre.o-pic
36
 
 
37
 
# How to build .o-pic files
38
 
%.o-pic:        %.c ; $(CC) $(CFLAGS-PIC) -c $< -o $@
39
 
 
40
 
ifdef BUILD-SHARED # Building shared libs
41
 
all:            libpcre.a libpcreposix.a libpcre.so.3 libpcreposix.so.3 \
42
 
                                               pcretest pcregrep
43
 
 
44
 
# This assumes that anyone building shared libraries will want to use
45
 
# them for pgrep and pcretest. Is this a good assumption?
46
 
 
47
 
pcregrep:       libpcre.so.3 pcregrep.o
48
 
                $(CC) $(CFLAGS) -o pcregrep pcregrep.o libpcre.so.3
49
 
 
50
 
pcretest:       libpcre.so.3 libpcreposix.so.3 pcretest.o
51
 
                $(CC) $(CFLAGS) -o pcretest pcretest.o libpcre.so.3 \
52
 
                                libpcreposix.so.3 $(RPATH)
53
 
 
54
 
else # Not building shared libs
55
 
all:            libpcre.a libpcreposix.a pcretest pcregrep
56
 
 
57
 
pcregrep:       libpcre.a pcregrep.o
58
 
                $(CC) $(CFLAGS) -o pcregrep pcregrep.o libpcre.a
59
 
 
60
 
pcretest:       libpcre.a libpcreposix.a pcretest.o
61
 
                $(CC) $(CFLAGS) -o pcretest pcretest.o libpcre.a libpcreposix.a
62
 
endif
63
 
 
64
 
# Libraries
65
 
 
66
 
libpcre.so.3:   $(PICOBJ)
67
 
                $(MK-SHARED-LIB) $(PICOBJ)
68
 
 
69
 
libpcre.a:      $(OBJ)
70
 
                -rm -f libpcre.a
71
 
                $(AR) libpcre.a $(OBJ)
72
 
                $(RANLIB) libpcre.a
73
 
 
74
 
libpcreposix.so.3:      pcreposix.o-pic
75
 
                $(MK-SHARED-LIB) -L. -lpcre pcreposix.o-pic
76
 
 
77
 
libpcreposix.a: pcreposix.o
78
 
                -rm -f libpcreposix.a
79
 
                $(AR) libpcreposix.a pcreposix.o
80
 
                $(RANLIB) libpcreposix.a
81
 
 
82
 
pcre.o:         chartables.c pcre.c pcre.h internal.h
83
 
pcre.o-pic:     chartables.c pcre.c pcre.h internal.h
84
 
pcreposix.o:    pcreposix.c pcreposix.h internal.h pcre.h
85
 
pcreposix.o-pic:        pcreposix.c pcreposix.h internal.h pcre.h
86
 
maketables.o:   maketables.c pcre.h internal.h
87
 
maketables.o-pic:       maketables.c pcre.h internal.h
88
 
get.o:          get.c pcre.h internal.h
89
 
get.o-pic:      get.c pcre.h internal.h
90
 
study.o:        study.c pcre.h internal.h
91
 
study.o-pic:    study.c pcre.h internal.h
92
 
 
93
 
# Object files for extra programs
94
 
 
95
 
pcretest.o:     pcretest.c pcre.h
96
 
pcregrep.o:     pcregrep.c pcre.h
97
 
 
98
 
# An auxiliary program makes the default character table source
99
 
 
100
 
chartables.c:   dftables
101
 
                ./dftables >chartables.c
102
 
 
103
 
dftables:       dftables.c maketables.c pcre.h internal.h
104
 
                $(CC) -o dftables $(CFLAGS) dftables.c
105
 
 
106
 
 
107
 
# Regression test
108
 
 
109
 
test:           all
110
 
 
111
 
                # First test
112
 
                ./pcretest testdata/testinput1 >my-testoutput1
113
 
                diff -u testdata/testoutput1 my-testoutput1
114
 
 
115
 
                # Second test (case insensitive)
116
 
                ./pcretest -i testdata/testinput2 >my-testoutput2
117
 
                diff -u testdata/testoutput2 my-testoutput2
118
 
 
119
 
                # Third test
120
 
                ./pcretest testdata/testinput3 >my-testoutput3
121
 
                diff -u testdata/testoutput3 my-testoutput3
122
 
 
123
 
# This requires .fr locale to be available
124
 
#               # Fourth test
125
 
#               ./pcretest -i testdata/testinput4 >my-testoutput4
126
 
#               diff -u testdata/testoutput4 my-testoutput4
127
 
 
128
 
                # Fifth test
129
 
                ./pcretest testdata/testinput5 >my-testoutput5
130
 
                diff -u testdata/testoutput5 my-testoutput5
131
 
 
132
 
                # Sixth test
133
 
                ./pcretest testdata/testinput6 >my-testoutput6
134
 
                diff -u testdata/testoutput6 my-testoutput6
135
 
 
136
 
                rm my-testoutput*
137
 
 
138
 
# We deliberately omit dftables and chartables.c from 'make clean'; once made
139
 
# chartables.c shouldn't change, and if people have edited the tables by hand,
140
 
# you don't want to throw them away.
141
 
 
142
 
clean:;         -rm -f *.o *.o-pic *.a *.so* pcretest pcregrep
143
 
 
144
 
distclean:      clean
145
 
                -rm -f config.h config.status config.cache config.log
146
 
                -rm -f dftables chartables.c
147
 
 
148
 
# Declare which targets are phony, i.e. do not really result in files of
149
 
# that name
150
 
 
151
 
.PHONY:         all test clean distclean
152
 
 
153
 
# End