xref: /freebsd/usr.bin/kyua/Makefile (revision 4543ef516683042d46f3bd3bb8a4f3f746e00499)
1
2.include <src.opts.mk>
3
4KYUA_CONFDIR=	/etc/kyua
5KYUA_DOCDIR=	/usr/share/doc/kyua
6KYUA_EGDIR=	/usr/share/examples/kyua
7KYUA_MISCDIR=	/usr/share/kyua/misc
8KYUA_STOREDIR=	/usr/share/kyua/store
9KYUA_VERSION=	0.13
10
11KYUA_SRCDIR=	${SRCTOP}/contrib/kyua
12.PATH: ${KYUA_SRCDIR}
13
14PACKAGE=	tests
15PROG_CXX=	kyua
16SRCS=		main.cpp
17LIBADD=		lutok sqlite3
18
19MAN=		kyua-about.1 \
20		kyua-config.1 \
21		kyua-db-exec.1 \
22		kyua-db-migrate.1 \
23		kyua-debug.1 \
24		kyua-help.1 \
25		kyua-list.1 \
26		kyua-report-html.1 \
27		kyua-report-junit.1 \
28		kyua-report.1 \
29		kyua-test.1 \
30		kyua.1 \
31		kyua.conf.5 \
32		kyuafile.5
33
34CFLAGS+=	-I${KYUA_SRCDIR} -I${.CURDIR}
35CFLAGS+=	-I${SRCTOP}/contrib/lutok/include
36CFLAGS+=	-I${SRCTOP}/contrib/sqlite3
37# kyua uses auto_ptr
38CFLAGS+=	-Wno-deprecated-declarations
39CXXSTD=		c++11
40CFLAGS+=	-DHAVE_CONFIG_H
41
42# We compile the kyua libraries as part of the main executable as this saves
43# compile time and we don't install them anyway.
44CFLAGS+=	-DGDB=\"/usr/local/bin/gdb\"			\
45		-DKYUA_ARCHITECTURE=\"${MACHINE_ARCH}\"		\
46		-DKYUA_CONFDIR=\"${KYUA_CONFDIR}\"		\
47		-DKYUA_DOCDIR=\"${KYUA_DOCDIR}\"		\
48		-DKYUA_MISCDIR=\"${KYUA_MISCDIR}\"		\
49		-DKYUA_PLATFORM=\"${MACHINE}\"			\
50		-DKYUA_STOREDIR=\"${KYUA_STOREDIR}\"		\
51		-DPACKAGE=\"kyua\"				\
52		-DPACKAGE_NAME=\"Kyua\"				\
53		-DPACKAGE_VERSION=\"${KYUA_VERSION}\"		\
54		-DVERSION=\"${KYUA_VERSION}\"
55
56SRCS+=	utils/datetime.cpp			\
57	utils/env.cpp				\
58	utils/memory.cpp			\
59	utils/passwd.cpp			\
60	utils/sanity.cpp			\
61	utils/stacktrace.cpp			\
62	utils/stream.cpp			\
63	utils/units.cpp				\
64	utils/cmdline/base_command.cpp		\
65	utils/cmdline/exceptions.cpp		\
66	utils/cmdline/globals.cpp		\
67	utils/cmdline/options.cpp		\
68	utils/cmdline/parser.cpp		\
69	utils/cmdline/ui.cpp			\
70	utils/cmdline/ui_mock.cpp		\
71	utils/config/exceptions.cpp		\
72	utils/config/keys.cpp			\
73	utils/config/lua_module.cpp		\
74	utils/config/nodes.cpp			\
75	utils/config/parser.cpp			\
76	utils/config/tree.cpp			\
77	utils/format/exceptions.cpp		\
78	utils/format/formatter.cpp		\
79	utils/fs/auto_cleaners.cpp		\
80	utils/fs/directory.cpp			\
81	utils/fs/exceptions.cpp			\
82	utils/fs/lua_module.cpp			\
83	utils/fs/operations.cpp			\
84	utils/fs/path.cpp			\
85	utils/logging/operations.cpp		\
86	utils/process/child.cpp			\
87	utils/process/deadline_killer.cpp	\
88	utils/process/exceptions.cpp		\
89	utils/process/executor.cpp		\
90	utils/process/fdstream.cpp		\
91	utils/process/isolation.cpp		\
92	utils/process/operations.cpp		\
93	utils/process/status.cpp		\
94	utils/process/system.cpp		\
95	utils/process/systembuf.cpp		\
96	utils/signals/exceptions.cpp		\
97	utils/signals/interrupts.cpp		\
98	utils/signals/misc.cpp			\
99	utils/signals/programmer.cpp		\
100	utils/signals/timer.cpp			\
101	utils/sqlite/c_gate.cpp			\
102	utils/sqlite/database.cpp		\
103	utils/sqlite/exceptions.cpp		\
104	utils/sqlite/statement.cpp		\
105	utils/sqlite/transaction.cpp		\
106	utils/text/exceptions.cpp		\
107	utils/text/operations.cpp		\
108	utils/text/regex.cpp			\
109	utils/text/table.cpp			\
110	utils/text/templates.cpp
111
112SRCS+=	model/context.cpp	\
113	model/exceptions.cpp	\
114	model/metadata.cpp	\
115	model/test_case.cpp	\
116	model/test_program.cpp	\
117	model/test_result.cpp
118
119SRCS+=	engine/atf.cpp			\
120	engine/atf_list.cpp		\
121	engine/atf_result.cpp		\
122	engine/config.cpp		\
123	engine/exceptions.cpp		\
124	engine/filters.cpp		\
125	engine/kyuafile.cpp		\
126	engine/plain.cpp		\
127	engine/requirements.cpp		\
128	engine/scanner.cpp		\
129	engine/tap.cpp			\
130	engine/tap_parser.cpp		\
131	engine/scheduler.cpp
132
133SRCS+=	store/dbtypes.cpp		\
134	store/exceptions.cpp		\
135	store/layout.cpp		\
136	store/metadata.cpp		\
137	store/migrate.cpp		\
138	store/read_backend.cpp		\
139	store/read_transaction.cpp	\
140	store/write_backend.cpp		\
141	store/write_transaction.cpp
142
143SRCS+=	drivers/debug_test.cpp		\
144	drivers/list_tests.cpp		\
145	drivers/report_junit.cpp	\
146	drivers/run_tests.cpp		\
147	drivers/scan_results.cpp
148
149SRCS+=	cli/cmd_about.cpp		\
150	cli/cmd_config.cpp		\
151	cli/cmd_db_exec.cpp		\
152	cli/cmd_db_migrate.cpp		\
153	cli/cmd_debug.cpp		\
154	cli/cmd_help.cpp		\
155	cli/cmd_list.cpp		\
156	cli/cmd_report.cpp		\
157	cli/cmd_report_html.cpp		\
158	cli/cmd_report_junit.cpp	\
159	cli/cmd_test.cpp		\
160	cli/common.cpp			\
161	cli/config.cpp			\
162	cli/main.cpp
163
164FILESGROUPS=	DOCS MISC STORE
165
166.if ${MK_EXAMPLES} != "no"
167FILESGROUPS+=	EXAMPLES
168.endif
169
170# Install a minimal default config that uses the 'tests' user.
171# The examples config is not appropriate for general use.
172CONFS=		kyua.conf-default
173CONFSDIR=	${KYUA_CONFDIR}
174CONFSNAME=	kyua.conf
175CONFSDIRTAGS=	package=tests
176
177DOCS=		AUTHORS CONTRIBUTORS LICENSE
178DOCSDIR=	${KYUA_DOCDIR}
179DOCSTAGS=	package=tests
180
181EXAMPLES=	Kyuafile.top kyua.conf
182EXAMPLESDIR=	${KYUA_EGDIR}
183EXAMPLESTAGS=	package=tests
184.PATH:		${KYUA_SRCDIR}/examples
185
186MISC=		context.html index.html report.css test_result.html
187MISCDIR=	${KYUA_MISCDIR}
188MISCTAGS=	package=tests
189.PATH:		${KYUA_SRCDIR}/misc
190
191STORE=		migrate_v1_v2.sql migrate_v2_v3.sql schema_v3.sql
192STOREDIR=	${KYUA_STOREDIR}
193STORETAGS=	package=tests
194.PATH:		${KYUA_SRCDIR}/store
195
196CLEANFILES+=	${MAN}
197.PATH: ${KYUA_SRCDIR}/doc
198.for man in ${MAN}
199${man}: ${man}.in
200	sh ${KYUA_SRCDIR}/doc/manbuild.sh \
201	    -v "CONFDIR=${KYUA_CONFDIR}" \
202	    -v "DOCDIR=${KYUA_DOCDIR}" \
203	    -v "EGDIR=${KYUA_EGDIR}" \
204	    -v "MISCDIR=${KYUA_MISCDIR}" \
205	    -v "PACKAGE=kyua" \
206	    -v "STOREDIR=${KYUA_STOREDIR}" \
207	    -v "TESTSDIR=${TESTSBASE}" \
208	    -v "VERSION=${KYUA_VERSION}" \
209	    ${.ALLSRC} ${.TARGET}
210.endfor
211
212.include <bsd.prog.mk>
213