2 # Makefile for webalizer - a web server logfile analysis thingie
4 # (c)1997-2011 by Bradford L. Barrett
5 # Distributed under the GNU GPL. See "README" and "Copyright"
6 # files supplied with this distribution for more information.
8 # This works on my Linux and Solaris systems, and should work
9 # out of the box on other GCC based systems. Tweek the values
10 # below for your environment if needed before running make.
13 # Use these for SCO (and maybe others)
15 #MANDIR = /usr/man/man1
19 #LDFLAGS= -L../usr/local/lib
20 #LIBS = -lgd -lm -lpng -lz
21 #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H
23 # These will build The Webalizer with DNS support
24 # on my Linux system. GD is statically built and
25 # is located in the ../gd directory. This system
26 # also has a stock install of the berkeley db lib
27 # (libdb in /usr/lib and db.h in /usr/include).
29 BINDIR = /usr/local/bin
30 MANDIR = /usr/local/man/man1
33 CFLAGS = -Wall -O2 -I../gd
34 LDFLAGS= -L/usr/local/lib -L../gd
35 LIBS = -lgd -lpng -lz -lm -ldb
36 DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_DNS
38 # Some might need this instead (Solaris?!?)
39 #LIBS = -lgd -lpng -lz -lm -ldb -lnsl -lsocket -lrt
41 # if you want to use a different default directory for the
42 # GeoDB database, add this to DEFS: -DGEODB_LOC=\"/usr/share/GeoDB\"
44 # if you have header files in a non-standard place, you
45 # should specify them on the CFLAGS line, like:
47 #CFLAGS = -Wall -O2 -I../gd -I/src/bzip2
49 # similar with library locations. add non-standard paths
50 # using the LDFLAGS variable, like this:
52 #LDFLAGS = -L/usr/local/lib -L/src/bzip2
54 # If your GD lib was compiled with X/truetype, you may need
55 # to use this or some variation of it:
57 #LIBS = -lgd -lpng -lz -lm -ldb -lX11 -lXpm -lttf
59 # If you want bzip2 support, you need to define USE_BZIP
60 # and add the bz2 library like below:
62 #LIBS = -lgd -lpng -lz -lm -lbz2
63 #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_BZIP
65 # GeoIP support? You need USE_GEOIP and -lGeoIP
67 #LIBS = -lgd -lpng -lz -lm -lGeoIP
68 #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_GEOIP
70 # want it all?!? Give this a whirl:
72 #LIBS = -lgd -lpng -lz -lm -lGeoIP -lbz2 -ldb
73 #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_GEOIP -DUSE_DNS -DUSE_BZIP
75 # Shouldn't have to touch below here!
79 webalizer: webalizer.o webalizer.h hashtab.o hashtab.h \
80 linklist.o linklist.h preserve.o preserve.h \
81 dns_resolv.o dns_resolv.h parser.o parser.h \
82 output.o output.h graphs.o graphs.h lang.h \
84 $(CC) ${LDFLAGS} -o webalizer webalizer.o hashtab.o linklist.o preserve.o parser.o output.o dns_resolv.o graphs.o ${LIBS}
86 ln -s webalizer webazolver
88 ln -s webalizer.1 webazolver.1
90 webalizer.o: webalizer.c webalizer.h parser.h output.h preserve.h \
91 graphs.h dns_resolv.h webalizer_lang.h
92 $(CC) ${CFLAGS} ${DEFS} -c webalizer.c
94 parser.o: parser.c parser.h webalizer.h lang.h
95 $(CC) ${CFLAGS} ${DEFS} -c parser.c
97 hashtab.o: hashtab.c hashtab.h dns_resolv.h webalizer.h lang.h
98 $(CC) ${CFLAGS} ${DEFS} -c hashtab.c
100 linklist.o: linklist.c linklist.h webalizer.h lang.h
101 $(CC) ${CFLAGS} ${DEFS} -c linklist.c
103 output.o: output.c output.h webalizer.h preserve.h \
104 hashtab.h graphs.h lang.h
105 $(CC) ${CFLAGS} ${DEFS} -c output.c
107 preserve.o: preserve.c preserve.h webalizer.h parser.h \
108 hashtab.h graphs.h lang.h
109 $(CC) ${CFLAGS} ${DEFS} -c preserve.c
111 dns_resolv.o: dns_resolv.c dns_resolv.h lang.h webalizer.h
112 $(CC) ${CFLAGS} ${DEFS} -c dns_resolv.c
114 graphs.o: graphs.c graphs.h webalizer.h lang.h
115 $(CC) ${CFLAGS} ${DEFS} -c graphs.c
118 $(CC) ${LDFLAGS} -o wcmgr wcmgr.o ${LIBS}
120 wcmgr.o: wcmgr.c webalizer.h
121 $(CC) ${CFLAGS} ${DEFS} -c wcmgr.c
124 rm -f webalizer *.o usage*.png daily*.png hourly*.png ctry*.png
125 rm -f *.html *.hist *.current core *.gif
128 rm -f webalizer.conf *.tar *.tgz *.Z *.tar.gz
129 rm -f Makefile webalizer_lang.h config.cache config.log config.status
130 ln -s lang/webalizer_lang.english webalizer_lang.h
133 cp webalizer.1 ${MANDIR}/webalizer.1
134 cp webalizer ${BINDIR}/webalizer
135 cp sample.conf ${ETCDIR}/webalizer.conf.sample
138 rm -f ${MANDIR}/webalizer.1
139 rm -f ${BINDIR}/webalizer
140 rm -f ${BINDIR}/webalizer.conf.sample