-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.in
133 lines (113 loc) · 3.76 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
SHELL=/bin/sh
.SUFFIXES:
.SUFFIXES: .c .o .pl .pm .pod .html .man
PERL = @PERL@
CC = @CC@
CFLAGS = @CFLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
RM = rm -f
MKINSTALLDIRS = mkdir -p
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = $(exec_prefix)/bin
infodir = $(prefix)/info
logdir = @sg_logdir@
configfile = @sg_config@
dbhomedir = @sg_dbhome@
SQUIDUSER = @squiduser@
SUBDIRS = src test samples contrib
INSTALL_TARGETS = install-conf install-build
all::
@echo making $@ in `basename \`pwd\``
all update clean distclean realclean::
@for subdir in $(SUBDIRS); do \
(cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
done
test::
@echo making $@ in `basename \`pwd\``
(cd $@ && $(MAKE) $(MAKEDEFS) $@)
#
# Dependencies for installing
#
install: install-build install-conf
install-conf:
@echo Installing configuration file ;
@if [ ! -d $(DESTDIR)$(prefix)/squidGuard ]; then \
$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/squidGuard ; \
echo Created directory $(DESTDIR)$(prefix)/squidGuard ; \
chown -R $(SQUIDUSER) $(DESTDIR)$(prefix)/squidGuard || exit 1 ; \
echo Assigned $(prefix)/squidGuard to user $(SQUIDUSER) ; \
fi ;
@if [ ! -d $(DESTDIR)$(dbhomedir) ]; then \
$(MKINSTALLDIRS) $(DESTDIR)$(dbhomedir) ; \
echo Created directory $(DESTDIR)$(dbhomedir) ; \
chown -R $(SQUIDUSER) $(DESTDIR)$(dbhomedir) || exit 1 ; \
echo Assigned $(dbhomedir) to user $(SQUIDUSER) ; \
fi ;
@if [ ! -d $(DESTDIR)$(logdir) ]; then \
$(MKINSTALLDIRS) $(DESTDIR)$(logdir) ; \
echo Created directory $(DESTDIR)$(logdir) ; \
chown -R $(SQUIDUSER) $(DESTDIR)$(logdir) || exit 1 ; \
echo Assigned $(logdir) to user $(SQUIDUSER) ; \
fi ;
@if [ ! -d `dirname $(DESTDIR)$(configfile)` ]; then \
umask 022 ; \
mkdir -p `dirname $(DESTDIR)$(configfile)` ; \
echo No configuration directory found. Created `dirname $(configfile)`. ; \
fi;
@if test ! -f $(DESTDIR)$(configfile); then \
cp samples/sample.conf $(DESTDIR)$(configfile) || exit 1 ; \
echo Copied sample squidGuard.conf ; \
chmod 644 $(DESTDIR)$(configfile) || exit 1 ; \
echo $(configfile) is now readable ; \
echo The initial configuration is complete. ; \
else \
echo Configuration file found. Not changing anything ; \
fi;
@echo ;
@echo Congratulation. SquidGuard is sucessfully installed. ;
@echo ;
install-build:
@echo Installing squidGuard
@if [ ! -d $(DESTDIR)$(bindir) ]; then \
$(MKINSTALLDIRS) $(DESTDIR)$(bindir) ; \
fi ; \
cp src/squidGuard $(DESTDIR)$(bindir) || exit 1 ; \
echo Done. ;
clean::
@echo making $@ in `basename \`pwd\``
$(RM) *~ *.bak core *.log *.error
realclean::
@echo making $@ in `basename \`pwd\``
$(RM) *~ *.bak core
$(RM) TAGS *.orig
distclean::
@echo making $@ in `basename \`pwd\``
$(RM) *~ *.bak core
$(RM) TAGS *.orig
$(RM) Makefile config.h config.status config.log config.cache
version:: src/version.h
@echo making $@ in `basename \`pwd\``
cp -p src/version.h src/version.h~
sed 's/^#define VERSION .*/#define VERSION "@VERSION@"/' <src/version.h~ >src/version.h \
|| mv -f src/version.h~ src/version.h
-cmp -s src/version.h~ src/version.h && mv -f src/version.h~ src/version.h || :
$(RM) src/version.h~
update:: announce readme changelog
@echo making $@ in `basename \`pwd\``
announce:: ANNOUNCE
@echo making $@ in `basename \`pwd\``
test -d @FTPDIR@ && ( cmp -s ANNOUNCE @FTPDIR@/ANNOUNCE || \
$(INSTALL_DATA) ANNOUNCE @FTPDIR@/ANNOUNCE )
readme:: README
@echo making $@ in `basename \`pwd\``
test -d @FTPDIR@ && ( cmp -s README @FTPDIR@/README || \
$(INSTALL_DATA) README @FTPDIR@/README )
changelog:: CHANGELOG
@echo making $@ in `basename \`pwd\``
test -d @FTPDIR@ && ( cmp -s CHANGELOG @FTPDIR@/CHANGELOG || \
$(INSTALL_DATA) CHANGELOG @FTPDIR@/CHANGELOG )