root/src/Makefile.in

Revision 37e31fd9f0e6a806307056bdfcd2f642317d283f, 9.4 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 3 years ago)

make the protobuf stuff consitent with the S/M record leaders.
fix up some code here and there.
extract the encapsulation into a helper file as we'll need it in
stratcond. Implement a de-encapsulation method.

  • Property mode set to 100644
Line 
1 .SUFFIXES: .re .c
2
3 CC=@CC@
4 CPPFLAGS=@CPPFLAGS@
5 CFLAGS=@CFLAGS@
6 PGCFLAGS=@PGCFLAGS@
7 LDFLAGS=@LDFLAGS@
8 DEPFLAGS=@DEPFLAGS@
9 AR=@AR@
10 RANLIB=@RANLIB@
11 LIBS=@LIBS@
12 INSTALL=@INSTALL@
13 XML2H=@top_srcdir@/buildtools/xml2h
14
15 prefix=@prefix@
16 exec_prefix=@exec_prefix@
17 bindir=@bindir@
18 sbindir=@sbindir@
19 libdir=@libdir@
20 includedir=${prefix}/include
21 libexecdir=@libexecdir@
22 localstatedir=@localstatedir@
23 datarootdir=@datarootdir@
24 mandir=@mandir@
25 mansubdir=@mansubdir@
26 docdir=${prefix}/@docdir@
27 sysconfdir=@sysconfdir@
28 srcdir=@srcdir@
29 top_srcdir=@top_srcdir@
30 MODULES_DIR=@MODULES_DIR@
31
32 WHOLE_ARCHIVE=@WHOLE_ARCHIVE@
33 NOWHOLE_ARCHIVE=@NOWHOLE_ARCHIVE@
34
35 TARGETS=noitd stratcond noit.conf test-noit.conf stratcon.conf test-stratcon.conf \
36         jlog/jlogctl
37
38 MODDIR=modules
39
40 HEADERS=noit_capabilities_listener.h noit_check.h noit_check_resolver.h \
41         noit_check_rest.h \
42         noit_check_tools_shared.h \
43         noit_check_tools.h noit_conf.h noit_conf_checks.h noit_conf_private.h \
44         noit_version.h \
45         noit_config.h noit_console.h noit_console_telnet.h noit_defines.h \
46         noit_filters.h noit_http.h noit_jlog_listener.h noit_listener.h \
47         noit_livestream_listener.h noit_module.h noit_rest.h noit_tokenizer.h \
48         noit_xml.h \
49         stratcon_datastore.h stratcon_iep.h stratcon_jlog_streamer.h \
50         stratcon_realtime_http.h \
51         eventer/OETS_asn1_helper.h eventer/eventer.h \
52         eventer/eventer_POSIX_fd_opset.h eventer/eventer_SSL_fd_opset.h \
53         eventer/eventer_jobq.h \
54         utils/noit_atomic.h utils/noit_b64.h utils/noit_hash.h \
55         utils/noit_log.h utils/noit_mkdir.h utils/noit_security.h \
56         utils/noit_sem.h utils/noit_skiplist.h utils/noit_str.h \
57         utils/noit_watchdog.h utils/noit_lockfile.h \
58         noitedit/chared.h noitedit/common.h noitedit/compat.h noitedit/el.h \
59         noitedit/el_term.h noitedit/emacs.h noitedit/fcns.h noitedit/fgetln.h \
60         noitedit/help.h noitedit/hist.h noitedit/histedit.h noitedit/key.h \
61         noitedit/map.h noitedit/parse.h noitedit/prompt.h noitedit/refresh.h \
62         noitedit/search.h noitedit/sig.h noitedit/strlcpy.h noitedit/sys.h \
63         noitedit/tokenizer.h noitedit/tty.h noitedit/vi.h \
64         jlog/jlog.h jlog/jlog_config.h jlog/jlog_hash.h jlog/jlog_io.h
65
66 NOIT_OBJS=noitd.o noit_listener.o \
67         noit_console.o noit_console_state.o noit_console_telnet.o \
68         noit_console_complete.o noit_check_resolver.o \
69         noit_check_tools_shared.o noit_check_log_helpers.o \
70         noit_check.o noit_check_log.o noit_check_tools.o \
71         noit_module.o noit_conf.o noit_conf_checks.o noit_tokenizer.o \
72         noit_capabilities_listener.o noit_xml.o \
73         noit_jlog_listener.o noit_livestream_listener.o noit_filters.o \
74         noit_http.o noit_rest.o noit_check_rest.o noit_filters_rest.o \
75         bundle.pb-c.o
76
77 NOIT_LIBS=libudns libnoitedit libeventer libjlog libnoit_utils libnoitjson
78 NOIT_LIB_FILES=udns/libudns.o noitedit/libnoitedit.a eventer/libeventer.a \
79         jlog/libjlog.a utils/libnoit_utils.a json-lib/libnoitjson.a
80
81 STRATCON_OBJS=stratcond.o noit_listener.o \
82         noit_console.o noit_console_state.o noit_console_telnet.o \
83         noit_console_complete.o noit_xml.o \
84         noit_conf.o noit_http.o noit_rest.o noit_tokenizer.o \
85         noit_capabilities_listener.o noit_module.o \
86         noit_check_tools_shared.o noit_check_log_helpers.o \
87         stratcon_realtime_http.o \
88         stratcon_jlog_streamer.o stratcon_datastore.o \
89         stratcon_iep.o \
90         bundle.pb-c.o
91
92 STRATCON_LIBS=libudns libnoitedit libeventer libjlog libnoit_utils libnoitjson
93 STRATCON_LIB_FILES=udns/libudns.o noitedit/libnoitedit.a eventer/libeventer.a \
94         jlog/libjlog.a utils/libnoit_utils.a json-lib/libnoitjson.a
95
96 all:    $(NOIT_LIBS) $(STRATCON_LIBS) $(TARGETS) java-bits make-modules make-man
97
98 make-man:
99         @(cd man && $(MAKE) -s)
100
101 lua/liblua.lo:
102         @echo "- building lua bits"
103         @(cd lua && $(MAKE) -s liblua.lo)
104
105 make-modules:   lua/liblua.lo
106         @for dir in $(MODDIR) ; do \
107                 (cd $$dir && $(MAKE) -s) ; \
108         done
109
110 java-bits:
111         @-test -n "@JAVAPARTS@" && (cd java && $(MAKE) -s)
112
113 libjlog:
114         @(cd jlog && $(MAKE) -s libjlog.a)
115
116 jlog/jlogctl:
117         @echo "- building jlogctl"
118         @(cd jlog && $(MAKE) -s jlogctl)
119
120 libudns:
121         @(cd udns && $(MAKE) -s libudns.o)
122
123 libnoitedit:
124         @(cd noitedit && $(MAKE) -s libnoitedit.a)
125
126 libeventer:
127         @(cd eventer && $(MAKE) -s libeventer.a)
128
129 libnoit_utils:
130         @(cd utils && $(MAKE) -s libnoit_utils.a)
131
132 libnoitjson:
133         @(cd json-lib && $(MAKE) -s libnoitjson.a)
134
135 jlog/libjlog.a: libjlog
136 udns/libudns.o: libudns
137 noitedit/libnoitedit.a: libnoitedit
138 eventer/libeventer.a:   libeventer
139 utils/libnoit_utils.a:  libnoit_utils
140 json-lib/libnoitjson.a: libnoitjson
141
142 .PHONY: noit_version.h
143
144 noit_version.h:
145         @$(top_srcdir)/buildtools/mkversion.sh noit_version.h
146
147 man/noitd.usage.h:      make-man
148
149 man/stratcond.usage.h:  make-man
150
151
152 noitd.o:        man/noitd.usage.h
153 stratcond.o:    man/stratcond.usage.h
154
155 noitd:  $(NOIT_OBJS) $(NOIT_LIB_FILES) man/noitd.usage.h
156         @echo "- linking $@"
157         @$(CC) -o $@ $(NOIT_OBJS) \
158                 udns/libudns.o \
159                 $(LDFLAGS) \
160                 $(WHOLE_ARCHIVE) \
161                 -Leventer -leventer \
162                 utils/*.o \
163                 json-lib/*.o \
164                 -Ljlog -ljlog \
165                 -Lnoitedit -lnoitedit \
166                 $(NOWHOLE_ARCHIVE) \
167                 $(LIBS)
168
169 stratcond:      $(STRATCON_OBJS) $(STRATCON_LIB_FILES)
170         @echo "- linking $@"
171         @$(CC) -o $@ $(STRATCON_OBJS) \
172                 udns/libudns.o \
173                 $(LDFLAGS) \
174                 $(WHOLE_ARCHIVE) \
175                 -Leventer -leventer \
176                 utils/*.o \
177                 json-lib/*.o \
178                 -Ljlog -ljlog \
179                 -Lnoitedit -lnoitedit \
180                 $(NOWHOLE_ARCHIVE) \
181                 $(LIBS)
182
183 stratcon_datastore.o:   stratcon_datastore.c
184         @$(CC) $(CPPFLAGS) $(PGCFLAGS) $(CFLAGS) -c $<
185         @echo "- compiling $<"
186
187 .c.o:
188         @$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
189         @echo "- compiling $<"
190
191 noit_module.o:  module-online.h
192
193 module-online.h:        modules/module-online.xsl
194         @echo "- making module-online.h (StyleSheet include)"
195         @$(XML2H) helpStyleXML < modules/module-online.xsl > $@
196
197 noit_tokenizer.c:
198         @re2c -o $@ noit_tokenizer.re
199         @echo "- re2c noit_tokenizer.re"
200
201 test-noit.conf: noit.conf.in Makefile
202         @sed -e "s^%sysconfdir%^`pwd`^g;" \
203                 -e "s^%modulesdir%^`pwd`/modules^g;" \
204                 -e "s^%modulesluadir%^`pwd`/modules-lua^g;" \
205                 -e "s^%PKIPREFIX%^../test/test-^g;" < \
206                 noit.conf.in > \
207                 test-noit.conf
208
209 noit.conf:      noit.conf.in Makefile
210         @sed -e "s^%sysconfdir%^$(sysconfdir)^g;" \
211                 -e "s^%modulesdir%^$(MODULES_DIR)^g;" \
212                 -e "s^%modulesluadir%^$(MODULES_DIR)^g;" \
213                 -e "s^%PKIPREFIX%^$${PKIPREFIX}^g;" < \
214                 noit.conf.in > \
215                 noit.conf
216
217 test-stratcon.conf:     stratcon.conf.in Makefile
218         @sed -e "s^%sysconfdir%^`pwd`^g;" \
219                 -e "s^%modulesdir%^`pwd`/modules^g;" \
220                 -e "s^%modulesluadir%^`pwd`/modules-lua^g;" \
221                 -e "s^%iepbindir%^`pwd`/java^g;" \
222                 -e "s^%iepdbdir%^`pwd`/java^g;" \
223                 -e "s^%PKIPREFIX%^../test/test-^g;" < \
224                 stratcon.conf.in > \
225                 test-stratcon.conf
226
227 stratcon.conf:  stratcon.conf.in Makefile
228         @sed -e "s^%sysconfdir%^$(sysconfdir)^g;" \
229                 -e "s^%modulesdir%^$(MODULES_DIR)^g;" \
230                 -e "s^%modulesluadir%^$(MODULES_DIR)^g;" \
231                 -e "s^%iepbindir%^$(bindir)^g;" \
232                 -e "s^%iepdbdir%^$(localstatedir)/db/noit-iep^g;" \
233                 -e "s^%PKIPREFIX%^$${PKIPREFIX}^g;" < \
234                 stratcon.conf.in > \
235                 stratcon.conf
236
237 install-dirs:
238         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(bindir)
239         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(sbindir)
240         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(sysconfdir)
241
242 install-headers:        $(HEADERS)
243         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(bindir)
244         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)
245         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/eventer
246         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/utils
247         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/noitedit
248         $(top_srcdir)/buildtools/mkinstalldirs $(DESTDIR)$(includedir)/jlog
249         $(INSTALL) -m 0755 scripts/noit-config $(DESTDIR)$(bindir)/noit-config
250         for file in $(HEADERS) ; do \
251                 $(INSTALL) -m 0644 $$file $(DESTDIR)$(includedir)/$$file ; \
252         done
253
254 install-noitd:  install-dirs noitd noit.conf java-bits jlog/jlogctl
255         $(INSTALL) -m 0755 scripts/noittrap $(DESTDIR)$(bindir)/noittrap
256         $(INSTALL) -m 0755 jlog/jlogctl $(DESTDIR)$(bindir)/noit_jlogctl
257         $(INSTALL) -m 0755 noitd $(DESTDIR)$(sbindir)/noitd
258         $(INSTALL) -m 0644 noit.conf $(DESTDIR)$(sysconfdir)/noit.conf.sample
259         $(INSTALL) -m 0644 config_templates.conf $(DESTDIR)$(sysconfdir)/config_templates.conf
260         $(INSTALL) -m 0644 default-ca-chain.crt $(DESTDIR)$(sysconfdir)/default-ca-chain.crt
261         (cd modules && $(MAKE) install-modules DESTDIR=$(DESTDIR))
262         (cd modules-lua && $(MAKE) install DESTDIR=$(DESTDIR))
263         -test -n "@JAVAPARTS@" && (cd @JAVAPARTS@ && $(MAKE) install-jezebel DESTDIR=$(DESTDIR))
264
265 install-stratcond:      install-dirs stratcond stratcon.conf java-bits
266         $(INSTALL) -m 0755 stratcond $(DESTDIR)$(sbindir)/stratcond
267         $(INSTALL) -m 0644 stratcon.conf $(DESTDIR)$(sysconfdir)/stratcon.conf.sample
268         (cd modules && $(MAKE) install-smodules DESTDIR=$(DESTDIR))
269         -test -n "@JAVAPARTS@" && (cd @JAVAPARTS@ && $(MAKE) install-iep DESTDIR=$(DESTDIR))
270
271 install-docs:
272         (cd man && $(MAKE) install DESTDIR=$(DESTDIR))
273
274 install:        install-dirs install-docs install-headers install-noitd install-stratcond
275
276 clean:
277         rm -f *.o $(TARGETS)
278         rm -f module-online.h
279         (cd jlog && $(MAKE) clean)
280         (cd eventer && $(MAKE) clean)
281         (cd udns && $(MAKE) clean)
282         (cd man && $(MAKE) clean)
283         (cd modules && $(MAKE) clean)
284         (cd noitedit && $(MAKE) clean)
285         (cd utils && $(MAKE) clean)
286         (cd json-lib && $(MAKE) clean)
287         (cd lua && $(MAKE) clean)
288         (cd java && $(MAKE) clean)
289
290 Makefile.dep:
291         $(CC) -I. $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) *.c > Makefile.dep
292         $(top_srcdir)/buildtools/culldeps.sh Makefile.dep
293
294 include Makefile.dep
295
296 distclean-subdirs:
297         for dir in jlog eventer udns man modules modules-lua noitedit utils json-lib lua java ; do \
298                 (cd $$dir && $(MAKE) distclean) ; \
299         done
300
301 distclean:      clean distclean-subdirs
302         rm -f Makefile noit_config.h scripts/noit-config
303
Note: See TracBrowser for help on using the browser.