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