2 ===================================================================
15 ===================================================================
28 ===================================================================
33 exec_prefix = @exec_prefix@
36 +SHAREDOPT = -shared -fPIC -Wl,-soname,libcgi.so.0
37 LIBDIR = $(prefix)/lib
38 -INCDIR = $(prefix)/include
39 +INCDIR = $(prefix)/include/libcgi/
40 MANDIR = $(prefix)/man/man3
46 +FLAGS = -Wall -D_REENTRANT
48 OBJS = src/error.o src/cgi.o src/session.o src/base64.o src/md5.o \
49 src/string.o src/general.o src/list.o src/cookie.o
50 +SHOBJS=$(OBJS:.o=.sh.o)
52 -.c.o: $(CC) $(FLAGS) -c $<
53 +ALL_TARGETS = src/libcgi.a
55 +ALL_TARGETS += src/libcgi.so
58 -all: $(OBJS) src/libcgi.so
60 + $(CC) $(FLAGS) -c $*.c -o $@
63 + $(CC) $(FLAGS) -fPIC -c $*.c -o $@
71 $(AR) rc src/libcgi.a $(OBJS)
73 -src/libcgi.so: src/libcgi.a
74 - $(CC) $(SHAREDOPT) -o src/libcgi.so $(OBJS) $(EXTRA_LIBS)
75 +src/libcgi.so: $(SHOBJS)
76 + $(CC) $(SHAREDOPT) -o src/libcgi.so $(SHOBJS) $(EXTRA_LIBS)
79 - cp src/libcgi.a $(LIBDIR)
80 - cp src/libcgi.so $(LIBDIR)
81 - cp src/cgi.h $(INCDIR)
82 - cp src/session.h $(INCDIR)
83 + cp src/libcgi.a $(DESTDIR)/$(LIBDIR)
85 + cp src/libcgi.so $(DESTDIR)/$(LIBDIR)
87 + [ -d $(DESTDIR)/$(INCDIR) ] || mkdir -p $(DESTDIR)/$(INCDIR)
88 + cp src/cgi.h $(DESTDIR)/$(INCDIR)
89 + cp src/session.h $(DESTDIR)/$(INCDIR)
92 src/error.o: src/error.c src/error.h
94 src/list.o: src/list.c
97 - find src/ -name *.*o -exec rm -f {} \;
98 + find src/ -name *.o -exec rm -f {} \;
99 find src/ -name *.a -exec rm -f {} \;
100 + find src/ -name *.so -exec rm -f {} \;
103 rm -f $(LIBDIR)/libcgi.*
105 rm -f $(INCDIR)/session.h
106 rm -f $(MANDIR)/libcgi*
109 - cp doc/man/man3/libcgi_base64.3 $(MANDIR)
110 - cp doc/man/man3/libcgi_cgi.3 $(MANDIR)
111 - cp doc/man/man3/libcgi_general.3 $(MANDIR)
112 - cp doc/man/man3/libcgi_string.3 $(MANDIR)
113 - cp doc/man/man3/libcgi_session.3 $(MANDIR)
114 - cp doc/man/man3/libcgi_cookie.3 $(MANDIR)
116 +# cp doc/man/man3/libcgi_base64.3 $(MANDIR)
117 +# cp doc/man/man3/libcgi_cgi.3 $(MANDIR)
118 +# cp doc/man/man3/libcgi_general.3 $(MANDIR)
119 +# cp doc/man/man3/libcgi_string.3 $(MANDIR)
120 +# cp doc/man/man3/libcgi_session.3 $(MANDIR)
121 +# cp doc/man/man3/libcgi_cookie.3 $(MANDIR)