root/src/Makefile.in

Revision 0ad61c325ea2fe1883bc0c91cb0a88e8ea51cfda, 12.6 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 2 weeks ago)

initial implementation of a metrics observer

  • Property mode set to 100644
Line 
1 .SUFFIXES: .lo .re .c
2
3 Q=
4 ifeq ($(V),)
5         Q=@
6 endif
7
8 LIBNOIT_VERSION=0.0.1
9
10 prefix=@prefix@
11 exec_prefix=@exec_prefix@
12 bindir=@bindir@
13 sbindir=@sbindir@
14 libdir=@libdir@
15 includedir=@includedir@
16 libexecdir=@libexecdir@
17 localstatedir=@localstatedir@
18 datarootdir=@datarootdir@
19 datadir=@datadir@
20 mandir=@mandir@
21 mansubdir=@mansubdir@
22 docdir=${prefix}/@docdir@
23 sysconfdir=@sysconfdir@
24 srcdir=@srcdir@
25 top_srcdir=@top_srcdir@
26 MODULES_DIR=@MODULES_DIR@
27 MTEV_MODULES_DIR=@MTEV_MODULES_DIR@
28
29 CC=@CC@
30 SHLD=@SHLD@
31 CPPFLAGS=@CPPFLAGS@
32 CFLAGS=@CFLAGS@
33 SHCFLAGS=@SHCFLAGS@
34 CLINKFLAGS=@CLINKFLAGS@
35 LUACFLAGS=@LUACFLAGS@
36 PGCFLAGS=@PGCFLAGS@
37 LDFLAGS=@LDFLAGS@ -L$(libdir)
38 RLDFLAG=@RLDFLAG@
39 ifneq ($(strip $(RLDFLAG)),)
40   LDFLAGS += @RLDFLAG@$(libdir)
41 endif
42 SHLDFLAGS=@SHLDFLAGS@
43 LIBNOIT_LIBS=@LIBNOIT_LIBS@
44 DEPFLAGS=@DEPFLAGS@
45 MODULELD=@MODULELD@
46 AR=@AR@
47 RANLIB=@RANLIB@
48 LIBS=@LIBS@
49 INSTALL=@INSTALL@
50 XML2H=@top_srcdir@/buildtools/xml2h
51 MAPFLAGS=@MAPFLAGS@
52 CTFCONVERT=@CTFCONVERT@
53 CTFMERGE=@CTFMERGE@
54
55 # Later versions of ctf* tools no longer have -g and by default do not strip,
56 # so we get the same behavior as with -g on older versions.
57 ifneq ($(wildcard $(CTFCONVERT)),)
58   HAS_G=$(shell $(CTFCONVERT) 2>&1 | grep -- -gis)
59   ifneq ($(HAS_G),)
60     CTFNOSTRIP=-g
61   else
62     CTFNOSTRIP=
63   endif
64 endif
65
66 WHOLE_ARCHIVE=@WHOLE_ARCHIVE@
67 NOWHOLE_ARCHIVE=@NOWHOLE_ARCHIVE@
68
69 DTRACEOBJ=@DTRACEOBJ@
70 NOITD_DTRACEOBJ=$(DTRACEOBJ:%dtrace_stub.o=noitd_%dtrace_stub.o)
71 STRATCOND_DTRACEOBJ=$(DTRACEOBJ:%dtrace_stub.o=stratcond_%dtrace_stub.o)
72 LIBNOIT_V=libnoit@DOTSO@.$(LIBNOIT_VERSION)@DOTDYLIB@
73 LIBNOIT=libnoit@DOTSO@@DOTDYLIB@
74
75 TARGETS=noitd stratcond noit.conf test-noit.conf stratcon.conf test-stratcon.conf \
76         $(LIBNOIT) @MDB_MODS@
77
78 all:    reversion $(TARGETS) java-bits make-modules make-man tests
79
80 tests:
81         $(MAKE) -C modules tests
82
83 MODDIR=modules
84
85 HEADERS=noit_metric.h noit_check_log_helpers.h noit_check_tools_shared.h
86
87 NOIT_HEADERS=noit_check.h noit_check_resolver.h \
88         noit_check_rest.h noit_check_tools.h \
89         noit_conf_checks.h \
90         noit_filters.h noit_jlog_listener.h noit_livestream_listener.h \
91         noit_module.h noit_metric_director.h
92
93 STRATCON_HEADERS=stratcon_datastore.h stratcon_iep.h stratcon_ingest.h \
94         stratcon_jlog_streamer.h stratcon_realtime_http.h
95
96 ENABLE_LUA=@ENABLE_LUA@
97 LUALIBS=@LUALIBS@
98
99 LIBNOIT_OBJS=noit_check_log_helpers.lo bundle.pb-c.lo \
100         noit_check_tools_shared.lo stratcon_ingest.lo
101
102 NOIT_OBJS=noitd.o noit_mtev_bridge.o \
103         noit_check_resolver.o noit_metric_director.o \
104         noit_check.o noit_check_log.o noit_check_tools.o \
105         noit_module.o noit_conf_checks.o \
106         noit_jlog_listener.o noit_livestream_listener.o noit_filters.o \
107         noit_check_rest.o noit_filters_rest.o \
108         $(LIBNOIT_OBJS:%.lo=%.o)
109
110 STRATCON_OBJS=stratcond.o noit_mtev_bridge.o \
111         stratcon_realtime_http.o \
112         stratcon_jlog_streamer.o stratcon_datastore.o \
113         stratcon_iep.o \
114         $(LIBNOIT_OBJS:%.lo=%.o)
115
116 FINAL_STRATCON_OBJS=$(STRATCON_OBJS:%.o=stratcon-objs/%.o)
117 FINAL_NOIT_OBJS=$(NOIT_OBJS:%.o=noit-objs/%.o)
118 FINAL_LIBNOIT_OBJS=$(LIBNOIT_OBJS:%.lo=libnoit-objs/%.lo)
119
120 noit-objs/%.o:  %.o
121         @mkdir -p "`dirname $@`"
122         @echo "- making private $@"
123         @cp $(@:noit-objs/%.o=%.o) $@
124         @if test -x "$(CTFCONVERT)" ; then \
125                 echo "- making CTF ($@)" ; \
126                 $(CTFCONVERT) $(CTFNOSTRIP) -i -l @VERSION@ $@ ; \
127         fi
128
129 libnoit-objs/%.lo:      %.lo
130         @mkdir -p "`dirname $@`"
131         @echo "- making private $@"
132         @cp $(@:libnoit-objs/%.lo=%.lo) $@
133         @if test -x "$(CTFCONVERT)" ; then \
134                 echo "- making CTF ($@)" ; \
135                 $(CTFCONVERT) $(CTFNOSTRIP) -i -l @VERSION@ $@ ; \
136         fi
137
138 stratcon-objs/%.o:      %.o
139         @mkdir -p "`dirname $@`"
140         @echo "- making private $@"
141         @cp $(@:stratcon-objs/%.o=%.o) $@
142         @if test -x "$(CTFCONVERT)" ; then \
143                 echo "- making CTF ($@)" ; \
144                 $(CTFCONVERT) $(CTFNOSTRIP) -i -l @VERSION@ $@ ; \
145         fi
146
147 make-man:
148         @(cd man && $(MAKE) -s)
149
150 make-modules:
151         @for dir in $(MODDIR) ; do \
152                 (cd $$dir && $(MAKE) -s) ; \
153         done
154
155 java-bits:
156         @-test -n "@JAVAPARTS@" && (cd java && $(MAKE) -s)
157
158 .PHONY: reversion
159
160 reversion:
161         @$(top_srcdir)/buildtools/mkversion.sh noit_version.h
162
163 noit_version.h:
164         @$(top_srcdir)/buildtools/mkversion.sh noit_version.h
165
166 noit.env:       noit_version.h noit_config.h
167         awk '/^#define[         ]+NOIT_BRANCH/{print $$2"="$$3;}' < noit_version.h > $@
168         cat noit_version.h | tr '[".]' ' ' | awk '/^#define[    ]+NOIT_VERSION/{print $$2"=\""$$3"\""; print $$2"_TSTAMP=\""$$4"\"";}' >> $@
169         awk '/^#define[         ]+NOIT_UNAME_[^V]/{print "BUILD_"$$2"="$$3;}' < noit_config.h >> $@
170
171 man/noitd.usage.h:      make-man
172
173 man/stratcond.usage.h:  make-man
174
175
176 noitd.o:        man/noitd.usage.h
177 stratcond.o:    man/stratcond.usage.h
178
179 stratcon_jlog_streamer.o:       noit_@DTRACEHDR@ stratcon_@DTRACEHDR@
180 noit_check_tools.o:     noit_@DTRACEHDR@ stratcon_@DTRACEHDR@
181 noit_check.o:   noit_@DTRACEHDR@ stratcon_@DTRACEHDR@
182 dtrace_probes.h:        noit_@DTRACEHDR@ stratcon_@DTRACEHDR@ libnoit_@DTRACEHDR@
183
184 $(LIBNOIT):     $(LIBNOIT_V)
185         ln -sf $(LIBNOIT_V) $(LIBNOIT)
186
187 $(LIBNOIT_V):   $(FINAL_LIBNOIT_OBJS)
188         @echo "- linking $@"
189         $(SHLD) $(SHLDFLAGS) -o $@ @LD_LIBNOIT_VERSION@ $(FINAL_LIBNOIT_OBJS) $(LIBNOIT_LIBS) -L. -lmtev
190
191 stratcond_@DTRACEOBJ@:    $(FINAL_STRATCON_OBJS)
192         @echo "- assembling $@" && \
193         @DTRACE@ @DTRACEFLAGS@ -Z -G -s stratcon_dtrace_probes.d -o stratcond_@DTRACEOBJ@ $(FINAL_STRATCON_OBJS)
194
195 noitd_@DTRACEOBJ@:    $(FINAL_NOIT_OBJS)
196         @echo "- assembling $@" && \
197         @DTRACE@ @DTRACEFLAGS@ -Z -G -s noit_dtrace_probes.d -o noitd_@DTRACEOBJ@ $(FINAL_NOIT_OBJS)
198
199 noit_@DTRACEHDR@:    noit_dtrace_probes.d
200         @if test -z "@DTRACE@" ; then \
201                 echo "- faking dtrace header" ; \
202                 cp ./noit_@DTRACEHDR@.stock ./noit_@DTRACEHDR@ ; \
203         else \
204                 echo "- building dtrace header $@" ; \
205                 @DTRACE@ -h -s noit_dtrace_probes.d ; \
206         fi
207
208 stratcon_@DTRACEHDR@:    stratcon_dtrace_probes.d
209         @if test -z "@DTRACE@" ; then \
210                 echo "- faking dtrace header" ; \
211                 cp ./stratcon_@DTRACEHDR@.stock ./stratcon_@DTRACEHDR@ ; \
212         else \
213                 echo "- building dtrace header $@" ; \
214                 @DTRACE@ -h -s stratcon_dtrace_probes.d ; \
215         fi
216
217 noitd:  $(FINAL_NOIT_OBJS) man/noitd.usage.h $(NOITD_DTRACEOBJ)
218         @echo "- linking $@"
219         @$(CC) $(CLINKFLAGS) -o $@ $(FINAL_NOIT_OBJS) \
220                 $(NOITD_DTRACEOBJ) \
221                 $(LDFLAGS) \
222                 $(MAPFLAGS) \
223                 $(LIBS) -L. -lmtev $(LUALIBS) -ljlog
224         @if test -x "$(CTFMERGE)" ; then \
225                 $(CTFMERGE) $(CTFNOSTRIP) -l @VERSION@ -o $@ $(FINAL_NOIT_OBJS) $(NOITD_DTRACEOBJ) ; \
226         fi
227
228 stratcond:      $(FINAL_STRATCON_OBJS) $(STRATCOND_DTRACEOBJ)
229         @echo "- linking $@"
230         $(CC) $(CLINKFLAGS) -o $@ $(FINAL_STRATCON_OBJS) \
231                 $(STRATCOND_DTRACEOBJ) \
232                 $(LDFLAGS) \
233                 $(MAPFLAGS) \
234                 $(LIBS) -L. -lmtev
235         @if test -x "$(CTFMERGE)" ; then \
236                 $(CTFMERGE) $(CTFNOSTRIP) -l @VERSION@ -o $@ $(FINAL_STRATCON_OBJS) $(STRATCOND_DTRACEOBJ) ; \
237         fi
238
239 mdb-support/mdb_help.lo:        mdb-support/mdb_help.c
240         @echo "- compiling $@"
241         @$(CC) -Imdb-support $(CPPFLAGS) $(SHCFLAGS) $(CFLAGS) -o $@ -c $<
242
243 SHAREDMDBMODSRC=
244
245 stratcon_datastore.o:   stratcon_datastore.c
246         @echo "- compiling $<"
247         @$(CC) $(CPPFLAGS) $(PGCFLAGS) $(CFLAGS) -c $<
248
249 .c.lo:
250         $(Q)if [ "`dirname $@`" != "." ] ; then \
251                 (cd "`dirname $@`" && $(MAKE) "`basename $@`") ; \
252         else \
253                 echo "- compiling $<" ; \
254           $(CC) $(CPPFLAGS) $(SHCFLAGS) -c $< -o $@ ; \
255         fi
256
257 .c.o:
258         $(Q)if [ "`dirname $@`" != "." ] ; then \
259                 (cd "`dirname $@`" && $(MAKE) "`basename $@`") ; \
260         else \
261                 echo "- compiling $<" ; \
262                 $(CC) $(CPPFLAGS) $(CFLAGS) -c $< ; \
263         fi
264
265 noit_module.o:  module-online.h
266
267 module-online.h:        modules/module-online.xsl
268         @echo "- making module-online.h (StyleSheet include)"
269         @$(XML2H) helpStyleXML < modules/module-online.xsl > $@
270
271 test-noit.conf: noit.conf.in Makefile
272         @mkdir -p scratch/var/log scratch/var/run
273         @sed -e "s^%sysconfdir%^`pwd`^g;" \
274                 -e "s^%modulesdir%^`pwd`/modules^g;" \
275                 -e "s^%mtevmodulesdir%^$(MTEV_MODULES_DIR)^g;" \
276                 -e "s^%modulesluadir%^`pwd`/modules-lua^g;" \
277                 -e "s^%datarootdir%^`pwd`^g;" \
278                 -e "s^%PKIPREFIX%^../test/test-^g;" \
279                 -e "s^/var/^`pwd`/scratch/var/^g;" < \
280                 noit.conf.in > \
281                 test-noit.conf
282
283 noit.conf:      noit.conf.in Makefile
284         @sed -e "s^%sysconfdir%^$(sysconfdir)^g;" \
285                 -e "s^%modulesdir%^$(MODULES_DIR)^g;" \
286                 -e "s^%mtevmodulesdir%^$(MTEV_MODULES_DIR)^g;" \
287                 -e "s^%modulesluadir%^$(MODULES_DIR)^g;" \
288                 -e "s^%datarootdir%^$(datadir)^g;" \
289                 -e "s^%PKIPREFIX%^$${PKIPREFIX}^g;" \
290                 -e "s^/var/^`pwd`/scratch/var/^g;" < \
291                 noit.conf.in > \
292                 noit.conf
293
294 test-stratcon.conf:     stratcon.conf.in Makefile
295         @sed -e "s^%sysconfdir%^`pwd`^g;" \
296                 -e "s^%modulesdir%^`pwd`/modules^g;" \
297                 -e "s^%modulesluadir%^`pwd`/modules-lua^g;" \
298                 -e "s^%iepbindir%^`pwd`/java^g;" \
299                 -e "s^%iepdbdir%^`pwd`/java^g;" \
300                 -e "s^%PKIPREFIX%^../test/test-^g;" < \
301                 stratcon.conf.in > \
302                 test-stratcon.conf
303
304 stratcon.conf:  stratcon.conf.in Makefile
305         @sed -e "s^%sysconfdir%^$(sysconfdir)^g;" \
306                 -e "s^%modulesdir%^$(MODULES_DIR)^g;" \
307                 -e "s^%modulesluadir%^$(MODULES_DIR)^g;" \
308                 -e "s^%iepbindir%^$(bindir)^g;" \
309                 -e "s^%iepdbdir%^$(localstatedir)/db/noit-iep^g;" \
310                 -e "s^%PKIPREFIX%^$${PKIPREFIX}^g;" < \
311                 stratcon.conf.in > \
312                 stratcon.conf
313
314 install-dirs:
315         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(bindir)
316         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(sbindir)
317         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(sysconfdir)
318
319 install-noitd-headers:  $(NOIT_HEADERS) install-headers
320         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)
321         for file in $(NOIT_HEADERS) ; do \
322                 $(INSTALL) -m 0644 $$file $(DESTDIR)$(includedir)/$$file ; \
323         done
324
325 install-stratcond-headers:      $(STRATCON_HEADERS) install-headers
326         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)
327         for file in $(STRATCON_HEADERS) ; do \
328                 $(INSTALL) -m 0644 $$file $(DESTDIR)$(includedir)/$$file ; \
329         done
330
331 install-headers:        $(HEADERS)
332         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(bindir)
333         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)
334         $(INSTALL) -m 0755 ../buildtools/xml2h $(DESTDIR)$(bindir)/noit-xml2h
335         $(INSTALL) -m 0755 scripts/noit-config $(DESTDIR)$(bindir)/noit-config
336         for file in $(HEADERS) ; do \
337                 $(INSTALL) -m 0644 $$file $(DESTDIR)$(includedir)/$$file ; \
338         done
339
340 noitlibs:       $(LIBNOIT_V) @MDB_MODS@
341
342 install-libs:    noitlibs
343         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(libdir)
344         $(INSTALL) -m 0755 $(LIBNOIT_V) $(DESTDIR)$(libdir)/$(LIBNOIT_V)
345         ln -sf $(LIBNOIT_V) $(DESTDIR)$(libdir)/$(LIBNOIT)
346
347 install-noitd:  install-libs install-noitd-nolibs
348
349 install-noitd-nolibs:   install-dirs reversion noitd noit.conf java-bits noit.env
350         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(datadir)/noit-web
351         $(INSTALL) -m 0755 scripts/noittrap $(DESTDIR)$(bindir)/noittrap
352         $(INSTALL) -m 0755 noitd $(DESTDIR)$(sbindir)/noitd
353         $(INSTALL) -m 0644 noit.conf $(DESTDIR)$(sysconfdir)/noit.conf.sample
354         $(INSTALL) -m 0644 noit.env $(DESTDIR)$(sysconfdir)/noit.env
355         $(INSTALL) -m 0644 config_templates.conf $(DESTDIR)$(sysconfdir)/config_templates.conf
356         $(INSTALL) -m 0644 default-ca-chain.crt $(DESTDIR)$(sysconfdir)/default-ca-chain.crt
357         (cd modules && $(MAKE) install-modules DESTDIR=$(DESTDIR))
358         (cd modules-lua && $(MAKE) install DESTDIR=$(DESTDIR))
359         (cd noit-web && tar cf - .) | (cd $(DESTDIR)$(datadir)/noit-web && tar xf -)
360         -test -n "@JAVAPARTS@" && (cd @JAVAPARTS@ && $(MAKE) install-jezebel DESTDIR=$(DESTDIR))
361
362 install-stratcond:      install-libs install-stratcond-nolibs
363
364 install-stratcond-nolibs:       install-dirs reversion stratcond stratcon.conf java-bits noit.env
365         $(INSTALL) -m 0755 stratcond $(DESTDIR)$(sbindir)/stratcond
366         $(INSTALL) -m 0644 stratcon.conf $(DESTDIR)$(sysconfdir)/stratcon.conf.sample
367         $(INSTALL) -m 0644 noit.env $(DESTDIR)$(sysconfdir)/stratcon.env
368         (cd modules && $(MAKE) install-smodules DESTDIR=$(DESTDIR))
369         -test -n "@JAVAPARTS@" && (cd @JAVAPARTS@ && $(MAKE) install-iep DESTDIR=$(DESTDIR))
370
371 install-docs:
372         (cd man && $(MAKE) install DESTDIR=$(DESTDIR))
373
374 install:        install-dirs install-docs install-headers install-noitd install-stratcond install-noitd-headers install-stratcond-headers
375
376 clean:
377         rm -f *.lo *.o $(TARGETS)
378         rm -f $(LIBNOIT)
379         rm -f module-online.h noit.env
380         rm -rf noit-objs stratcon-objs libnoit-objs
381         rm -rf mdb-support/*.lo mdb-support/*.so
382         (cd man && $(MAKE) clean)
383         (cd modules && $(MAKE) clean)
384         (cd java && $(MAKE) clean)
385
386 Makefile.noit.dep:
387         find noit-objs -name \*.o | sort | awk '{gsub("^.+-objs/", ""); print "noit-objs/"$$1": "$$1;}' > $@
388
389 Makefile.stratcon.dep:
390         find stratcon-objs -name \*.o | sort | awk '{gsub("^.+-objs/", ""); print "stratcon-objs/"$$1": "$$1;}' > $@
391
392 Makefile.dep:
393         $(CC) -I. $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) *.c > Makefile.dep
394         $(top_srcdir)/buildtools/culldeps.sh Makefile.dep
395
396 include Makefile.dep
397 include Makefile.noit.dep
398 include Makefile.stratcon.dep
399
400 distclean-subdirs:
401         for dir in man modules modules-lua java ; do \
402                 (cd $$dir && $(MAKE) distclean) ; \
403         done
404
405 distclean:      clean distclean-subdirs
406         rm -f Makefile noit_config.h scripts/noit-config
407
408 js/bundle.desc: bundle.proto
409         protoc -ojs/bundle.desc bundle.proto
410
411 bundle:
412         protoc bundle.proto --java_out=java
413         protoc-c bundle.proto --c_out=.
Note: See TracBrowser for help on using the browser.