1 ##
2 ## Copyright 2008 The qDecoder Project. All rights reserved.
3 ##
4 ## Redistribution and use in source and binary forms, with or without
5 ## modification, are permitted provided that the following conditions
6 ## are met:
7 ##
8 ## 1. Redistributions of source code must retain the above copyright
9 ## notice, this list of conditions and the following disclaimer.
10 ## 2. Redistributions in binary form must reproduce the above copyright
11 ## notice, this list of conditions and the following disclaimer in the
12 ## documentation and/or other materials provided with the distribution.
13 ##
14 ## THIS SOFTWARE IS PROVIDED BY THE QDECODER PROJECT ``AS IS'' AND ANY
15 ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 ## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 ## DISCLAIMED. IN NO EVENT SHALL THE QDECODER PROJECT BE LIABLE FOR ANY
18 ## DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 ## (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 ## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 ## THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 ##
25
26 prefix = @prefix@
27 exec_prefix = ${prefix}
28
29 ## Name
30 PRGNAME = qDecoder
31
32 ## Static Library Name
33 LIBNAME = lib${PRGNAME}.a
34
35 ## Shared Library Name
36 SLIBVERSION = 6
37 SLIBNAME = lib${PRGNAME}.so
38 SLIBREALNAME = ${SLIBNAME}.${SLIBVERSION}
39
40 ## System library directory
41 LIBDIR = @libdir@
42 HEADERDIR = @includedir@
43
44 ## Which compiler & options for release
45 CC = @CC@
46 CFLAGS = @CFLAGS@
47 DEFS = @DEFS@ @OPT_DEFS@
48 INCLUDE = -I./ @OPT_INCS@
49
50 ## Utilities
51 AR = @AR@
52 ARFLAGS = -rc
53 CHMOD = @CHMOD@
54 INSTALL = @INSTALL@
55 INSTALL_DATA = @INSTALL_DATA@
56 LD = @LD@
57 LDFLAGS = @LDFLAGS@ -G
58 LN_S = @LN_S@
59 RANLIB = @RANLIB@
60 RM = @RM@
61
62 ## Objects List
63 OBJ = qCgiRequest.o \
64 qCgiResponse.o \
65 qSession.o \
66 qHtml.o \
67 \
68 qSocket.o \
69 qSem.o \
70 qShm.o \
71 qDatabase.o \
72 \
73 qEntry.o \
74 qHashtbl.o \
75 qHasharr.o \
76 qQueue.o \
77 qObstack.o \
78 \
79 qConfig.o \
80 qLog.o \
81 \
82 qString.o \
83 qFile.o \
84 qEncode.o \
85 qHash.o \
86 qSed.o \
87 qCount.o \
88 qTime.o \
89 qSystem.o \
90 \
91 qInternalCommon.o \
92 md5/md5c.o
93
94 ## Make Library
95 all: qdecoder
96
97 qdecoder: ${OBJ}
98 ${AR} ${ARFLAGS} ${LIBNAME} ${OBJ}
99 ${RANLIB} ${LIBNAME}
100 ${LD} ${LDFLAGS} ${OBJ} -o ${SLIBREALNAME}
101 ${CHMOD} 0644 ${SLIBREALNAME}
102 ${RM} -f ${SLIBNAME}
103 ${LN_S} ${SLIBREALNAME} ${SLIBNAME}
104
105 install: all
106 ${INSTALL_DATA} qDecoder.h ${HEADERDIR}/qDecoder.h
107 ${INSTALL_DATA} ${LIBNAME} ${LIBDIR}/${LIBNAME}
108 ${INSTALL_DATA} ${SLIBREALNAME} ${LIBDIR}/${SLIBREALNAME}
109 ${RM} -f ${LIBDIR}/${SLIBNAME}
110 ${LN_S} ${LIBDIR}/${SLIBREALNAME} ${LIBDIR}/${SLIBNAME}
111
112 deinstall: uninstall
113 uninstall:
114 ${RM} -f ${HEADERDIR}/qDecoder.h
115 ${RM} -f ${LIBDIR}/${LIBNAME}
116 ${RM} -f ${LIBDIR}/${SLIBREALNAME}
117 ${RM} -f ${LIBDIR}/${SLIBNAME}
118
119 doc:
120 doxygen doxygen.conf
121
122 cleandoc:
123 ${RM} -rf ../doc/html ../doc/man
124
125 clean:
126 ${RM} -f ${OBJ} ${LIBNAME} ${SLIBREALNAME} ${SLIBNAME}
127
128 ## Compile
129 .c.o:
130 ${CC} ${CFLAGS} ${DEFS} ${INCLUDE} -c -o $@ $<