# Note: Makefile is built automatically from Makefile.in
#
-# $Id: Makefile.in,v 1.27 2001/09/13 13:11:37 steudten Exp $
+# $Id: Makefile.in,v 1.38 2001/11/05 21:35:23 steudten Exp $
#
# Written by and Copyright (C) 2001 the SourceForge
# IJBSWA team. http://ijbswa.sourceforge.net
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# $Log: Makefile.in,v $
+# Revision 1.38 2001/11/05 21:35:23 steudten
+# Complete rewrite for the 'redhat-dist' target.
+# Checks for writeable RPM build directories for calling user.
+# So you must not be root, just set the modes to 1777 to
+# build a RH package.
+# Fix the upload-target to be arch independant.
+# Add target for 'solaris-dist' - coming soon.
+#
+# Revision 1.37 2001/11/01 00:52:04 hal9
+# Redhat-upload stuff per Stefan.
+#
+# Revision 1.36 2001/10/31 19:26:13 swa
+# automate process of uploading new releases
+# to sf.
+#
+# Revision 1.35 2001/10/15 22:14:59 joergs
+# Removed -O2 and -Wall from AmigaOS-only CFLAGS since they are now in
+# the general CFLAGS already.
+#
+# Revision 1.34 2001/10/15 18:28:06 steudten
+# remove config.cache for target clobber.
+# Cleanup make dist for RH and S.u.S.E.
+#
+# Revision 1.33 2001/10/10 12:43:33 oes
+# Added ugly hack to make install target work at least for some setups.
+#
+# Revision 1.32 2001/10/09 22:38:19 jongfoster
+# Correcting actionsfile filename for Win32 INI build
+#
+# Revision 1.31 2001/09/23 10:13:48 swa
+# upload process established. run make webserver and
+# the documentation is moved to the webserver. documents
+# are now linked correctly.
+#
+# Revision 1.30 2001/09/19 17:55:49 oes
+# Fixed CFLAGS
+#
+# Revision 1.29 2001/09/16 17:34:27 jongfoster
+# Removing showargs.[ch], adding cgi(simple|edit).[ch]
+# Replacing $(OBJEXT) with @OBJEXT@ - this seems to be a common source
+# of build problems.
+#
+# Revision 1.28 2001/09/13 15:19:08 swa
+# we want text files as well.
+#
# Revision 1.27 2001/09/13 13:11:37 steudten
#
# Replace DEBUG_CFLAGS with OTHER_CFLAGS
# Directories for "make install"
#############################################################################
-DEST = /etc/junkbuster
+DEST = @sysconfdir@/junkbuster
SBIN_DEST = @sbindir@
MAN_DEST = @mandir@
GZIP_PROG = gzip
INSTALL = cp -f
LD = @CC@
-OBJEXT = @OBJEXT@
RM = rm -f
STRIP_PROG = strip
+SED = sed
+CAT = cat
+RPM = rpm
+MV = mv
+TAR = tar
+MAKE = make
+
+#############################################################################
+# Setup for make distribution rh and suse for now
+#############################################################################
+TAR_ARCH = /tmp/ijbswa-$(RPM_VERSION).tar.gz
+RPM_BASE = /usr/src/redhat
#############################################################################
# Filenames and libraries
#############################################################################
-C_SRC = actions.c encode.c errlog.c filters.c gateway.c jbsockets.c \
- jcc.c killpopup.c list.c loadcfg.c loaders.c miscutil.c \
- parsers.c showargs.c ssplit.c cgi.c deanimate.c
-
-C_OBJS = $(C_SRC:.c=.$(OBJEXT))
+C_SRC = actions.c cgi.c cgiedit.c cgisimple.c deanimate.c encode.c \
+ errlog.c filters.c gateway.c jbsockets.c jcc.c killpopup.c \
+ list.c loadcfg.c loaders.c miscutil.c parsers.c ssplit.c
+
+C_OBJS = $(C_SRC:.c=.@OBJEXT@)
C_HDRS = $(C_SRC:.c=.h) project.h actionlist.h
W32_SRC = @WIN_ONLY@w32log.c w32taskbar.c win32.c
W32_FILES = @WIN_ONLY@w32.res
-W32_OBJS = @WIN_ONLY@$(W32_SRC:.c=.$(OBJEXT)) $(W32_FILES)
+W32_OBJS = @WIN_ONLY@$(W32_SRC:.c=.@OBJEXT@) $(W32_FILES)
W32_HDRS = @WIN_ONLY@w32log.h w32taskbar.h win32.h w32res.h
W32_LIB = @WIN_ONLY@-lwsock32 -lcomctl32
W32_INIS = @WIN_ONLY@junkbstr.txt sactions.txt strust.txt sregexp.txt
PCRS_SRC = @STATIC_PCRS_ONLY@pcrs.c
-PCRS_OBJS = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.$(OBJEXT))
+PCRS_OBJS = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.@OBJEXT@)
PCRS_HDRS = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.h)
PCRE_SRC = @STATIC_PCRE_ONLY@pcre/get.c pcre/maketables.c pcre/study.c pcre/pcre.c
-PCRE_OBJS = @STATIC_PCRE_ONLY@$(PCRE_SRC:.c=.$(OBJEXT))
+PCRE_OBJS = @STATIC_PCRE_ONLY@$(PCRE_SRC:.c=.@OBJEXT@)
PCRE_HDRS = @STATIC_PCRE_ONLY@pcre/config.h pcre/chartables.c pcre/internal.h pcre/pcre.h
# No REGEX (Either because dynamically linked pcreposix, or no regex at all):
# PCRE REGEX:
@PCRE_REGEX_ONLY@@STATIC_PCRE_ONLY@REGEX_SRC = pcre/pcreposix.c
-REGEX_OBJS = $(REGEX_SRC:.c=.$(OBJEXT))
+REGEX_OBJS = $(REGEX_SRC:.c=.@OBJEXT@)
REGEX_HDRS = $(REGEX_SRC:.c=.h)
# Dependencies introduced by #include "project.h".
# Add your flags here
OTHER_CFLAGS =
-CFLAGS = @CFLAGS@ @CPPFLAGS@ $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) \
- @STATIC_PCRE_ONLY@ -Ipcre -Wall
+CFLAGS = @CFLAGS@ @CPPFLAGS@ $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) -Wall \
+ @STATIC_PCRE_ONLY@ -Ipcre
LDFLAGS = $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS)
-e 's!#Win32-only: !!' \
< $< > $@
-sactions.txt: actionslist
+sactions.txt: actionsfile
strust.txt: trust
sregexp.txt: re_filterfile
#############################################################################
-# redhat distribution
+# redhat distribution alpha and x86
#############################################################################
redhat-dist:
- @make clobber
-# verify that i'm root needs to be done
- rm -f ../ijbswa.tar.gz
-# verify all version strings, FLAGS, etc. in the spec file
- cat junkbuster-rh.spec | sed 's/^Version:.*/Version: $(RPM_VERSION)/g' | sed 's/^Release:.*/Release: $(RPM_PACKAGEV)/g' > /tmp/abc && cp -f /tmp/abc junkbuster-rh.spec
- tar --exclude "CVS" --exclude "junkbuster-suse.spec" -cvzf ../ijbswa.tar.gz .
-# verify all files in their correct location needs to be done
- cd .. && rpm -ta ijbswa.tar.gz
+ @for dir in RPMS SRPMS BUILD SOURCES SPECS; do \
+ if [ ! -w $(RPM_BASE)/$$dir ]; then \
+ $(ECHO) "$(RPM_BASE)/$$dir is not writable for you. Maybe try as root."; \
+ exit; \
+ fi; \
+ done ; \
+ $(MAKE) clobber; \
+ [ -f $(TAR_ARCH) ] && $(RM) $(TAR_ARCH); \
+ $(CAT) junkbuster-rh.spec | \
+ $(SED) 's/^Version:.*/Version: $(RPM_VERSION)/g;s/^Release:.*/Release: $(RPM_PACKAGEV)/g' > abc && \
+ $(MV) -f abc junkbuster-rh.spec; \
+ $(TAR) --exclude "CVS" --exclude "junkbuster-suse.spec" -cvzf $(TAR_ARCH) . ; \
+ $(RPM) --clean -ta $(TAR_ARCH); \
+ [ -f $(TAR_ARCH) ] && $(RM) $(TAR_ARCH)
+
+#
+# anonymously ncftps the rpms to sourceforge
+#
+redhat-upload:
+ ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/junkbuster-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm
+# better should use `arch` here instead of ix86 to support other platforms too
+ ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/junkbuster-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm
+ @$(ECHO) -------------------------------------------------------
+ @$(ECHO) Now goto
+ @$(ECHO) http://sourceforge.net/project/admin/editpackages.php?group_id=11118
+ @$(ECHO) ... and release the files.
+ @$(ECHO) -------------------------------------------------------
+ # w3m http://sourceforge.net/project/admin/editpackages.php?group_id=11118
+#############################################################################
+# sun solaris distribution
+#############################################################################
+solaris-dist:
+ @$(ECHO) coming soon.
#############################################################################
# suse distribution (need to be root to build)
# verify that i'm root needs to be done
rm -f ../ijbswa.tar.gz
# verify all version strings, FLAGS, etc. in the spec file
- cat junkbuster-suse.spec | sed 's/^Version:.*/Version: $(RPM_VERSION)/g' | sed 's/^Release:.*/Release: $(RPM_PACKAGEV)/g' > /tmp/abc && cp -f /tmp/abc junkbuster-suse.spec
+ cat junkbuster-suse.spec | sed 's/^Version:.*/Version: $(RPM_VERSION)/g' | sed 's/^Release:.*/Release: $(RPM_PACKAGEV)/g' > abc && mv -f abc junkbuster-suse.spec
tar --exclude "CVS" --exclude "junkbuster-rh.spec" -cvzf ../ijbswa.tar.gz .
# verify all files in their correct location needs to be done
# never use buildroot to define the location inside the spec
# file or suse will fuck up the build process.
cd .. && rpm -ta --buildroot /tmp/xxx ijbswa.tar.gz
+ chmod a+r /usr/src/packages/SRPMS/*
+ chmod a+r /usr/src/packages/RPMS/i386/*
+
+#
+# anonymously ncftps the rpms to sourceforge
+#
+suse-upload:
+ ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming /usr/src/packages/SRPMS/junkbuster-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm
+# better should use `arch` here instead of ix86 to support other platforms too
+ ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming /usr/src/packages/RPMS/*/junkbuster-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm
+ @$(ECHO) -------------------------------------------------------
+ @$(ECHO) Now goto
+ @$(ECHO) http://sourceforge.net/project/admin/editpackages.php?group_id=11118
+ @$(ECHO) ... and release the files.
+ @$(ECHO) -------------------------------------------------------
# handle with care. use with root.
suse-clean:
- rpm -e junkbuster
+ rpm -e junkbuster-suse
rm -rf /etc/junkbuster
rm -rf /var/log/junkbuster
rm -f /etc/init.d/junkbuster
@make clean
make $(PROGRAM)
# remove all objects and create the tarball with the binary
- cd .. && $(RM) ijb/a.out ijb/core ijb/*.$(OBJEXT) && tar --exclude "ijb/CVS" -cvzf ../ijb-distribution-$(VERSION).tar.gz ijb/
+ cd .. && $(RM) ijb/a.out ijb/core ijb/*.@OBJEXT@ && tar --exclude "ijb/CVS" -cvzf ../ijb-distribution-$(VERSION).tar.gz ijb/
chmod a+r ../../ijb-distribution-$(VERSION).tar.gz
@$(ECHO) Tarball with binary created.
cd doc/source && db2html -s ldp.dsl faq.sgml && mv faq ../webserver
cd doc/source && db2html -s ldp.dsl --nochunks faq.sgml > tmp.html && lynx -dump tmp.html > ../text/faq.txt && rm -rf tmp.html faq
+#############################################################################
+#
+# Webserver
+#
+# moves dokumentation to webserver
+#
+#############################################################################
+webserver:
+ @$(ECHO) -------------------------------------------------------
+ @$(ECHO) You have run make dok before, right?
+ @$(ECHO) Note that this command scps all stuff to the webserver,
+ @$(ECHO) it will not remove obsolete documents.
+ @$(ECHO) -------------------------------------------------------
+ chmod -R a+r doc/webserver
+ find doc/webserver -type d -exec chmod a+rx {} \;
+ cd doc/webserver && scp -Cr . ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
#############################################################################
# Source file dependencies
#############################################################################
actions.@OBJEXT@: actions.c actions.h config.h $(PROJECT_H_DEPS) errlog.h jcc.h list.h loaders.h miscutil.h actionlist.h
+cgi.@OBJEXT@: cgi.c cgi.h config.h $(PROJECT_H_DEPS) cgiedit.h cgisimple.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h
+cgiedit.@OBJEXT@: cgiedit.c cgiedit.h config.h $(PROJECT_H_DEPS) cgi.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h
+cgisimple.@OBJEXT@: cgisimple.c cgisimple.h config.h $(PROJECT_H_DEPS) cgi.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h
+deanimate.@OBJEXT@: deanimate.c deanimate.h config.h $(PROJECT_H_DEPS)
encode.@OBJEXT@: encode.c encode.h config.h
errlog.@OBJEXT@: errlog.c errlog.h config.h $(PROJECT_H_DEPS) @WIN_ONLY@w32log.h
-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 cgi.h deanimate.h @WIN_ONLY@win32.h
+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 ssplit.h cgi.h deanimate.h @WIN_ONLY@win32.h
gateway.@OBJEXT@: gateway.c gateway.h config.h $(PROJECT_H_DEPS) errlog.h jbsockets.h jcc.h loadcfg.h
jbsockets.@OBJEXT@: jbsockets.c jbsockets.h config.h $(PROJECT_H_DEPS) filters.h
-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 cgi.h
+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 @WIN_ONLY@w32log.h win32.h cgi.h
killpopup.@OBJEXT@: killpopup.c killpopup.h config.h $(PROJECT_H_DEPS) jcc.h loadcfg.h
list.@OBJEXT@: list.c list.h config.h $(PROJECT_H_DEPS) list.h miscutil.h
-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
+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 @WIN_ONLY@w32log.h win32.h
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
miscutil.@OBJEXT@: miscutil.c miscutil.h config.h
-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
-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
+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 ssplit.h
ssplit.@OBJEXT@: ssplit.c ssplit.h config.h miscutil.h
-cgi.@OBJEXT@: cgi.c cgi.h config.h $(PROJECT_H_DEPS) list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h
-deanimate.@OBJEXT@: deanimate.c deanimate.h config.h $(PROJECT_H_DEPS)
# GNU regex
gnu_regex.@OBJEXT@: gnu_regex.c gnu_regex.h config.h
# AmigaOS
@AMIGAOS_ONLY@OBJS += amiga.o
-@AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -W -Wall -m68020 -Os -noixemul -fbaserel -msmall-code
+@AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -W -m68020 -noixemul -fbaserel -msmall-code
@AMIGAOS_ONLY@LDFLAGS += -m68020 -noixemul -fbaserel
@AMIGAOS_ONLY@LIBS = -lm /gg/lib/libb/libm020/libnix/swapstack.o
@AMIGAOS_ONLY@amiga.o: amiga.c amiga.h config.h
$(RM) a.out core $(OBJS) $(W32_FILES) $(W32_INIS)
clobber: clean
- $(RM) $(PROGRAM) *.pdb *.lib *.exp TAGS junkbuster.log
+ $(RM) $(PROGRAM) *.pdb *.lib *.exp TAGS junkbuster.log config.cache
tags: $(SRCS) $(HDRS)
etags $(SRCS) $(HDRS)
install: all
+ #
+ # FIXME: This is a dirty hack to have an install target
+ # that works at least for some setups. This needs
+ # to be fixed!
+ #
$(STRIP_PROG) $(PROGRAM)
$(INSTALL) $(PROGRAM) $(SBIN_DEST)
- $(INSTALL) README README.TOO README.WIN README.re_filter README.cygwin $(DEST)
- $(INSTALL) aclfile blocklist config cookiefile forward imagelist \
- popup re_filterfile trust $(DEST)
- # FIXME: On SuSE, these are not found. Where do they go?
- $(ECHO) junkbuster.logrotate junkbuster.monthly junkbuster.weekly
- $(GZIP_PROG) -c junkbuster.1 > $(MAN_DEST)/junkbuster.1.gz
- $(INSTALL) junkbuster.init /sbin/init.d/junkbuster
+ mkdir -p $(DEST)/user-manual
+ mkdir -p $(DEST)/templates
+ cp -r doc/webserver/user-manual $(DEST)
+ cp -r templates $(DEST)
+ $(INSTALL) config actionsfile re_filterfile trust $(DEST)
+ # FIXME $(ECHO) junkbuster.logrotate junkbuster.monthly junkbuster.weekly
+ # FIXME: Need new manual! $(GZIP_PROG) -c junkbuster.1 > $(MAN_DEST)/junkbuster.1.gz
+ $(INSTALL) junkbuster.init /etc/init.d/junkbuster
#############################################################################