]>
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@ |
38b11656 | 27 | LIBS = @LIBS@ @LIBINTL@ -lm |
c0ec9cc7 FM |
28 | SRCDIR = . |
29 | VPATH = . | |
30 | INSTALL = cp | |
a640023b FM |
31 | XSL_MAN_STYLESHEET=@XSL_MAN_STYLESHEET@ |
32 | XSL_HTML_STYLESHEET=@XSL_HTML_STYLESHEET@ | |
142d788e | 33 | EXEEXT = @EXEEXT@ |
25697a35 GS |
34 | |
35 | INSTALL_PROGRAM = $(INSTALL) | |
36 | ||
37 | SRCS = util.c log.c report.c topuser.c email.c sort.c html.c \ | |
c4f0ea8f FM |
38 | index.c getconf.c usage.c decomp.c ip2name.c ip2name_dns.c \ |
39 | useragent.c exclude.c convlog.c totday.c repday.c datafile.c\ | |
40 | indexonly.c splitlog.c lastlog.c topsites.c siteuser.c css.c \ | |
26810f86 | 41 | smartfilter.c denied.c authfail.c dichotomic.c \ |
c4f0ea8f FM |
42 | redirector.c auth.c download.c grepday.c ip2name_exec.c \ |
43 | dansguardian_log.c dansguardian_report.c realtime.c btree_cache.c \ | |
44 | usertab.c userinfo.c longline.c url.c fnmatch.c stringbuffer.c \ | |
45 | filelist.c readlog.c alias.c \ | |
46 | readlog_squid.c readlog_sarg.c readlog_extlog.c readlog_common.c | |
f2ec8c75 | 47 | |
e62783ed FM |
48 | all: sarg |
49 | ||
4395f9c9 FM |
50 | *.o: include/conf.h include/info.h include/defs.h |
51 | ||
c4f0ea8f | 52 | alias.o: include/alias.h include/stringbuffer.h |
4395f9c9 FM |
53 | authfail.o: include/readlog.h |
54 | denied.o: include/readlog.h | |
55 | download.o: include/readlog.h | |
56 | filelist.o: include/stringbuffer.h | |
57 | log.o: include/readlog.h | |
58 | readlog.o: include/readlog.h | |
59 | readlog_common.o: include/readlog.h | |
60 | readlog_extlog.o: include/readlog.h | |
61 | readlog_sarg.o: include/readlog.h | |
62 | readlog_squid.o: include/readlog.h | |
63 | stringbuffer.o: include/stringbuffer.h | |
c4f0ea8f | 64 | userinfo.o: include/stringbuffer.h include/alias.h |
4395f9c9 | 65 | |
8028a059 | 66 | OBJS = $(SRCS:.c=.o) |
25697a35 | 67 | |
3becf85c FM |
68 | DISTFILES = $(SRCS) ABOUT-NLS |
69 | ||
70 | SUBDIRS = po | |
84a17075 | 71 | .PHONY: all install clean uninstall mostlyclean distclean update-po doc $(SUBDIRS) |
25697a35 | 72 | |
25697a35 | 73 | .c.o: |
c0ec9cc7 | 74 | $(CC) -c -I. $(CPPFLAGS) $(DEFS) $(CFLAGS) $< |
25697a35 GS |
75 | |
76 | sarg: $(OBJS) | |
1b42c442 | 77 | $(CC) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) $(LIBCRYPT) |
25697a35 | 78 | |
3becf85c FM |
79 | $(SUBDIRS): |
80 | $(MAKE) -C $@ | |
81 | ||
84a17075 FM |
82 | doc: sarg.1 sarg_manpage.html |
83 | ||
84 | sarg.1: sarg_manpage.xml | |
85 | echo "Making manual page" | |
86 | xmllint --nonet --valid --noout $< | |
a640023b | 87 | xsltproc --stringparam man.output.encoding latin1 --nonet "$(XSL_MAN_STYLESHEET)" $< |
84a17075 FM |
88 | # docbook2man.pl $< |
89 | ||
90 | sarg_manpage.html: sarg_manpage.xml | |
91 | echo "Making html manual page" | |
92 | xmllint --nonet --valid --noout $< | |
a640023b | 93 | xsltproc --stringparam use.id.as.filename 1 --stringparam root.filename sarg_manpage --nonet "$(XSL_HTML_STYLESHEET)" $< |
84a17075 | 94 | |
308a21d4 | 95 | install: all install-po |
4b7d4cb0 FM |
96 | -@if test ! -d $(DESTDIR)$(bindir); then \ |
97 | echo "creating $(DESTDIR)$(bindir)"; \ | |
98 | mkdir -p $(DESTDIR)$(bindir); \ | |
25697a35 | 99 | fi |
4b7d4cb0 FM |
100 | -@if test ! -d $(DESTDIR)$(man1dir); then \ |
101 | echo "creating $(DESTDIR)$(man1dir)"; \ | |
102 | mkdir -p $(DESTDIR)$(man1dir); \ | |
25697a35 | 103 | fi |
4b7d4cb0 FM |
104 | -@if test ! -d $(DESTDIR)$(sysconfdir); then \ |
105 | echo "creating $(DESTDIR)$(sysconfdir)"; \ | |
106 | mkdir -p $(DESTDIR)$(sysconfdir); \ | |
25697a35 | 107 | fi |
f251e023 FM |
108 | -@if test ! -d $(DESTDIR)$(IMAGEDIR); then \ |
109 | echo "Creating $(DESTDIR)$(IMAGEDIR)"; \ | |
110 | mkdir -p $(DESTDIR)$(IMAGEDIR); \ | |
25697a35 | 111 | fi |
142d788e FM |
112 | $(INSTALL_PROGRAM) sarg$(EXEEXT) $(DESTDIR)$(bindir)/sarg$(EXEEXT); |
113 | chmod 755 $(DESTDIR)$(bindir)/sarg$(EXEEXT); | |
4b7d4cb0 FM |
114 | $(INSTALL_PROGRAM) sarg.1 $(DESTDIR)$(man1dir)/sarg.1 |
115 | chmod 755 $(DESTDIR)$(man1dir)/sarg.1 | |
116 | @if test ! -f $(DESTDIR)$(sysconfdir)/sarg.conf; then \ | |
117 | echo "cp $(DESTDIR)$(sysconfdir)/sarg.conf"; \ | |
118 | cp sarg.conf $(DESTDIR)$(sysconfdir)/sarg.conf; \ | |
25697a35 | 119 | else \ |
4b7d4cb0 | 120 | cp sarg.conf $(DESTDIR)$(sysconfdir)/sarg.conf.default; \ |
25697a35 | 121 | fi |
4b7d4cb0 FM |
122 | cp ./exclude_codes $(DESTDIR)$(sysconfdir); |
123 | cp ./user_limit_block $(DESTDIR)$(sysconfdir); | |
f251e023 | 124 | cp -r ./images/* $(DESTDIR)$(IMAGEDIR); |
3becf85c FM |
125 | -@if test -n "$(FONTDIR)" ; then \ |
126 | if test ! -d "$(DESTDIR)$(FONTDIR)" ; then \ | |
127 | echo "Creating $(DESTDIR)$(FONTDIR)"; \ | |
128 | mkdir -p "$(DESTDIR)$(FONTDIR)"; \ | |
129 | fi; \ | |
130 | cp -r ./fonts/* "$(DESTDIR)$(FONTDIR)"; \ | |
131 | fi | |
4b7d4cb0 | 132 | cp -r ./css.tpl $(DESTDIR)$(sysconfdir); |
7bbc1de4 | 133 | -@if test -n "$(SARGPHPDIR)" -a -d "$(DESTDIR)$(SARGPHPDIR)"; then \ |
3becf85c | 134 | cp -r ./sarg-php $(DESTDIR)$(SARGPHPDIR); \ |
25697a35 GS |
135 | fi |
136 | ||
308a21d4 | 137 | uninstall: uninstall-po |
4b7d4cb0 FM |
138 | rm -f $(DESTDIR)$(bindir)/sarg |
139 | rm -f $(DESTDIR)$(man1dir)/sarg.1 | |
25697a35 GS |
140 | |
141 | TAGS: $(SRCS) | |
142 | etags $(SRCS) | |
143 | ||
308a21d4 | 144 | clean: clean-po |
25697a35 GS |
145 | rm -f sarg *.o core |
146 | ||
147 | mostlyclean: clean | |
148 | ||
149 | distclean: clean | |
150 | rm -f Makefile config.status config.cache config.log | |
151 | ||
152 | realclean: distclean | |
153 | rm -f TAGS | |
154 | ||
308a21d4 FM |
155 | install-po: |
156 | $(MAKE) -C po install | |
157 | ||
158 | uninstall-po: | |
159 | $(MAKE) -C po uninstall | |
160 | ||
161 | clean-po: | |
162 | $(MAKE) -C po clean | |
163 | ||
f2ec8c75 FM |
164 | update-po: |
165 | $(MAKE) -C po update-po | |
cea51ad6 FM |
166 | |
167 | po-from-tp: | |
168 | @echo "Fetching latest po files from translationprojetc.org" | |
169 | rsync -Lrtvz -u translationproject.org::tp/latest/sarg/ po |