*** empty log message ***
[privoxy.git] / Makefile.in
1 # Note:  Makefile is built automatically from Makefile.in
2 #
3 # $Id: Makefile.in,v 1.2 2001/05/13 22:04:51 administrator Exp $
4 #
5 # Written by and Copyright (C) 2001 the SourceForge
6 # IJBSWA team.  http://ijbswa.sourceforge.net
7 #
8 # Based on the Internet Junkbuster originally written
9 # by and Copyright (C) 1997 Anonymous Coders and 
10 # Junkbusters Corporation.  http://www.junkbusters.com
11 #
12 # This program is free software; you can redistribute it 
13 # and/or modify it under the terms of the GNU General
14 # Public License as published by the Free Software
15 # Foundation; either version 2 of the License, or (at
16 # your option) any later version.
17 #
18 # This program is distributed in the hope that it will
19 # be useful, but WITHOUT ANY WARRANTY; without even the
20 # implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE.  See the GNU General Public
22 # License for more details.
23 #
24 # The GNU General Public License should be included with
25 # this file.  If not, you can view it at
26 # http://www.gnu.org/copyleft/gpl.html
27 # or write to the Free Software Foundation, Inc., 59
28 # Temple Place - Suite 330, Boston, MA  02111-1307, USA.
29 #
30 # $Log: Makefile.in,v $
31 #
32
33
34 # define version (will be wired into the rpm.)
35 VERSION_MAJOR = @VERSION_MAJOR@
36 VERSION_MINOR = @VERSION_MINOR@
37 VERSION_POINT = @VERSION_POINT@
38 VERSION       = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_POINT)
39 RPM_VERSION   = $(VERSION)
40
41 # The version is currently specified in config.h, which is
42 # written by "configure".
43 #
44 #VERSION_CFLAGS = -DVERSION_MAJOR=$(VERSION_MAJOR) \
45 #                 -DVERSION_MINOR=$(VERSION_MINOR) \
46 #                 -DVERSION_POINT=$(VERSION_POINT) \
47 #                 -DVERSION="$(VERSION)"
48
49 # Directories for "make install"
50 DEST        = /etc/junkbuster
51 SBIN_DEST   = @sbindir@
52 MAN_DEST    = @mandir@
53
54 # The flag "-mno-win32" can be used by Cygwin to emulate a un?x type install.
55 # The flag "-mwindows -mno-cygwin" will cause Cygwin to use MingW32 for Win32 install.
56 CYGWIN_FLAGS = @CYGWIN_FLAGS@
57
58 # Need to define this in order to link PCRE statically under Win32
59 # Also define under UNIX to use system PCRE headers.
60 PCRE_WIN_FLAGS = @STATIC_PCRE_ONLY@-DSTATIC
61
62 # Either/Or of these next two lines
63 #DEBUG_CFLAGS = -g
64 DEBUG_CFLAGS  = -O3
65
66 # Solaris needs a special define:
67 # FIXME: This is always commented out
68 SOLARIS_FLAGS = @SOLARIS_ONLY@-D__EXTENSIONS__=1
69
70 #  -DSTDC_HEADERS Now in config.h
71 # Do we need  -DHAVE_STRING  ???
72 CFLAGS = @CFLAGS@ @CPPFLAGS@ \
73          -D__MT__=1 -D__STDC__=1 $(SOLARIS_FLAGS) -DHAVE_STRING $(DEBUG_CFLAGS) \
74          -Ipcre $(CYGWIN_FLAGS) $(PCRE_WIN_FLAGS)
75
76 PROGRAM = junkbuster@EXEEXT@
77 CC      = gcc
78 ECHO    = echo
79 GZIP    = gzip
80 INSTALL = cp -f
81 LD      = gcc
82 OBJEXT  = @OBJEXT@
83 RM      = rm -f
84 STRIP   = strip
85
86 C_SRC  = encode.c errlog.c filters.c gateway.c jbsockets.c jcc.c \
87          killpopup.c loadcfg.c loaders.c miscutil.c parsers.c \
88          showargs.c ssplit.c
89          
90 C_OBJS = $(C_SRC:.c=.$(OBJEXT))
91 C_HDRS = $(C_SRC:.c=.h) project.h
92
93 W32_SRC   = @WIN_ONLY@w32log.c w32rulesdlg.c w32taskbar.c win32.c
94 W32_FILES = @WIN_ONLY@w32.res
95 W32_OBJS  = @WIN_ONLY@$(W32_SRC:.c=.$(OBJEXT)) $(W32_FILES)
96 W32_HDRS  = @WIN_ONLY@w32log.h w32res.h w32rulesdlg.h w32taskbar.h
97 W32_LIB   = @WIN_ONLY@-lwsock32 -lcomctl32
98 W32_INIS  = @WIN_ONLY@junkbstr.txt saclfile.txt sblock.txt scookie.txt  \
99             @WIN_ONLY@sforward.txt simage.txt spopup.txt strust.txt sregexp.txt
100
101 PCRS_SRC     = @PCRS_ONLY@pcrs.c
102 PCRS_OBJS    = $(PCRS_SRC:.c=.$(OBJEXT))
103 PCRS_HDRS    = $(PCRS_SRC:.c=.h)
104
105 PCRE_SRC     = @STATIC_PCRE_ONLY@pcre/get.c pcre/maketables.c pcre/study.c pcre/pcre.c
106 PCRE_OBJS    = @STATIC_PCRE_ONLY@$(PCRE_SRC:.c=.$(OBJEXT))
107 PCRE_HDRS    = @STATIC_PCRE_ONLY@pcre/config.h pcre/chartables.c pcre/internal.h pcre/pcre.h
108 PCRE_LIB     = @LIBRARY_PCRE_ONLY@-lpcre
109
110 # No REGEX:
111 @NO_REGEX_ONLY@REGEX_SRC    =
112 # Without PCRE:
113 @GNU_REGEX_ONLY@REGEX_SRC    = gnu_regex.c
114 # With PCRE:
115 @PCRE_REGEX_ONLY@REGEX_SRC    = @STATIC_PCRE_ONLY@pcre/pcreposix.c
116
117 REGEX_OBJS   = $(REGEX_SRC:.c=.$(OBJEXT))
118 REGEX_HDRS   = $(REGEX_SRC:.c=.h)
119
120 # Dependencies introduced by #include "project.h".
121 PROJECT_H_DEPS = project.h $(REGEX_HDRS) $(PCRS_HDRS) @STATIC_PCRE_ONLY@pcre/pcre.h
122
123 # Only need this on Solaris
124 # FIXME: This is always commented out
125 SOCKET_LIB   = @SOLARIS_ONLY@-lsocket -lnsl
126
127 LIBS         = $(PCRE_LIB) $(W32_LIB) $(SOCKET_LIB)
128
129 SRCS         = $(C_SRC)  $(W32_SRC)  $(PCRS_SRC)  $(PCRE_SRC)  $(REGEX_SRC)
130 OBJS         = $(C_OBJS) $(W32_OBJS) $(PCRS_OBJS) $(PCRE_OBJS) $(REGEX_OBJS)
131 HDRS         = $(C_HDRS) $(W32_HDRS) $(PCRS_HDRS) $(PCRE_OBJS) $(REGEX_HDRS)
132
133
134 # -------------------------------------------------------------------------
135 # Do not change anything below this line
136 # And there should NOT be any targets above this line.
137 # -------------------------------------------------------------------------
138 LDFLAGS = $(DEBUG_CFLAGS) $(CYGWIN_FLAGS)
139
140
141 all: $(PROGRAM)
142
143
144 SUFFIX     = .txt:o
145 .SUFFIXES  : .txt
146
147 %.txt:
148         sed -e 's/$$//' < $< > $@
149
150 inifiles: $(W32_INIS)
151
152 junkbstr.txt: config
153         sed     -e 's!\(/etc/junkbuster\|.\)/blocklist!sblock.txt!' \
154                         -e 's!\(/etc/junkbuster\|.\)/popup!spopup.txt!' \
155                         -e 's!\(/etc/junkbuster\|.\)/cookiefile!scookie.txt!' \
156                         -e 's!\(/etc/junkbuster\|.\)/forward!sforward.txt!' \
157                         -e 's!\(/etc/junkbuster\|.\)/trust!strust.txt!' \
158                         -e 's!\(/etc/junkbuster\|.\)/aclfile!sacl.txt!' \
159                         -e 's!\(/var/log/junkbuster\|.\)/jarfile!jar.log!' \
160                         -e 's!\(/var/log/junkbuster\|.\)/junkbuster\.log!junkbstr.log!' \
161                         -e 's!\(/etc/junkbuster\|.\)/imagelist!simage.txt!' \
162                         -e 's!\(/etc/junkbuster\|.\)/re_filterfile!sregexp.txt!' \
163                         -e 's!$$!!' \
164         < $< > $@
165
166 saclfile.txt: aclfile
167 sblock.txt: blocklist
168 scookie.txt: cookiefile
169 sforward.txt: forward
170 simage.txt: imagelist
171 spopup.txt: popup
172 strust.txt: trust
173 sregexp.txt: re_filterfile
174
175
176 # -------------------------------------------------------------------------
177 #
178 # -------------------------------------------------------------------------
179 rpm-dist:
180         @make clean
181 # verify that i'm root needs to be done
182         cd .. && tar --exclude "ijb/CVS" -cvzf ijb.tar.gz ijb/
183 # verify all version strings, FLAGS, etc. in the spec file
184         cat ../../SPECS/junkbuster.spec | sed 's/^Version:.*/Version: $(RPM_VERSION)/g' | sed 's/^Release:.*/Release: $(VERSION_POINT)/g' > /tmp/abc && cp -f /tmp/abc ../../SPECS/junkbuster.spec
185         cd ../../ && rpm -ba SPECS/junkbuster.spec
186         chmod -R a+r ../../RPMS
187         chmod -R a+r ../../SRPMS
188
189 # -------------------------------------------------------------------------
190 #
191 # -------------------------------------------------------------------------
192 win-dist:
193         $(ECHO) Not implemented.
194
195 # -------------------------------------------------------------------------
196 #
197 # -------------------------------------------------------------------------
198 tarball-dist:
199         @make clean
200         make $(PROGRAM) 
201 #       remove all objects and create the tarball with the binary
202         cd .. && $(RM) ijb/a.out ijb/core ijb/*.$(OBJEXT) && tar --exclude "ijb/CVS" -cvzf ../ijb-distribution-$(VERSION).tar.gz ijb/
203         chmod a+r ../../ijb-distribution-$(VERSION).tar.gz
204         @$(ECHO) Tarball with binary created.
205
206 # -------------------------------------------------------------------------
207 #
208 # -------------------------------------------------------------------------
209
210 encode.@OBJEXT@:    encode.c    encode.h    config.h
211 errlog.@OBJEXT@:    errlog.c    errlog.h    config.h $(PROJECT_H_DEPS) @WIN_ONLY@w32log.h
212 filters.@OBJEXT@:   filters.c   filters.h   config.h $(PROJECT_H_DEPS) errlog.h encode.h gateway.h jbsockets.h jcc.h loadcfg.h parsers.h showargs.h ssplit.h @WIN_ONLY@win32.h 
213 gateway.@OBJEXT@:   gateway.c   gateway.h   config.h $(PROJECT_H_DEPS) errlog.h jbsockets.h jcc.h loadcfg.h
214 jbsockets.@OBJEXT@: jbsockets.c jbsockets.h config.h $(PROJECT_H_DEPS) filters.h
215 jcc.@OBJEXT@:       jcc.c       jcc.h       config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h killpopup.h loadcfg.h loaders.h miscutil.h parsers.h showargs.h @WIN_ONLY@w32log.h win32.h
216 killpopup.@OBJEXT@: killpopup.c killpopup.h config.h $(PROJECT_H_DEPS) jcc.h loadcfg.h
217 loadcfg.@OBJEXT@:   loadcfg.c   loadcfg.h   config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h jcc.h killpopup.h loaders.h miscutil.h parsers.h showargs.h @WIN_ONLY@w32log.h win32.h
218 loaders.@OBJEXT@:   loaders.c   loaders.h   config.h $(PROJECT_H_DEPS) errlog.h encode.h filters.h gateway.h jcc.h loadcfg.h miscutil.h parsers.h ssplit.h
219 miscutil.@OBJEXT@:  miscutil.c  miscutil.h  config.h
220 parsers.@OBJEXT@:   parsers.c   parsers.h   config.h $(PROJECT_H_DEPS) errlog.h encode.h filters.h jbsockets.h jcc.h loadcfg.h loaders.h miscutil.h showargs.h ssplit.h
221 showargs.@OBJEXT@:  showargs.c  showargs.h  config.h $(PROJECT_H_DEPS) errlog.h encode.h gateway.h jcc.h loadcfg.h miscutil.h parsers.h
222 ssplit.@OBJEXT@:    ssplit.c    ssplit.h    config.h miscutil.h
223
224 # GNU regex
225 gnu_regex.@OBJEXT@: gnu_regex.c gnu_regex.h config.h
226
227 # PCRS
228 pcrs.@OBJEXT@: pcrs.c pcre/pcre.h pcrs.h
229
230 # PCRE
231 pcre/get.@OBJEXT@:        pcre/get.c        pcre/config.h pcre/internal.h pcre/pcre.h
232 pcre/maketables.@OBJEXT@: pcre/maketables.c pcre/config.h pcre/internal.h pcre/pcre.h
233 pcre/pcre.@OBJEXT@:       pcre/pcre.c       pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c 
234 pcre/pcreposix.@OBJEXT@:  pcre/pcreposix.c  pcre/config.h pcre/internal.h pcre/pcre.h pcre/pcreposix.h
235 pcre/study.@OBJEXT@:      pcre/study.c      pcre/config.h pcre/internal.h pcre/pcre.h
236
237 # An auxiliary program makes the PCRE default character table source
238
239 pcre/chartables.c:   pcre/dftables
240                 pcre/dftables >pcre/chartables.c
241
242 pcre/dftables:       pcre/dftables.c pcre/maketables.c pcre/pcre.h pcre/internal.h pcre/config.h
243                 $(CC) -o pcre/dftables $(CFLAGS) pcre/dftables.c
244
245 # Win32
246 w32log.@OBJEXT@: w32log.c errlog.h config.h jcc.h loadcfg.h miscutil.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h w32rulesdlg.h w32taskbar.h win32.h
247 w32rulesdlg.@OBJEXT@: w32rulesdlg.c config.h w32rulesdlg.h win32.h
248 w32taskbar.@OBJEXT@: w32taskbar.c config.h w32log.h w32taskbar.h
249 win32.@OBJEXT@: win32.c config.h jcc.h loadcfg.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h win32.h
250
251 w32.res: w32.rc w32res.h icons/denyrule.ico icons/ico00001.ico icons/ico00002.ico icons/ico00003.ico icons/ico00004.ico icons/ico00005.ico icons/ico00006.ico icons/ico00007.ico icons/ico00008.ico icons/icon1.ico icons/idle.ico icons/junkbust.ico config.h
252         windres -D__MINGW32__=0.2 -O coff -i $< -o $@
253
254
255 $(PROGRAM): $(OBJS) $(W32_FILES)
256         $(LD) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
257
258 clean:
259         $(RM) a.out core $(OBJS) $(W32_FILES) $(W32_INIS)
260
261 clobber: clean
262         $(RM) $(PROGRAM) *.pdb *.lib *.exp TAGS junkbuster.log
263
264 tags: $(SRCS) $(HDRS)
265         etags $(SRCS) $(HDRS)
266
267 install: all
268         $(STRIP) $(PROGRAM)
269         $(INSTALL) $(PROGRAM) $(SBIN_DEST)
270         $(INSTALL) README README.TOO README.WIN README.re_filter README.cygwin $(DEST)
271         $(INSTALL) aclfile blocklist config cookiefile forward imagelist \
272                 popup re_filterfile trust $(DEST)
273         # FIXME: On SuSE, these are not found.  Where do they go?
274         $(ECHO) junkbuster.logrotate junkbuster.monthly junkbuster.weekly
275         $(GZIP) -c junkbuster.1 > $(MAN_DEST)/junkbuster.1.gz
276         $(INSTALL) junkbuster.init /sbin/init.d/junkbuster
277
278
279 ## Local Variables:
280 ## tab-width: 3
281 ## end: