]>
Commit | Line | Data |
---|---|---|
25697a35 GS |
1 | # Makefile.in for sarg |
2 | ||
2357ef77 FM |
3 | prefix=@prefix@ |
4 | datarootdir=@datarootdir@ | |
5 | datadir=@datadir@ | |
6 | exec_prefix=@exec_prefix@ | |
7 | PACKAGE_TARNAME=@PACKAGE_TARNAME@ | |
c0ec9cc7 FM |
8 | docdir = @docdir@ |
9 | CC = @CC@ | |
4b7d4cb0 FM |
10 | bindir = @bindir@ |
11 | mandir = @mandir@ | |
12 | man1dir = $(mandir)/man1 | |
13 | sysconfdir = @sysconfdir@ | |
c0ec9cc7 | 14 | SARGPHPDIR = @SARGPHPDIR@ |
c0ec9cc7 FM |
15 | FONTDIR = @FONTDIR@ |
16 | IMAGEDIR = @IMAGEDIR@ | |
c0ec9cc7 FM |
17 | IBINDIR = -DBINDIR=\"@bindir@\" |
18 | ISYSCONFDIR = -DSYSCONFDIR=\"@sysconfdir@\" | |
19 | ISARGPHPDIR = -DSARGPHPDIR=\"@SARGPHPDIR@\" | |
c0ec9cc7 FM |
20 | IFONTDIR = -DFONTDIR=\"@FONTDIR@\" |
21 | IIMAGEDIR = -DIMAGEDIR=\"@IMAGEDIR@\" | |
d49c75f3 | 22 | ILOCALEDIR = -DLOCALEDIR=\"@localedir@\" |
c0ec9cc7 FM |
23 | CFLAGS = @CFLAGS@ |
24 | CPPFLAGS = @CPPFLAGS@ | |
25 | LDFLAGS = @LDFLAGS@ | |
308a21d4 | 26 | DEFS = $(IBINDIR) $(ISYSCONFDIR) $(IFONTDIR) $(IIMAGEDIR) $(ISARGPHPDIR) $(ILOCALEDIR) @DEFS@ |
b966a3a2 | 27 | LIBS = @LIBS@ -lm |
c0ec9cc7 FM |
28 | SRCDIR = . |
29 | VPATH = . | |
30 | INSTALL = cp | |
72920109 FM |
31 | XSL_MAN_STYLESHEET=@XSL_MAN_STYLESHEET@ |
32 | XSL_HTML_STYLESHEET=@XSL_HTML_STYLESHEET@ | |
25697a35 GS |
33 | |
34 | INSTALL_PROGRAM = $(INSTALL) | |
35 | ||
36 | SRCS = util.c log.c report.c topuser.c email.c sort.c html.c \ | |
51b166d4 | 37 | index.c getconf.c usage.c decomp.c ip2name.c ip2name_dns.c \ |
25697a35 GS |
38 | useragent.c exclude.c convlog.c totday.c repday.c datafile.c\ |
39 | indexonly.c splitlog.c lastlog.c topsites.c siteuser.c css.c \ | |
0326d73b | 40 | smartfilter.c denied.c authfail.c charset.c dichotomic.c \ |
1e312c82 | 41 | redirector.c auth.c download.c grepday.c ip2name_exec.c \ |
f2ec8c75 | 42 | dansguardian_log.c dansguardian_report.c realtime.c btree_cache.c \ |
22715352 | 43 | usertab.c userinfo.c longline.c url.c |
f2ec8c75 | 44 | |
8028a059 | 45 | OBJS = $(SRCS:.c=.o) |
25697a35 | 46 | |
3becf85c FM |
47 | DISTFILES = $(SRCS) ABOUT-NLS |
48 | ||
49 | SUBDIRS = po | |
84a17075 | 50 | .PHONY: all install clean uninstall mostlyclean distclean update-po doc $(SUBDIRS) |
25697a35 | 51 | |
257cd925 | 52 | all: sarg |
25697a35 GS |
53 | |
54 | .c.o: | |
c0ec9cc7 | 55 | $(CC) -c -I. $(CPPFLAGS) $(DEFS) $(CFLAGS) $< |
25697a35 | 56 | |
d6dabf47 FM |
57 | *.o: include/conf.h include/info.h include/defs.h |
58 | ||
25697a35 | 59 | sarg: $(OBJS) |
1b42c442 | 60 | $(CC) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) $(LIBCRYPT) |
25697a35 | 61 | |
3becf85c FM |
62 | $(SUBDIRS): |
63 | $(MAKE) -C $@ | |
64 | ||
84a17075 FM |
65 | doc: sarg.1 sarg_manpage.html |
66 | ||
67 | sarg.1: sarg_manpage.xml | |
68 | echo "Making manual page" | |
69 | xmllint --nonet --valid --noout $< | |
72920109 | 70 | xsltproc --stringparam man.output.encoding latin1 --nonet "$(XSL_MAN_STYLESHEET)" $< |
84a17075 FM |
71 | # docbook2man.pl $< |
72 | ||
73 | sarg_manpage.html: sarg_manpage.xml | |
74 | echo "Making html manual page" | |
75 | xmllint --nonet --valid --noout $< | |
72920109 | 76 | xsltproc --stringparam use.id.as.filename 1 --stringparam root.filename sarg_manpage --nonet "$(XSL_HTML_STYLESHEET)" $< |
84a17075 | 77 | |
308a21d4 | 78 | install: all install-po |
4b7d4cb0 FM |
79 | -@if test ! -d $(DESTDIR)$(bindir); then \ |
80 | echo "creating $(DESTDIR)$(bindir)"; \ | |
81 | mkdir -p $(DESTDIR)$(bindir); \ | |
25697a35 | 82 | fi |
4b7d4cb0 FM |
83 | -@if test ! -d $(DESTDIR)$(man1dir); then \ |
84 | echo "creating $(DESTDIR)$(man1dir)"; \ | |
85 | mkdir -p $(DESTDIR)$(man1dir); \ | |
25697a35 | 86 | fi |
4b7d4cb0 FM |
87 | -@if test ! -d $(DESTDIR)$(sysconfdir); then \ |
88 | echo "creating $(DESTDIR)$(sysconfdir)"; \ | |
89 | mkdir -p $(DESTDIR)$(sysconfdir); \ | |
25697a35 | 90 | fi |
f251e023 FM |
91 | -@if test ! -d $(DESTDIR)$(IMAGEDIR); then \ |
92 | echo "Creating $(DESTDIR)$(IMAGEDIR)"; \ | |
93 | mkdir -p $(DESTDIR)$(IMAGEDIR); \ | |
25697a35 | 94 | fi |
4b7d4cb0 FM |
95 | $(INSTALL_PROGRAM) sarg $(DESTDIR)$(bindir)/sarg |
96 | chmod 755 $(DESTDIR)$(bindir)/sarg | |
97 | $(INSTALL_PROGRAM) sarg.1 $(DESTDIR)$(man1dir)/sarg.1 | |
98 | chmod 755 $(DESTDIR)$(man1dir)/sarg.1 | |
99 | @if test ! -f $(DESTDIR)$(sysconfdir)/sarg.conf; then \ | |
100 | echo "cp $(DESTDIR)$(sysconfdir)/sarg.conf"; \ | |
101 | cp sarg.conf $(DESTDIR)$(sysconfdir)/sarg.conf; \ | |
25697a35 | 102 | else \ |
4b7d4cb0 | 103 | cp sarg.conf $(DESTDIR)$(sysconfdir)/sarg.conf.default; \ |
25697a35 | 104 | fi |
4b7d4cb0 FM |
105 | cp ./exclude_codes $(DESTDIR)$(sysconfdir); |
106 | cp ./user_limit_block $(DESTDIR)$(sysconfdir); | |
f251e023 | 107 | cp -r ./images/* $(DESTDIR)$(IMAGEDIR); |
3becf85c FM |
108 | -@if test -n "$(FONTDIR)" ; then \ |
109 | if test ! -d "$(DESTDIR)$(FONTDIR)" ; then \ | |
110 | echo "Creating $(DESTDIR)$(FONTDIR)"; \ | |
111 | mkdir -p "$(DESTDIR)$(FONTDIR)"; \ | |
112 | fi; \ | |
113 | cp -r ./fonts/* "$(DESTDIR)$(FONTDIR)"; \ | |
114 | fi | |
4b7d4cb0 | 115 | cp -r ./css.tpl $(DESTDIR)$(sysconfdir); |
7bbc1de4 | 116 | -@if test -n "$(SARGPHPDIR)" -a -d "$(DESTDIR)$(SARGPHPDIR)"; then \ |
3becf85c | 117 | cp -r ./sarg-php $(DESTDIR)$(SARGPHPDIR); \ |
25697a35 GS |
118 | fi |
119 | ||
308a21d4 | 120 | uninstall: uninstall-po |
4b7d4cb0 FM |
121 | rm -f $(DESTDIR)$(bindir)/sarg |
122 | rm -f $(DESTDIR)$(man1dir)/sarg.1 | |
25697a35 GS |
123 | |
124 | TAGS: $(SRCS) | |
125 | etags $(SRCS) | |
126 | ||
308a21d4 | 127 | clean: clean-po |
25697a35 GS |
128 | rm -f sarg *.o core |
129 | ||
130 | mostlyclean: clean | |
131 | ||
132 | distclean: clean | |
133 | rm -f Makefile config.status config.cache config.log | |
134 | ||
135 | realclean: distclean | |
136 | rm -f TAGS | |
137 | ||
308a21d4 | 138 | install-po: |
4e9c12ce | 139 | cd po ; $(MAKE) install |
308a21d4 FM |
140 | |
141 | uninstall-po: | |
4e9c12ce | 142 | cd po ; $(MAKE) uninstall |
308a21d4 FM |
143 | |
144 | clean-po: | |
4e9c12ce | 145 | cd po ; $(MAKE) clean |
308a21d4 | 146 | |
f2ec8c75 | 147 | update-po: |
4e9c12ce | 148 | cd po ; $(MAKE) update-po |
cea51ad6 FM |
149 | |
150 | po-from-tp: | |
151 | @echo "Fetching latest po files from translationprojetc.org" | |
152 | rsync -Lrtvz -u translationproject.org::tp/latest/sarg/ po |