root/src/Makefile.in

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

don't remove original debugging sections on merge

  • Property mode set to 100644
Line 
1 .SUFFIXES: .re .c
2
3 CC=@CC@
4 CPPFLAGS=@CPPFLAGS@
5 CFLAGS=@CFLAGS@
6 CLINKFLAGS=@CLINKFLAGS@
7 LUACFLAGS=@LUACFLAGS@
8 PGCFLAGS=@PGCFLAGS@
9 LDFLAGS=@LDFLAGS@
10 DEPFLAGS=@DEPFLAGS@
11 AR=@AR@
12 RANLIB=@RANLIB@
13 LIBS=@LIBS@
14 INSTALL=@INSTALL@
15 XML2H=@top_srcdir@/buildtools/xml2h
16 MAPFLAGS=@MAPFLAGS@
17 CTFCONVERT=@CTFCONVERT@
18 CTFMERGE=@CTFMERGE@
19
20 prefix=@prefix@
21 exec_prefix=@exec_prefix@
22 bindir=@bindir@
23 sbindir=@sbindir@
24 libdir=@libdir@
25 includedir=${prefix}/include
26 libexecdir=@libexecdir@
27 localstatedir=@localstatedir@
28 datarootdir=@datarootdir@
29 datadir=@datadir@
30 mandir=@mandir@
31 mansubdir=@mansubdir@
32 docdir=${prefix}/@docdir@
33 sysconfdir=@sysconfdir@
34 srcdir=@srcdir@
35 top_srcdir=@top_srcdir@
36 MODULES_DIR=@MODULES_DIR@
37
38 WHOLE_ARCHIVE=@WHOLE_ARCHIVE@
39 NOWHOLE_ARCHIVE=@NOWHOLE_ARCHIVE@
40
41 DTRACEOBJ=@DTRACEOBJ@
42 NOITD_DTRACEOBJ=$(DTRACEOBJ:%dtrace_stub.o=noitd_%dtrace_stub.o)
43 STRATCOND_DTRACEOBJ=$(DTRACEOBJ:%dtrace_stub.o=stratcond_%dtrace_stub.o)
44
45 TARGETS=noitd stratcond noit.conf test-noit.conf stratcon.conf test-stratcon.conf \
46         jlog/jlogctl
47
48 all:    reversion $(TARGETS) java-bits make-modules make-man
49
50 MODDIR=modules
51
52 HEADERS=noit_capabilities_listener.h noit_check.h noit_check_resolver.h \
53         noit_check_rest.h \
54         noit_check_tools_shared.h \
55         noit_check_tools.h noit_conf.h noit_conf_checks.h noit_conf_private.h \
56         noit_version.h \
57         noit_config.h noit_console.h noit_console_telnet.h noit_defines.h \
58         noit_filters.h noit_http.h noit_jlog_listener.h noit_listener.h \
59         noit_livestream_listener.h noit_main.h noit_module.h noit_rest.h \
60         noit_tokenizer.h noit_xml.h \
61         stratcon_datastore.h stratcon_iep.h stratcon_jlog_streamer.h \
62         stratcon_realtime_http.h \
63         eventer/OETS_asn1_helper.h eventer/eventer.h \
64         eventer/eventer_POSIX_fd_opset.h eventer/eventer_SSL_fd_opset.h \
65         eventer/eventer_jobq.h \
66         utils/noit_atomic.h utils/noit_b64.h utils/noit_hash.h \
67         utils/noit_log.h utils/noit_mkdir.h utils/noit_security.h \
68         utils/noit_sem.h utils/noit_skiplist.h utils/noit_str.h \
69         utils/noit_watchdog.h utils/noit_lockfile.h \
70         utils/noit_hooks.h \
71         noitedit/chared.h noitedit/common.h noitedit/compat.h noitedit/el.h \
72         noitedit/el_term.h noitedit/emacs.h noitedit/fcns.h noitedit/fgetln.h \
73         noitedit/help.h noitedit/hist.h noitedit/histedit.h noitedit/key.h \
74         noitedit/map.h noitedit/parse.h noitedit/prompt.h noitedit/refresh.h \
75         noitedit/search.h noitedit/sig.h noitedit/strlcpy.h noitedit/sys.h \
76         noitedit/tokenizer.h noitedit/tty.h noitedit/vi.h \
77         jlog/jlog.h jlog/jlog_config.h jlog/jlog_hash.h jlog/jlog_io.h
78
79 include Makefile.objs
80
81 NOIT_OBJS=noitd.o noit_main.o noit_listener.o \
82         noit_console.o noit_console_state.o noit_console_telnet.o \
83         noit_console_complete.o noit_check_resolver.o \
84         noit_check_tools_shared.o noit_check_log_helpers.o \
85         noit_check.o noit_check_log.o noit_check_tools.o \
86         noit_module.o noit_conf.o noit_conf_checks.o noit_tokenizer.o \
87         noit_capabilities_listener.o noit_xml.o \
88         noit_jlog_listener.o noit_livestream_listener.o noit_filters.o \
89         noit_http.o noit_rest.o noit_check_rest.o noit_filters_rest.o \
90         noit_reverse_socket.o noit_events_rest.o bundle.pb-c.o \
91         $(UDNS_LIB_OBJS) $(NOITEDIT_LIB_OBJS) $(EVENTER_LIB_OBJS) \
92         $(JLOG_LIB_OBJS) $(NOIT_UTILS_OBJS) $(JSON_LIB_OBJS) $(YAJL_LIB_OBJS) \
93         $(LUA_OBJS)
94
95 NOIT_LIBS=libudns libnoitedit libeventer libjlog libnoit_utils libnoitjson libnoityajl
96 NOIT_LIB_FILES=udns/libudns.o noitedit/libnoitedit.a eventer/libeventer.a \
97         jlog/libjlog.a utils/libnoit_utils.a json-lib/libnoitjson.a yajl-lib/libnoityajl.a
98
99 STRATCON_OBJS=stratcond.o noit_main.o noit_listener.o \
100         noit_console.o noit_console_state.o noit_console_telnet.o \
101         noit_console_complete.o noit_xml.o \
102         noit_conf.o noit_http.o noit_rest.o noit_tokenizer.o \
103         noit_capabilities_listener.o noit_module.o \
104         noit_events_rest.o noit_check_tools_shared.o noit_check_log_helpers.o \
105         noit_reverse_socket.o \
106         stratcon_realtime_http.o \
107         stratcon_jlog_streamer.o stratcon_datastore.o \
108         stratcon_iep.o \
109         bundle.pb-c.o \
110         $(UDNS_LIB_OBJS) $(NOITEDIT_LIB_OBJS) $(EVENTER_LIB_OBJS) \
111         $(JLOG_LIB_OBJS) $(NOIT_UTILS_OBJS) $(JSON_LIB_OBJS) $(YAJL_LIB_OBJS)
112
113 FINAL_STRATCON_OBJS=$(STRATCON_OBJS:%.o=stratcon-objs/%.o)
114 FINAL_NOIT_OBJS=$(NOIT_OBJS:%.o=noit-objs/%.o)
115
116 lua/src/lua:
117         (cd lua/src && $(MAKE) lua)
118
119 noit-objs/%.o:  %.o
120         @mkdir -p "`dirname $@`"
121         @echo "- making private $@"
122         @cp $(@:noit-objs/%.o=%.o) $@
123         @if test -x "$(CTFCONVERT)" ; then \
124                 echo "- making CTF ($@)" ; \
125                 $(CTFCONVERT) -g -i -l @VERSION@ $@ ; \
126         fi
127
128 stratcon-objs/%.o:      %.o
129         @mkdir -p "`dirname $@`"
130         @echo "- making private $@"
131         @cp $(@:stratcon-objs/%.o=%.o) $@
132         @if test -x "$(CTFCONVERT)" ; then \
133                 echo "- making CTF ($@)" ; \
134                 $(CTFCONVERT) -g -i -l @VERSION@ $@ ; \
135         fi
136
137 make-man:
138         @(cd man && $(MAKE) -s)
139
140 make-modules:
141         @for dir in $(MODDIR) ; do \
142                 (cd $$dir && $(MAKE) -s) ; \
143         done
144
145 java-bits:
146         @-test -n "@JAVAPARTS@" && (cd java && $(MAKE) -s)
147
148 jlog/jlogctl:
149         @echo "- building jlogctl"
150         @(cd jlog && $(MAKE) -s jlogctl)
151
152 .PHONY: reversion
153
154 reversion:
155         @$(top_srcdir)/buildtools/mkversion.sh noit_version.h
156
157 noit_version.h:
158         @$(top_srcdir)/buildtools/mkversion.sh noit_version.h
159
160 man/noitd.usage.h:      make-man
161
162 man/stratcond.usage.h:  make-man
163
164
165 noitd.o:        man/noitd.usage.h
166 stratcond.o:    man/stratcond.usage.h
167
168 stratcon_jlog_streamer.o:       noit_@DTRACEHDR@ stratcon_@DTRACEHDR@
169 noit_check_tools.o:     noit_@DTRACEHDR@ stratcon_@DTRACEHDR@
170 noit_check.o:   noit_@DTRACEHDR@ stratcon_@DTRACEHDR@
171 dtrace_probes.h:        noit_@DTRACEHDR@ stratcon_@DTRACEHDR@
172
173 stratcond_@DTRACEOBJ@:    $(FINAL_STRATCON_OBJS)
174         @echo "- assembling $@" && \
175         @DTRACE@ @DTRACEFLAGS@ -Z -G -s stratcon_dtrace_probes.d -o stratcond_@DTRACEOBJ@ $(FINAL_STRATCON_OBJS)
176
177 noitd_@DTRACEOBJ@:    $(FINAL_NOIT_OBJS)
178         @echo "- assembling $@" && \
179         @DTRACE@ @DTRACEFLAGS@ -Z -G -s noit_dtrace_probes.d -o noitd_@DTRACEOBJ@ $(FINAL_NOIT_OBJS)
180
181 noit_@DTRACEHDR@:    noit_dtrace_probes.d
182         @if test -z "@DTRACE@" ; then \
183                 echo "- faking dtrace header" ; \
184                 cp ./noit_@DTRACEHDR@.stock ./noit_@DTRACEHDR@ ; \
185         else \
186                 echo "- building dtrace header $@" ; \
187                 @DTRACE@ -h -s noit_dtrace_probes.d ; \
188         fi
189
190 stratcon_@DTRACEHDR@:    stratcon_dtrace_probes.d
191         @if test -z "@DTRACE@" ; then \
192                 echo "- faking dtrace header" ; \
193                 cp ./stratcon_@DTRACEHDR@.stock ./stratcon_@DTRACEHDR@ ; \
194         else \
195                 echo "- building dtrace header $@" ; \
196                 @DTRACE@ -h -s stratcon_dtrace_probes.d ; \
197         fi
198
199 noitd:  $(FINAL_NOIT_OBJS) man/noitd.usage.h $(NOITD_DTRACEOBJ)
200         @echo "- linking $@"
201         @$(CC) $(CLINKFLAGS) -o $@ $(FINAL_NOIT_OBJS) \
202                 $(NOITD_DTRACEOBJ) \
203                 $(LDFLAGS) \
204                 $(MAPFLAGS) \
205                 $(LIBS)
206         @if test -x "$(CTFMERGE)" ; then \
207                 $(CTFMERGE) -g -l @VERSION@ -o $@ $(FINAL_NOIT_OBJS) $(NOITD_DTRACEOBJ) ; \
208         fi
209
210 stratcond:      $(FINAL_STRATCON_OBJS) $(STRATCOND_DTRACEOBJ)
211         @echo "- linking $@"
212         @$(CC) $(CLINKFLAGS) -o $@ $(FINAL_STRATCON_OBJS) \
213                 $(STRATCOND_DTRACEOBJ) \
214                 $(LDFLAGS) \
215                 $(MAPFLAGS) \
216                 $(LIBS)
217         @if test -x "$(CTFMERGE)" ; then \
218                 $(CTFMERGE) -g -l @VERSION@ -o $@ $(FINAL_STRATCON_OBJS) $(STRATCOND_DTRACEOBJ) ; \
219         fi
220
221 stratcon_datastore.o:   stratcon_datastore.c
222         @echo "- compiling $<"
223         @$(CC) $(CPPFLAGS) $(PGCFLAGS) $(CFLAGS) -c $<
224
225 .c.o:
226         @if [ "`dirname $@`" != "." ] ; then \
227                 (cd "`dirname $@`" && $(MAKE) "`basename $@`") ; \
228         else \
229                 echo "- compiling $<" ; \
230                 $(CC) $(CPPFLAGS) $(CFLAGS) -c $< ; \
231         fi
232
233 udns/udns_codes.c:
234         @(cd udns && $(MAKE) udns_codes.c)
235
236 utils/noit_atomic_sol_sparcv8plus.o:    utils/noit_atomic_sol.s
237         @(cd utils && $(MAKE) noit_atomic_sol_sparcv8plus.o)
238
239 utils/noit_atomic_sol_sparcv9.o:        utils/noit_atomic_sol.s
240         @(cd utils && $(MAKE) noit_atomic_sol_sparcv9.o)
241
242 utils/noit_atomic_sol_x86_32.o: utils/noit_atomic_sol.s
243         @(cd utils && $(MAKE) noit_atomic_sol_x86_32.o)
244
245 utils/noit_atomic_sol_x86_64.o: utils/noit_atomic_sol.s
246         @(cd utils && $(MAKE) noit_atomic_sol_x86_64.o)
247
248 noit_module.o:  module-online.h
249
250 module-online.h:        modules/module-online.xsl
251         @echo "- making module-online.h (StyleSheet include)"
252         @$(XML2H) helpStyleXML < modules/module-online.xsl > $@
253
254 noit_tokenizer.c:
255         @echo "- re2c noit_tokenizer.re"
256         @re2c -o $@ noit_tokenizer.re
257
258 test-noit.conf: noit.conf.in Makefile
259         @sed -e "s^%sysconfdir%^`pwd`^g;" \
260                 -e "s^%modulesdir%^`pwd`/modules^g;" \
261                 -e "s^%modulesluadir%^`pwd`/modules-lua^g;" \
262                 -e "s^%datarootdir%^`pwd`^g;" \
263                 -e "s^%PKIPREFIX%^../test/test-^g;" < \
264                 noit.conf.in > \
265                 test-noit.conf
266
267 noit.conf:      noit.conf.in Makefile
268         @sed -e "s^%sysconfdir%^$(sysconfdir)^g;" \
269                 -e "s^%modulesdir%^$(MODULES_DIR)^g;" \
270                 -e "s^%modulesluadir%^$(MODULES_DIR)^g;" \
271                 -e "s^%datarootdir%^$(datadir)^g;" \
272                 -e "s^%PKIPREFIX%^$${PKIPREFIX}^g;" < \
273                 noit.conf.in > \
274                 noit.conf
275
276 test-stratcon.conf:     stratcon.conf.in Makefile
277         @sed -e "s^%sysconfdir%^`pwd`^g;" \
278                 -e "s^%modulesdir%^`pwd`/modules^g;" \
279                 -e "s^%modulesluadir%^`pwd`/modules-lua^g;" \
280                 -e "s^%iepbindir%^`pwd`/java^g;" \
281                 -e "s^%iepdbdir%^`pwd`/java^g;" \
282                 -e "s^%PKIPREFIX%^../test/test-^g;" < \
283                 stratcon.conf.in > \
284                 test-stratcon.conf
285
286 stratcon.conf:  stratcon.conf.in Makefile
287         @sed -e "s^%sysconfdir%^$(sysconfdir)^g;" \
288                 -e "s^%modulesdir%^$(MODULES_DIR)^g;" \
289                 -e "s^%modulesluadir%^$(MODULES_DIR)^g;" \
290                 -e "s^%iepbindir%^$(bindir)^g;" \
291                 -e "s^%iepdbdir%^$(localstatedir)/db/noit-iep^g;" \
292                 -e "s^%PKIPREFIX%^$${PKIPREFIX}^g;" < \
293                 stratcon.conf.in > \
294                 stratcon.conf
295
296 install-dirs:
297         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(bindir)
298         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(sbindir)
299         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(sysconfdir)
300         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(datadir)/noit-web
301
302 install-headers:        $(HEADERS)
303         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(bindir)
304         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)
305         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/eventer
306         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/utils
307         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/noitedit
308         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/jlog
309         $(INSTALL) -m 0755 ../buildtools/xml2h $(DESTDIR)$(bindir)/noit-xml2h
310         $(INSTALL) -m 0755 scripts/noit-config $(DESTDIR)$(bindir)/noit-config
311         for file in $(HEADERS) ; do \
312                 $(INSTALL) -m 0644 $$file $(DESTDIR)$(includedir)/$$file ; \
313         done
314
315 install-noitd:  install-dirs reversion noitd noit.conf java-bits jlog/jlogctl
316         $(INSTALL) -m 0755 scripts/noittrap $(DESTDIR)$(bindir)/noittrap
317         $(INSTALL) -m 0755 jlog/jlogctl $(DESTDIR)$(bindir)/noit_jlogctl
318         $(INSTALL) -m 0755 noitd $(DESTDIR)$(sbindir)/noitd
319         $(INSTALL) -m 0644 noit.conf $(DESTDIR)$(sysconfdir)/noit.conf.sample
320         $(INSTALL) -m 0644 config_templates.conf $(DESTDIR)$(sysconfdir)/config_templates.conf
321         $(INSTALL) -m 0644 default-ca-chain.crt $(DESTDIR)$(sysconfdir)/default-ca-chain.crt
322         (cd modules && $(MAKE) install-modules DESTDIR=$(DESTDIR))
323         (cd modules-lua && $(MAKE) install DESTDIR=$(DESTDIR))
324         (cd noit-web && tar cf - .) | (cd $(DESTDIR)$(datadir)/noit-web && tar xf -)
325         -test -n "@JAVAPARTS@" && (cd @JAVAPARTS@ && $(MAKE) install-jezebel DESTDIR=$(DESTDIR))
326
327 install-stratcond:      install-dirs reversion stratcond stratcon.conf java-bits
328         $(INSTALL) -m 0755 stratcond $(DESTDIR)$(sbindir)/stratcond
329         $(INSTALL) -m 0644 stratcon.conf $(DESTDIR)$(sysconfdir)/stratcon.conf.sample
330         (cd modules && $(MAKE) install-smodules DESTDIR=$(DESTDIR))
331         -test -n "@JAVAPARTS@" && (cd @JAVAPARTS@ && $(MAKE) install-iep DESTDIR=$(DESTDIR))
332
333 install-docs:
334         (cd man && $(MAKE) install DESTDIR=$(DESTDIR))
335
336 install:        install-dirs install-docs install-headers install-noitd install-stratcond
337
338 clean:
339         rm -f *.o $(TARGETS) $(LUA_OBJS)
340         rm -f module-online.h
341         rm -rf noit-objs stratcon-objs
342         (cd jlog && $(MAKE) clean)
343         (cd eventer && $(MAKE) clean)
344         (cd udns && $(MAKE) clean)
345         (cd man && $(MAKE) clean)
346         (cd modules && $(MAKE) clean)
347         (cd noitedit && $(MAKE) clean)
348         (cd utils && $(MAKE) clean)
349         (cd json-lib && $(MAKE) clean)
350         (cd yajl-lib && $(MAKE) clean)
351         (cd java && $(MAKE) clean)
352         (cd LuaJIT && $(MAKE) clean)
353         (cd lua/src && $(MAKE) clean)
354
355 Makefile.noit.dep:
356         find noit-objs -name \*.o | grep -v 'eventer_.*_impl.o' | sort | awk '{gsub("^.+-objs/", ""); print "noit-objs/"$$1": "$$1;}' > $@
357         for impl in kqueue ports epoll; do \
358                 echo "noit-objs/eventer/eventer_$${impl}_impl.o: eventer/eventer_$${impl}_impl.o" >> $@ ; \
359         done
360
361 Makefile.stratcon.dep:
362         find stratcon-objs -name \*.o | grep -v 'eventer_.*_impl.o' | sort | awk '{gsub("^.+-objs/", ""); print "stratcon-objs/"$$1": "$$1;}' > $@
363         for impl in kqueue ports epoll; do \
364                 echo "stratcon-objs/eventer/eventer_$${impl}_impl.o: eventer/eventer_$${impl}_impl.o" >> $@ ; \
365         done
366
367 Makefile.dep:
368         $(CC) -I. $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) *.c > Makefile.dep
369         for d in utils jlog udns eventer noitedit json-lib yajl-lib; do \
370                 $(CC) -I. $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) $$d/*.c | \
371                 perl -pe 's#(\s)([^\s\\])#$$1$$2#g; s#^(\S)#'$$d'/$$1#;' >> \
372                 Makefile.dep ; \
373         done
374         $(top_srcdir)/buildtools/culldeps.sh Makefile.dep
375
376 include Makefile.dep
377 include Makefile.noit.dep
378 include Makefile.stratcon.dep
379
380 distclean-subdirs:
381         for dir in jlog eventer udns man modules modules-lua noitedit utils json-lib yajl-lib LuaJIT lua/src java ; do \
382                 (cd $$dir && $(MAKE) distclean) ; \
383         done
384
385 distclean:      clean distclean-subdirs
386         rm -f Makefile noit_config.h scripts/noit-config
387
388 bundle:
389         protoc bundle.proto --java_out=java
390         protoc-c bundle.proto --c_out=.
Note: See TracBrowser for help on using the browser.