Permalink
Fetching contributors…
Cannot retrieve contributors at this time
345 lines (285 sloc) 10.7 KB
.SUFFIXES: .re .c
CC=@CC@
CPPFLAGS=@CPPFLAGS@
CFLAGS=@CFLAGS@
PGCFLAGS=@PGCFLAGS@
LDFLAGS=@LDFLAGS@
DEPFLAGS=@DEPFLAGS@
AR=@AR@
RANLIB=@RANLIB@
LIBS=@LIBS@
INSTALL=@INSTALL@
XML2H=@top_srcdir@/buildtools/xml2h
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
libdir=@libdir@
includedir=${prefix}/include
libexecdir=@libexecdir@
localstatedir=@localstatedir@
datarootdir=@datarootdir@
mandir=@mandir@
mansubdir=@mansubdir@
docdir=${prefix}/@docdir@
sysconfdir=@sysconfdir@
srcdir=@srcdir@
top_srcdir=@top_srcdir@
MODULES_DIR=@MODULES_DIR@
WHOLE_ARCHIVE=@WHOLE_ARCHIVE@
NOWHOLE_ARCHIVE=@NOWHOLE_ARCHIVE@
DTRACEOBJ=@DTRACEOBJ@
NOITD_DTRACEOBJ=$(DTRACEOBJ:%dtrace_stub.o=noitd_%dtrace_stub.o)
STRATCOND_DTRACEOBJ=$(DTRACEOBJ:%dtrace_stub.o=stratcond_%dtrace_stub.o)
TARGETS=noitd stratcond noit.conf test-noit.conf stratcon.conf test-stratcon.conf \
jlog/jlogctl
MODDIR=modules
HEADERS=noit_capabilities_listener.h noit_check.h noit_check_resolver.h \
noit_check_rest.h \
noit_check_tools_shared.h \
noit_check_tools.h noit_conf.h noit_conf_checks.h noit_conf_private.h \
noit_version.h \
noit_config.h noit_console.h noit_console_telnet.h noit_defines.h \
noit_filters.h noit_http.h noit_jlog_listener.h noit_listener.h \
noit_livestream_listener.h noit_main.h noit_module.h noit_rest.h \
noit_tokenizer.h noit_xml.h \
stratcon_datastore.h stratcon_iep.h stratcon_jlog_streamer.h \
stratcon_realtime_http.h \
eventer/OETS_asn1_helper.h eventer/eventer.h \
eventer/eventer_POSIX_fd_opset.h eventer/eventer_SSL_fd_opset.h \
eventer/eventer_jobq.h \
utils/noit_atomic.h utils/noit_b64.h utils/noit_hash.h \
utils/noit_log.h utils/noit_mkdir.h utils/noit_security.h \
utils/noit_sem.h utils/noit_skiplist.h utils/noit_str.h \
utils/noit_watchdog.h utils/noit_lockfile.h \
utils/noit_hooks.h \
noitedit/chared.h noitedit/common.h noitedit/compat.h noitedit/el.h \
noitedit/el_term.h noitedit/emacs.h noitedit/fcns.h noitedit/fgetln.h \
noitedit/help.h noitedit/hist.h noitedit/histedit.h noitedit/key.h \
noitedit/map.h noitedit/parse.h noitedit/prompt.h noitedit/refresh.h \
noitedit/search.h noitedit/sig.h noitedit/strlcpy.h noitedit/sys.h \
noitedit/tokenizer.h noitedit/tty.h noitedit/vi.h \
jlog/jlog.h jlog/jlog_config.h jlog/jlog_hash.h jlog/jlog_io.h
NOIT_OBJS=noitd.o noit_main.o noit_listener.o \
noit_console.o noit_console_state.o noit_console_telnet.o \
noit_console_complete.o noit_check_resolver.o \
noit_check_tools_shared.o noit_check_log_helpers.o \
noit_check.o noit_check_log.o noit_check_tools.o \
noit_module.o noit_conf.o noit_conf_checks.o noit_tokenizer.o \
noit_capabilities_listener.o noit_xml.o \
noit_jlog_listener.o noit_livestream_listener.o noit_filters.o \
noit_http.o noit_rest.o noit_check_rest.o noit_filters_rest.o \
bundle.pb-c.o
NOIT_LIBS=libudns libnoitedit libeventer libjlog libnoit_utils libnoitjson libnoityajl
NOIT_LIB_FILES=udns/libudns.o noitedit/libnoitedit.a eventer/libeventer.a \
jlog/libjlog.a utils/libnoit_utils.a json-lib/libnoitjson.a yajl-lib/libnoityajl.a
STRATCON_OBJS=stratcond.o noit_main.o noit_listener.o \
noit_console.o noit_console_state.o noit_console_telnet.o \
noit_console_complete.o noit_xml.o \
noit_conf.o noit_http.o noit_rest.o noit_tokenizer.o \
noit_capabilities_listener.o noit_module.o \
noit_check_tools_shared.o noit_check_log_helpers.o \
stratcon_realtime_http.o \
stratcon_jlog_streamer.o stratcon_datastore.o \
stratcon_iep.o \
bundle.pb-c.o
STRATCON_LIBS=libudns libnoitedit libeventer libjlog libnoit_utils libnoitjson libnoityajl
STRATCON_LIB_FILES=udns/libudns.o noitedit/libnoitedit.a eventer/libeventer.a \
jlog/libjlog.a utils/libnoit_utils.a json-lib/libnoitjson.a yajl-lib/libnoityajl.a
all: reversion $(NOIT_LIBS) $(STRATCON_LIBS) $(TARGETS) java-bits make-modules make-man
make-man:
@(cd man && $(MAKE) -s)
lua/liblua.lo:
@echo "- building lua bits"
@(cd lua && $(MAKE) -s liblua.lo)
make-modules: lua/liblua.lo
@for dir in $(MODDIR) ; do \
(cd $$dir && $(MAKE) -s) ; \
done
java-bits:
@-test -n "@JAVAPARTS@" && (cd java && $(MAKE) -s)
libjlog:
@(cd jlog && $(MAKE) -s libjlog.a)
jlog/jlogctl:
@echo "- building jlogctl"
@(cd jlog && $(MAKE) -s jlogctl)
libudns:
@(cd udns && $(MAKE) -s libudns.o)
libnoitedit:
@(cd noitedit && $(MAKE) -s libnoitedit.a)
libeventer:
@(cd eventer && $(MAKE) -s libeventer.a)
libnoit_utils:
@(cd utils && $(MAKE) -s libnoit_utils.a)
libnoitjson:
@(cd json-lib && $(MAKE) -s libnoitjson.a)
libnoityajl:
@(cd yajl-lib && $(MAKE) -s libnoityajl.a)
jlog/libjlog.a: libjlog
udns/libudns.o: libudns
noitedit/libnoitedit.a: libnoitedit
eventer/libeventer.a: libeventer
utils/libnoit_utils.a: libnoit_utils
json-lib/libnoitjson.a: libnoitjson
yajl-lib/libnoityajl.a: libnoityajl
.PHONY: reversion
reversion:
@$(top_srcdir)/buildtools/mkversion.sh noit_version.h
noit_version.h:
@$(top_srcdir)/buildtools/mkversion.sh noit_version.h
man/noitd.usage.h: make-man
man/stratcond.usage.h: make-man
noitd.o: man/noitd.usage.h
stratcond.o: man/stratcond.usage.h
stratcon_jlog_streamer.o: @DTRACEHDR@
noit_check_tools.o: @DTRACEHDR@
noit_check.o: @DTRACEHDR@
stratcond_@DTRACEOBJ@: $(STRATCON_OBJS)
@echo "- assembling $@" && \
@DTRACE@ @DTRACEFLAGS@ -Z -G -s dtrace_probes.d -o stratcond_@DTRACEOBJ@ $(STRATCON_OBJS)
noitd_@DTRACEOBJ@: $(STRATCON_OBJS)
@echo "- assembling $@" && \
@DTRACE@ @DTRACEFLAGS@ -Z -G -s dtrace_probes.d -o noitd_@DTRACEOBJ@ $(NOIT_OBJS)
@DTRACEHDR@: dtrace_probes.d
@if test -z "@DTRACE@" ; then \
echo "- faking dtrace header" ; \
cp ./@DTRACEHDR@.stock ./@DTRACEHDR@ ; \
else \
echo "- building dtrace header" ; \
@DTRACE@ -h -s dtrace_probes.d ; \
fi
noitd: $(NOIT_OBJS) $(NOIT_LIB_FILES) man/noitd.usage.h $(NOITD_DTRACEOBJ)
@echo "- linking $@"
@$(CC) -o $@ $(NOIT_OBJS) \
udns/libudns.o \
$(NOITD_DTRACEOBJ) \
$(LDFLAGS) \
$(WHOLE_ARCHIVE) \
eventer/*.o \
utils/*.o \
json-lib/*.o \
yajl-lib/*.o \
-Ljlog -ljlog \
-Lnoitedit -lnoitedit \
$(NOWHOLE_ARCHIVE) \
$(LIBS)
stratcond: $(STRATCON_OBJS) $(STRATCON_LIB_FILES) $(STRATCOND_DTRACEOBJ)
@echo "- linking $@"
@$(CC) -o $@ $(STRATCON_OBJS) \
udns/libudns.o \
$(STRATCOND_DTRACEOBJ) \
$(LDFLAGS) \
$(WHOLE_ARCHIVE) \
eventer/*.o \
utils/*.o \
json-lib/*.o \
yajl-lib/*.o \
-Ljlog -ljlog \
-Lnoitedit -lnoitedit \
$(NOWHOLE_ARCHIVE) \
$(LIBS)
stratcon_datastore.o: stratcon_datastore.c
@echo "- compiling $<"
@$(CC) $(CPPFLAGS) $(PGCFLAGS) $(CFLAGS) -c $<
.c.o:
@echo "- compiling $<"
@$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
noit_module.o: module-online.h
module-online.h: modules/module-online.xsl
@echo "- making module-online.h (StyleSheet include)"
@$(XML2H) helpStyleXML < modules/module-online.xsl > $@
noit_tokenizer.c:
@echo "- re2c noit_tokenizer.re"
@re2c -o $@ noit_tokenizer.re
test-noit.conf: noit.conf.in Makefile
@sed -e "s^%sysconfdir%^`pwd`^g;" \
-e "s^%modulesdir%^`pwd`/modules^g;" \
-e "s^%modulesluadir%^`pwd`/modules-lua^g;" \
-e "s^%PKIPREFIX%^../test/test-^g;" < \
noit.conf.in > \
test-noit.conf
noit.conf: noit.conf.in Makefile
@sed -e "s^%sysconfdir%^$(sysconfdir)^g;" \
-e "s^%modulesdir%^$(MODULES_DIR)^g;" \
-e "s^%modulesluadir%^$(MODULES_DIR)^g;" \
-e "s^%PKIPREFIX%^$${PKIPREFIX}^g;" < \
noit.conf.in > \
noit.conf
test-stratcon.conf: stratcon.conf.in Makefile
@sed -e "s^%sysconfdir%^`pwd`^g;" \
-e "s^%modulesdir%^`pwd`/modules^g;" \
-e "s^%modulesluadir%^`pwd`/modules-lua^g;" \
-e "s^%iepbindir%^`pwd`/java^g;" \
-e "s^%iepdbdir%^`pwd`/java^g;" \
-e "s^%PKIPREFIX%^../test/test-^g;" < \
stratcon.conf.in > \
test-stratcon.conf
stratcon.conf: stratcon.conf.in Makefile
@sed -e "s^%sysconfdir%^$(sysconfdir)^g;" \
-e "s^%modulesdir%^$(MODULES_DIR)^g;" \
-e "s^%modulesluadir%^$(MODULES_DIR)^g;" \
-e "s^%iepbindir%^$(bindir)^g;" \
-e "s^%iepdbdir%^$(localstatedir)/db/noit-iep^g;" \
-e "s^%PKIPREFIX%^$${PKIPREFIX}^g;" < \
stratcon.conf.in > \
stratcon.conf
install-dirs:
$(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(bindir)
$(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(sbindir)
$(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(sysconfdir)
install-headers: $(HEADERS)
$(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(bindir)
$(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)
$(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/eventer
$(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/utils
$(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/noitedit
$(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/jlog
$(INSTALL) -m 0755 scripts/noit-config $(DESTDIR)$(bindir)/noit-config
for file in $(HEADERS) ; do \
$(INSTALL) -m 0644 $$file $(DESTDIR)$(includedir)/$$file ; \
done
install-noitd: install-dirs reversion noitd noit.conf java-bits jlog/jlogctl
$(INSTALL) -m 0755 scripts/noittrap $(DESTDIR)$(bindir)/noittrap
$(INSTALL) -m 0755 jlog/jlogctl $(DESTDIR)$(bindir)/noit_jlogctl
$(INSTALL) -m 0755 noitd $(DESTDIR)$(sbindir)/noitd
$(INSTALL) -m 0644 noit.conf $(DESTDIR)$(sysconfdir)/noit.conf.sample
$(INSTALL) -m 0644 config_templates.conf $(DESTDIR)$(sysconfdir)/config_templates.conf
$(INSTALL) -m 0644 default-ca-chain.crt $(DESTDIR)$(sysconfdir)/default-ca-chain.crt
(cd modules && $(MAKE) install-modules DESTDIR=$(DESTDIR))
(cd modules-lua && $(MAKE) install DESTDIR=$(DESTDIR))
-test -n "@JAVAPARTS@" && (cd @JAVAPARTS@ && $(MAKE) install-jezebel DESTDIR=$(DESTDIR))
install-stratcond: install-dirs reversion stratcond stratcon.conf java-bits
$(INSTALL) -m 0755 stratcond $(DESTDIR)$(sbindir)/stratcond
$(INSTALL) -m 0644 stratcon.conf $(DESTDIR)$(sysconfdir)/stratcon.conf.sample
(cd modules && $(MAKE) install-smodules DESTDIR=$(DESTDIR))
-test -n "@JAVAPARTS@" && (cd @JAVAPARTS@ && $(MAKE) install-iep DESTDIR=$(DESTDIR))
install-docs:
(cd man && $(MAKE) install DESTDIR=$(DESTDIR))
install: install-dirs install-docs install-headers install-noitd install-stratcond
clean:
rm -f *.o $(TARGETS)
rm -f module-online.h
(cd jlog && $(MAKE) clean)
(cd eventer && $(MAKE) clean)
(cd udns && $(MAKE) clean)
(cd man && $(MAKE) clean)
(cd modules && $(MAKE) clean)
(cd noitedit && $(MAKE) clean)
(cd utils && $(MAKE) clean)
(cd json-lib && $(MAKE) clean)
(cd yajl-lib && $(MAKE) clean)
(cd lua && $(MAKE) clean)
(cd java && $(MAKE) clean)
Makefile.dep:
$(CC) -I. $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) *.c > Makefile.dep
$(top_srcdir)/buildtools/culldeps.sh Makefile.dep
include Makefile.dep
distclean-subdirs:
for dir in jlog eventer udns man modules modules-lua noitedit utils json-lib yajl-lib lua java ; do \
(cd $$dir && $(MAKE) distclean) ; \
done
distclean: clean distclean-subdirs
rm -f Makefile noit_config.h scripts/noit-config
bundle:
protoc bundle.proto --java_out=java
protoc-c bundle.proto --c_out=.