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