| 1 | # |
| 2 | # Makefile for webalizer - a web server logfile analysis thingie |
| 3 | # |
| 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. |
| 7 | # |
| 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. |
| 11 | # |
| 12 | |
| 13 | # Use these for SCO (and maybe others) |
| 14 | #BINDIR = /usr/bin |
| 15 | #MANDIR = /usr/man/man1 |
| 16 | #ETCDIR = /etc |
| 17 | #CC = cc |
| 18 | #CFLAGS = -b elf |
| 19 | #LDFLAGS= -L../usr/local/lib |
| 20 | #LIBS = -lgd -lm -lpng -lz |
| 21 | #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H |
| 22 | |
| 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). |
| 28 | |
| 29 | BINDIR = /usr/local/bin |
| 30 | MANDIR = /usr/local/man/man1 |
| 31 | ETCDIR = /etc |
| 32 | CC = gcc |
| 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 |
| 37 | |
| 38 | # Some might need this instead (Solaris?!?) |
| 39 | #LIBS = -lgd -lpng -lz -lm -ldb -lnsl -lsocket -lrt |
| 40 | |
| 41 | # if you want to use a different default directory for the |
| 42 | # GeoDB database, add this to DEFS: -DGEODB_LOC=\"/usr/share/GeoDB\" |
| 43 | |
| 44 | # if you have header files in a non-standard place, you |
| 45 | # should specify them on the CFLAGS line, like: |
| 46 | |
| 47 | #CFLAGS = -Wall -O2 -I../gd -I/src/bzip2 |
| 48 | |
| 49 | # similar with library locations. add non-standard paths |
| 50 | # using the LDFLAGS variable, like this: |
| 51 | |
| 52 | #LDFLAGS = -L/usr/local/lib -L/src/bzip2 |
| 53 | |
| 54 | # If your GD lib was compiled with X/truetype, you may need |
| 55 | # to use this or some variation of it: |
| 56 | |
| 57 | #LIBS = -lgd -lpng -lz -lm -ldb -lX11 -lXpm -lttf |
| 58 | |
| 59 | # If you want bzip2 support, you need to define USE_BZIP |
| 60 | # and add the bz2 library like below: |
| 61 | |
| 62 | #LIBS = -lgd -lpng -lz -lm -lbz2 |
| 63 | #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_BZIP |
| 64 | |
| 65 | # GeoIP support? You need USE_GEOIP and -lGeoIP |
| 66 | |
| 67 | #LIBS = -lgd -lpng -lz -lm -lGeoIP |
| 68 | #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_GEOIP |
| 69 | |
| 70 | # want it all?!? Give this a whirl: |
| 71 | |
| 72 | #LIBS = -lgd -lpng -lz -lm -lGeoIP -lbz2 -ldb |
| 73 | #DEFS = -DETCDIR=\"${ETCDIR}\" -DHAVE_MATH_H -DUSE_GEOIP -DUSE_DNS -DUSE_BZIP |
| 74 | |
| 75 | # Shouldn't have to touch below here! |
| 76 | |
| 77 | all: webalizer wcmgr |
| 78 | |
| 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 \ |
| 83 | webalizer_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} |
| 85 | rm -f webazolver |
| 86 | ln -s webalizer webazolver |
| 87 | rm -f webazolver.1 |
| 88 | ln -s webalizer.1 webazolver.1 |
| 89 | |
| 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 |
| 93 | |
| 94 | parser.o: parser.c parser.h webalizer.h lang.h |
| 95 | $(CC) ${CFLAGS} ${DEFS} -c parser.c |
| 96 | |
| 97 | hashtab.o: hashtab.c hashtab.h dns_resolv.h webalizer.h lang.h |
| 98 | $(CC) ${CFLAGS} ${DEFS} -c hashtab.c |
| 99 | |
| 100 | linklist.o: linklist.c linklist.h webalizer.h lang.h |
| 101 | $(CC) ${CFLAGS} ${DEFS} -c linklist.c |
| 102 | |
| 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 |
| 106 | |
| 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 |
| 110 | |
| 111 | dns_resolv.o: dns_resolv.c dns_resolv.h lang.h webalizer.h |
| 112 | $(CC) ${CFLAGS} ${DEFS} -c dns_resolv.c |
| 113 | |
| 114 | graphs.o: graphs.c graphs.h webalizer.h lang.h |
| 115 | $(CC) ${CFLAGS} ${DEFS} -c graphs.c |
| 116 | |
| 117 | wcmgr: wcmgr.o |
| 118 | $(CC) ${LDFLAGS} -o wcmgr wcmgr.o ${LIBS} |
| 119 | |
| 120 | wcmgr.o: wcmgr.c webalizer.h |
| 121 | $(CC) ${CFLAGS} ${DEFS} -c wcmgr.c |
| 122 | |
| 123 | clean: |
| 124 | rm -f webalizer *.o usage*.png daily*.png hourly*.png ctry*.png |
| 125 | rm -f *.html *.hist *.current core *.gif |
| 126 | |
| 127 | distclean: clean |
| 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 |
| 131 | |
| 132 | install: all |
| 133 | cp webalizer.1 ${MANDIR}/webalizer.1 |
| 134 | cp webalizer ${BINDIR}/webalizer |
| 135 | cp sample.conf ${ETCDIR}/webalizer.conf.sample |
| 136 | |
| 137 | uninstall: |
| 138 | rm -f ${MANDIR}/webalizer.1 |
| 139 | rm -f ${BINDIR}/webalizer |
| 140 | rm -f ${BINDIR}/webalizer.conf.sample |