blob: 418f71a8850fccfba12ffd8c0e34e6a932953778 (
plain)
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
|
$NetBSD: patch-ab,v 1.7 2002/12/27 14:36:02 cjep Exp $
--- Makefile.orig Fri Aug 20 22:14:07 1999
+++ Makefile
@@ -14,30 +14,50 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
-CFLAGS = -I. -Wall -O2 -g
+NROFF= nroff -mandoc
+
+CFLAGS += -I. -Wall -O2
LDFLAGS = -L.
-LIBS = -lcgi
+LIBS = libcgi.la
OBJS = cgi.o cookies.o
-libcgi.a: $(OBJS)
- ar rc $@ $^
+all: libcgi.la cgitest jumpto htmlman
-cgitest: cgitest.o libcgi.a
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+.SUFFIXES: .lo
-jumpto: jumpto.o libcgi.a
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+.c.lo:
+ ${LIBTOOL} --mode=compile ${CC} ${CFLAGS} -o $@ -c $<
-all: libcgi.a cgitest jumpto
+libcgi.la: $(OBJS:.o=.lo)
+ ${LIBTOOL} --mode=link ${CC} -o $@ ${OBJS:.o=.lo} \
+ -rpath ${PREFIX}/lib \
+ -version-info 0:0
-install: cgitest
- install -m 755 cgitest /usr/lib/cgi-bin
+cgitest: cgitest.lo libcgi.la
+ ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ cgitest.lo $(LIBS)
-clean:
- rm -f cgitest cgitest.o jumpto jumpto.o libcgi.a $(OBJS) *.[35].html
+jumpto: jumpto.lo libcgi.la
+ ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ jumpto.lo $(LIBS)
htmlman:
for f in *.[35]; do \
- man -l $$f|rman -f HTML --title $$f -r "%s.%s.html" > $$f.html; \
+ ${NROFF} $$f|rman -f HTML --title $$f -r "%s.%s.html" > $$f.html; \
done
+
+install:
+ -mkdir -p ${PREFIX}/libexec/cgi-bin
+ -mkdir -p ${PREFIX}/share/examples/cgilib
+ ${INSTALL} -c -m 444 cgitest.c ${PREFIX}/share/examples/cgilib
+ ${INSTALL} -c -m 444 jumpto.c ${PREFIX}/share/examples/cgilib
+ ${LIBTOOL} --mode=install ${INSTALL} -c -m 444 libcgi.la ${PREFIX}/lib
+ ${LIBTOOL} --mode=install ${INSTALL} -c -m 755 cgitest ${PREFIX}/libexec/cgi-bin
+ ${LIBTOOL} --mode=install ${INSTALL} -c -m 755 jumpto ${PREFIX}/libexec/cgi-bin
+ ${INSTALL} -c -m 444 cgi.h ${PREFIX}/include
+ -mkdir -p ${PREFIX}/share/doc/html/cgilib
+ for i in *.html; do \
+ ${INSTALL} -c -m 444 $$i ${PREFIX}/share/doc/html/cgilib ; \
+ done
+
+clean:
+ rm -f cgitest cgitest.o jumpto jumpto.o libcgi.a $(OBJS) *.[35].html
|