| @@ -1,67 +1,67 @@ | | | @@ -1,67 +1,67 @@ |
1 | $NetBSD: patch-ab,v 1.9 2006/11/12 01:51:52 rillig Exp $ | | 1 | $NetBSD: patch-ab,v 1.10 2009/02/16 19:16:57 joerg Exp $ |
2 | | | 2 | |
3 | --- Makefile.orig 1999-08-20 23:14:07.000000000 +0200 | | 3 | --- Makefile.orig 1999-08-20 23:14:07.000000000 +0200 |
4 | +++ Makefile 2006-11-12 02:49:34.000000000 +0100 | | 4 | +++ Makefile 2006-11-12 02:49:34.000000000 +0100 |
5 | @@ -14,25 +14,31 @@ | | 5 | @@ -14,25 +14,31 @@ |
6 | # along with this program; if not, write to the Free Software | | 6 | # along with this program; if not, write to the Free Software |
7 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. | | 7 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. |
8 | | | 8 | |
9 | -CFLAGS = -I. -Wall -O2 -g | | 9 | -CFLAGS = -I. -Wall -O2 -g |
10 | +MANDIR?= ${PREFIX}/man | | 10 | +MANDIR?= ${PREFIX}/man |
11 | + | | 11 | + |
12 | +CFLAGS += -I. -Wall -O2 | | 12 | +CFLAGS += -I. -Wall -O2 |
13 | LDFLAGS = -L. | | 13 | LDFLAGS = -L. |
14 | -LIBS = -lcgi | | 14 | -LIBS = -lcgi |
15 | +LIBS = libcgi.la | | 15 | +LIBS = libcgi.la |
16 | | | 16 | |
17 | OBJS = cgi.o cookies.o | | 17 | OBJS = cgi.o cookies.o |
18 | | | 18 | |
19 | -libcgi.a: $(OBJS) | | 19 | -libcgi.a: $(OBJS) |
20 | - ar rc $@ $^ | | 20 | - ar rc $@ $^ |
21 | +all: libcgi.la cgitest jumpto | | 21 | +all: libcgi.la cgitest jumpto |
22 | + | | 22 | + |
23 | +.SUFFIXES: .lo | | 23 | +.SUFFIXES: .lo |
24 | | | 24 | |
25 | -cgitest: cgitest.o libcgi.a | | 25 | -cgitest: cgitest.o libcgi.a |
26 | - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) | | 26 | - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) |
27 | +.c.lo: | | 27 | +.c.lo: |
28 | + ${LIBTOOL} --mode=compile ${CC} ${CFLAGS} -o $@ -c $< | | 28 | + ${LIBTOOL} --mode=compile ${CC} ${CFLAGS} -o $@ -c $< |
29 | | | 29 | |
30 | -jumpto: jumpto.o libcgi.a | | 30 | -jumpto: jumpto.o libcgi.a |
31 | - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) | | 31 | - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) |
32 | +libcgi.la: $(OBJS:.o=.lo) | | 32 | +libcgi.la: $(OBJS:.o=.lo) |
33 | + ${LIBTOOL} --mode=link ${CC} -o $@ ${OBJS:.o=.lo} \ | | 33 | + ${LIBTOOL} --mode=link ${CC} -o $@ ${OBJS:.o=.lo} \ |
34 | + -rpath ${PREFIX}/lib \ | | 34 | + -rpath ${PREFIX}/lib \ |
35 | + -version-info 0:0 | | 35 | + -version-info 0:0 |
36 | | | 36 | |
37 | -all: libcgi.a cgitest jumpto | | 37 | -all: libcgi.a cgitest jumpto |
38 | +cgitest: cgitest.lo libcgi.la | | 38 | +cgitest: cgitest.lo libcgi.la |
39 | + ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ cgitest.lo $(LIBS) | | 39 | + ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ cgitest.lo $(LIBS) |
40 | | | 40 | |
41 | -install: cgitest | | 41 | -install: cgitest |
42 | - install -m 755 cgitest /usr/lib/cgi-bin | | 42 | - install -m 755 cgitest /usr/lib/cgi-bin |
43 | +jumpto: jumpto.lo libcgi.la | | 43 | +jumpto: jumpto.lo libcgi.la |
44 | + ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ jumpto.lo $(LIBS) | | 44 | + ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ jumpto.lo $(LIBS) |
45 | | | 45 | |
46 | clean: | | 46 | clean: |
47 | rm -f cgitest cgitest.o jumpto jumpto.o libcgi.a $(OBJS) *.[35].html | | 47 | rm -f cgitest cgitest.o jumpto jumpto.o libcgi.a $(OBJS) *.[35].html |
48 | @@ -41,3 +47,19 @@ htmlman: | | 48 | @@ -41,3 +47,19 @@ htmlman: |
49 | for f in *.[35]; do \ | | 49 | for f in *.[35]; do \ |
50 | man -l $$f|rman -f HTML --title $$f -r "%s.%s.html" > $$f.html; \ | | 50 | man -l $$f|rman -f HTML --title $$f -r "%s.%s.html" > $$f.html; \ |
51 | done | | 51 | done |
52 | + | | 52 | + |
53 | +install: | | 53 | +install: |
54 | + ${BSD_INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/cgi-bin | | 54 | + ${BSD_INSTALL_PROGRAM_DIR} ${DESTDIR}${PREFIX}/libexec/cgi-bin |
55 | + ${BSD_INSTALL_DATA_DIR} ${PREFIX}/share/examples/cgilib | | 55 | + ${BSD_INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/examples/cgilib |
56 | + ${BSD_INSTALL_DATA} cgitest.c ${PREFIX}/share/examples/cgilib | | 56 | + ${BSD_INSTALL_DATA} cgitest.c ${DESTDIR}${PREFIX}/share/examples/cgilib |
57 | + ${BSD_INSTALL_DATA} jumpto.c ${PREFIX}/share/examples/cgilib | | 57 | + ${BSD_INSTALL_DATA} jumpto.c ${DESTDIR}${PREFIX}/share/examples/cgilib |
58 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} libcgi.la ${PREFIX}/lib | | 58 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} libcgi.la ${DESTDIR}${PREFIX}/lib |
59 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} cgitest ${PREFIX}/libexec/cgi-bin | | 59 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} cgitest ${DESTDIR}${PREFIX}/libexec/cgi-bin |
60 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} jumpto ${PREFIX}/libexec/cgi-bin | | 60 | + ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} jumpto ${DESTDIR}${PREFIX}/libexec/cgi-bin |
61 | + ${BSD_INSTALL_DATA} cgi.h ${PREFIX}/include | | 61 | + ${BSD_INSTALL_DATA} cgi.h ${DESTDIR}${PREFIX}/include |
62 | + for i in *.3; do \ | | 62 | + for i in *.3; do \ |
63 | + ${BSD_INSTALL_MAN} $$i ${MANDIR}/man3/; \ | | 63 | + ${BSD_INSTALL_MAN} $$i ${DESTDIR}${MANDIR}/man3/; \ |
64 | + done | | 64 | + done |
65 | + for i in *.5; do \ | | 65 | + for i in *.5; do \ |
66 | + ${BSD_INSTALL_MAN} $$i ${MANDIR}/man5/; \ | | 66 | + ${BSD_INSTALL_MAN} $$i ${DESTDIR}${MANDIR}/man5/; \ |
67 | + done | | 67 | + done |