## ## OSSP l2 - Flexible Logging ## Copyright (c) 2001-2005 Cable & Wireless ## Copyright (c) 2001-2005 The OSSP Project ## Copyright (c) 2001-2005 Ralf S. Engelschall ## ## This file is part of OSSP l2, a flexible logging library which ## can be found at http://www.ossp.org/pkg/lib/l2/. ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that ## the above copyright notice and this permission notice appear in all ## copies. ## ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ## SUCH DAMAGE. ## ## Makefile.in: Autoconf Makefile skeleton ## @SET_MAKE@ TOP = . # installation paths DESTDIR = prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ mandir = @mandir@ # build tools CC = @CC@ CFLAGS = @CFLAGS@ -I. LDFLAGS = @LDFLAGS@ -L. LIBS = @LIBS@ AR = @AR@ RANLIB = @RANLIB@ RM = rm -f RMDIR = rmdir POD2MAN = pod2man TRUE = true BISON = @BISON@ FLEX = @FLEX@ SHTOOL = ./shtool LIBTOOL = ./libtool TARGET = $(TARGET_LIBS) $(TARGET_MANS) $(TARGET_PROGS) TARGET_LIBS = libl2.la TARGET_MANS = l2tool.1 l2-config.1 l2.3 TARGET_PROGS = l2tool l2_test # list of library object files OBJS = \ l2_env.lo \ l2_channel.lo \ l2_ch_noop.lo \ l2_ch_fd.lo \ l2_ch_file.lo \ l2_ch_pipe.lo \ l2_ch_syslog.lo \ l2_ch_socket.lo \ l2_ch_irc.lo \ l2_ch_smtp.lo \ l2_ch_null.lo \ l2_ch_filter.lo \ l2_ch_prefix.lo \ l2_ch_buffer.lo \ l2_ut_format.lo \ l2_ut_param.lo \ l2_ut_pcre.lo \ l2_ut_level.lo \ l2_ut_fmtcb.lo \ l2_ut_sa.lo \ l2_spec.lo \ l2_spec_scan.lo \ l2_spec_parse.lo \ l2_version.lo # list of source files SRCS = \ l2_env.c \ l2_channel.c \ l2_ch_noop.c \ l2_ch_fd.c \ l2_ch_file.c \ l2_ch_pipe.c \ l2_ch_syslog.c \ l2_ch_socket.c \ l2_ch_irc.c \ l2_ch_smtp.c \ l2_ch_null.c \ l2_ch_filter.c \ l2_ch_prefix.c \ l2_ch_buffer.c \ l2_ut_format.c \ l2_ut_param.c \ l2_ut_pcre.c \ l2_ut_level.c \ l2_ut_fmtcb.c \ l2_ut_sa.c \ l2_version.c # helper macro for generating a Unix manual page _MANPAGE = \ V1=`$(SHTOOL) version -lc -dshort l2_version.c`; \ V2=`$(SHTOOL) version -lc -dlong l2_version.c`; \ D=`$(SHTOOL) version -lc -dlong l2_version.c |\ sed -e 's;.*(;;' -e 's;).*;;'`; \ $(POD2MAN) --section=$${SEC} --center="$${ONELINE}" \ --release="$$D" --date="$${NAME} $$V1" $(S)$${BASENAME}.pod |\ sed -e "s;L2_VERSION_STR;$$V2;" >$${BASENAME}.$${SEC} # implicit building rules .SUFFIXES: .SUFFIXES: .c .cc .o .lo .c.o: $(CC) -c $(CPPFLAGS) $(CFLAGS) $< .c.lo: $(LIBTOOL) --mode=compile --quiet $(CC) -c $(CPPFLAGS) $(CFLAGS) $< # default target all: $(TARGET) # build libraries libl2.la: $(OBJS) $(LIBTOOL) --mode=link --quiet $(CC) -o libl2.la $(OBJS) -rpath $(libdir) \ -version-info `$(SHTOOL) version -l c -d libtool l2_version.c` # build regex library l2_ut_pcre.lo: l2_ut_pcre.tab l2_ut_pcre.c l2_ut_pcre.tab: l2_ut_pcre.c $(CC) $(CFLAGS) -DL2_UT_PCRE_TAB $(LDFLAGS) -o l2_ut_pcre.gen l2_ut_pcre.c $(LIBS) ./l2_ut_pcre.gen >l2_ut_pcre.tab -$(RM) l2_ut_pcre.gen # build specification parser/scanner l2_spec.c: l2_spec.h l2_spec_parse.h l2_spec_scan.lo: l2_spec_scan.c l2_spec_parse.h @M@l2_spec_scan.c: l2_spec_scan.l @M@ $(FLEX) -Pl2_spec_ -s -8 -B -ol2_spec_scan.c l2_spec_scan.l @M@l2_spec_parse.c l2_spec_parse.h: l2_spec_parse.y @M@ $(BISON) -d -k -pl2_spec_ -ol2_spec_parse.c l2_spec_parse.y # build programs l2tool: l2tool.o libl2.la $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o l2tool l2tool.o libl2.la $(LIBS) l2_test: l2_test.o libl2.la $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o l2_test l2_test.o libl2.la $(LIBS) # build Unix manual pages l2tool.1: l2tool.pod l2_version.c BASENAME="l2tool"; SEC=1; \ NAME="L2"; ONELINE="Logging Tool"; \ $(_MANPAGE) l2-config.1: l2-config.pod l2_version.c BASENAME="l2-config"; SEC=1; \ NAME="L2"; ONELINE="Flexible Logging"; \ $(_MANPAGE) l2.3: l2.pod l2_version.c BASENAME="l2"; SEC=3; \ NAME="L2"; ONELINE="Flexible Logging"; \ $(_MANPAGE) # (minimalistic) test suite check: test test: all $(LIBTOOL) --mode=execute ./l2_test # perform standard installation procedure install: all $(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(bindir) $(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(includedir) $(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(libdir) $(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(mandir)/man1 $(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(mandir)/man3 $(SHTOOL) install -c -m 755 l2-config $(DESTDIR)$(bindir)/l2-config $(SHTOOL) install -c -m 644 l2-config.1 $(DESTDIR)$(mandir)/man1/l2-config.1 @$(LIBTOOL) --mode=install \ $(SHTOOL) install -c -m 755 l2tool $(DESTDIR)$(bindir)/l2tool $(SHTOOL) install -c -m 644 l2tool.1 $(DESTDIR)$(mandir)/man1/l2tool.1 $(SHTOOL) install -c -m 644 l2.3 $(DESTDIR)$(mandir)/man3/l2.3 $(SHTOOL) install -c -m 644 l2.h $(DESTDIR)$(includedir)/l2.h @$(LIBTOOL) --mode=install \ $(SHTOOL) install -c -m 644 libl2.la $(DESTDIR)$(libdir)/libl2.la # perform standard uninstallation procedure uninstall: @$(LIBTOOL) --mode=uninstall \ $(RM) $(DESTDIR)$(libdir)/libl2.la $(RM) $(DESTDIR)$(includedir)/l2.h $(RM) $(DESTDIR)$(mandir)/man3/l2.3 $(RM) $(DESTDIR)$(mandir)/man1/l2tool.1 @$(LIBTOOL) --mode=uninstall \ $(RM) $(DESTDIR)$(bindir)/l2tool $(RM) $(DESTDIR)$(mandir)/man1/l2-config.1 $(RM) $(DESTDIR)$(bindir)/l2-config $(RMDIR) $(DESTDIR)$(mandir)/man3 $(RMDIR) $(DESTDIR)$(mandir)/man1 $(RMDIR) $(DESTDIR)$(mandir) $(RMDIR) $(DESTDIR)$(libdir) $(RMDIR) $(DESTDIR)$(includedir) $(RMDIR) $(DESTDIR)$(bindir) # remove everything which can be regenerated # by "make all" clean: $(RM) *.lo *.o $(RM) .libs/* -$(RMDIR) .libs >/dev/null 2>&1 || $(TRUE) $(RM) $(TARGET_LIBS) $(RM) $(TARGET_PROGS) # remove everything which can be regenerated # by "./configure && make all" distclean: clean $(RM) l2-config $(RM) l2_config.h $(RM) config.log config.cache config.status $(RM) libtool $(RM) Makefile $(RM) l2_test.log $(RM) l2_ut_pcre.tab $(RM) l2.h # remove everything which can be regenerated # by "./devtool autogen" realclean: distclean $(RM) configure $(RM) config.guess config.sub $(RM) ltmain.sh libtool.m4 $(RM) shtool $(RM) l2_config.h.in $(RM) l2_spec_scan.c $(RM) l2_spec_parse.c l2_spec_parse.h $(RM) $(TARGET_MANS) # create dependencies depend: all cp Makefile.in Makefile.in.bak \ && sed -ne '1,/^# AUTOMATICALLY GENERATED DEPENDENCY LIST/p' Makefile.in > Makefile.new \ && $(CC) -MM $(CPPFLAGS) $(CFLAGS) $(SRCS) |\ perl -e 'my $$d = ""; $$d .= $$_ while (); $$_ = $$d; \ s|\\\n\s*| |sg; s|\b?\S*/\S*\b?||g; s|\s{2,}| |g; \ print $$_;' >> Makefile.new \ && cp Makefile.new Makefile.in && rm -f Makefile.new $(OBJS): Makefile # AUTOMATICALLY GENERATED DEPENDENCY LIST - DO NOT EDIT l2_env.o: l2_env.c l2_p.h l2.h l2_config.h l2_ut_format.h l2_ut_pcre.h l2_ut_sa.h l2_channel.o: l2_channel.c l2_p.h l2.h l2_config.h l2_ut_format.h l2_ut_pcre.h l2_ut_sa.h l2_ch_noop.o: l2_ch_noop.c l2.h l2_ch_fd.o: l2_ch_fd.c l2.h l2_ch_file.o: l2_ch_file.c l2.h l2_ch_pipe.o: l2_ch_pipe.c l2.h l2_p.h l2_config.h l2_ut_format.h l2_ut_pcre.h l2_ut_sa.h l2_ch_syslog.o: l2_ch_syslog.c l2.h l2_p.h l2_config.h l2_ut_format.h l2_ut_pcre.h l2_ut_sa.h l2_ch_socket.o: l2_ch_socket.c l2.h l2_p.h l2_config.h l2_ut_format.h l2_ut_pcre.h l2_ut_sa.h l2_ch_irc.o: l2_ch_irc.c l2.h l2_p.h l2_config.h l2_ut_format.h l2_ut_pcre.h l2_ut_sa.h l2_ch_smtp.o: l2_ch_smtp.c l2.h l2_p.h l2_config.h l2_ut_format.h l2_ut_pcre.h l2_ut_sa.h l2_ch_null.o: l2_ch_null.c l2.h l2_ch_filter.o: l2_ch_filter.c l2.h l2_ut_pcre.h l2_ch_prefix.o: l2_ch_prefix.c l2.h l2_ch_buffer.o: l2_ch_buffer.c l2.h l2_p.h l2_config.h l2_ut_format.h l2_ut_pcre.h l2_ut_sa.h l2_ut_format.o: l2_ut_format.c l2_ut_format.h l2_ut_param.o: l2_ut_param.c l2.h l2_p.h l2_config.h l2_ut_format.h l2_ut_pcre.h l2_ut_sa.h l2_ut_pcre.o: l2_ut_pcre.c l2_ut_pcre.h l2_ut_pcre.tab l2_ut_level.o: l2_ut_level.c l2.h l2_p.h l2_config.h l2_ut_format.h l2_ut_pcre.h l2_ut_sa.h l2_ut_fmtcb.o: l2_ut_fmtcb.c l2.h l2_ut_sa.o: l2_ut_sa.c l2_config.h l2_ut_sa.h l2_version.o: l2_version.c l2_version.c