root/src/Makefile.in

Revision 28c4109324e12a224d81ae1709cff469fd1f4711, 12.5 kB (checked in by Eric Sproul <esproul@omniti.com>, 2 months ago)

Restore build info, but prefixed to avoid colliding with libmtev

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