root/src/Makefile.in

Revision 31dee091d67e2a43774f63671b5fd9ccb09d8373, 12.4 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 3 hours ago)

have noitd and stratcond directly link libnoit objects

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