xref: /freebsd/usr.bin/kyua/Makefile (revision 939fec44a79323ba06cf0ad60d4b69300a8abbc6)
1395cb8fbSEmmanuel Vadot.include <src.opts.mk>
2395cb8fbSEmmanuel Vadot
32eb9ad42SAlex RichardsonKYUA_CONFDIR=	/etc/kyua
42eb9ad42SAlex RichardsonKYUA_DOCDIR=	/usr/share/doc/kyua
52eb9ad42SAlex RichardsonKYUA_EGDIR=	/usr/share/examples/kyua
62eb9ad42SAlex RichardsonKYUA_MISCDIR=	/usr/share/kyua/misc
72eb9ad42SAlex RichardsonKYUA_STOREDIR=	/usr/share/kyua/store
82eb9ad42SAlex RichardsonKYUA_VERSION=	0.13
9b0d29bc4SBrooks Davis
102eb9ad42SAlex RichardsonKYUA_SRCDIR=	${SRCTOP}/contrib/kyua
11d7f6e63dSEnji Cooper.PATH: ${KYUA_SRCDIR}
12b0d29bc4SBrooks Davis
13066a8c69SEmmanuel VadotPACKAGE=	tests
14b0d29bc4SBrooks DavisPROG_CXX=	kyua
15b0d29bc4SBrooks DavisSRCS=		main.cpp
1683a1ee57SDag-Erling SmørgravLIBADD=		lutok sqlite3 util
17b0d29bc4SBrooks Davis
18b0d29bc4SBrooks DavisMAN=		kyua-about.1 \
19b0d29bc4SBrooks Davis		kyua-config.1 \
20b0d29bc4SBrooks Davis		kyua-db-exec.1 \
21b0d29bc4SBrooks Davis		kyua-db-migrate.1 \
22b0d29bc4SBrooks Davis		kyua-debug.1 \
23b0d29bc4SBrooks Davis		kyua-help.1 \
24b0d29bc4SBrooks Davis		kyua-list.1 \
25b0d29bc4SBrooks Davis		kyua-report-html.1 \
26b0d29bc4SBrooks Davis		kyua-report-junit.1 \
27b0d29bc4SBrooks Davis		kyua-report.1 \
28b0d29bc4SBrooks Davis		kyua-test.1 \
29b0d29bc4SBrooks Davis		kyua.1 \
30b0d29bc4SBrooks Davis		kyua.conf.5 \
31b0d29bc4SBrooks Davis		kyuafile.5
32b0d29bc4SBrooks Davis
332eb9ad42SAlex RichardsonCFLAGS+=	-I${KYUA_SRCDIR} -I${.CURDIR}
342eb9ad42SAlex RichardsonCFLAGS+=	-I${SRCTOP}/contrib/lutok/include
3509d28419SKonstantin BelousovCFLAGS+=	-I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/private/sqlite3
362eb9ad42SAlex RichardsonCFLAGS+=	-DHAVE_CONFIG_H
372eb9ad42SAlex Richardson
382eb9ad42SAlex Richardson# We compile the kyua libraries as part of the main executable as this saves
392eb9ad42SAlex Richardson# compile time and we don't install them anyway.
402eb9ad42SAlex RichardsonCFLAGS+=	-DGDB=\"/usr/local/bin/gdb\"			\
412eb9ad42SAlex Richardson		-DKYUA_ARCHITECTURE=\"${MACHINE_ARCH}\"		\
422eb9ad42SAlex Richardson		-DKYUA_CONFDIR=\"${KYUA_CONFDIR}\"		\
432eb9ad42SAlex Richardson		-DKYUA_DOCDIR=\"${KYUA_DOCDIR}\"		\
442eb9ad42SAlex Richardson		-DKYUA_MISCDIR=\"${KYUA_MISCDIR}\"		\
452eb9ad42SAlex Richardson		-DKYUA_PLATFORM=\"${MACHINE}\"			\
462eb9ad42SAlex Richardson		-DKYUA_STOREDIR=\"${KYUA_STOREDIR}\"		\
472eb9ad42SAlex Richardson		-DPACKAGE=\"kyua\"				\
482eb9ad42SAlex Richardson		-DPACKAGE_NAME=\"Kyua\"				\
492eb9ad42SAlex Richardson		-DPACKAGE_VERSION=\"${KYUA_VERSION}\"		\
502eb9ad42SAlex Richardson		-DVERSION=\"${KYUA_VERSION}\"
512eb9ad42SAlex Richardson
522eb9ad42SAlex RichardsonSRCS+=	utils/datetime.cpp			\
532eb9ad42SAlex Richardson	utils/env.cpp				\
542eb9ad42SAlex Richardson	utils/memory.cpp			\
552eb9ad42SAlex Richardson	utils/passwd.cpp			\
562eb9ad42SAlex Richardson	utils/sanity.cpp			\
572eb9ad42SAlex Richardson	utils/stacktrace.cpp			\
582eb9ad42SAlex Richardson	utils/stream.cpp			\
592eb9ad42SAlex Richardson	utils/units.cpp				\
602eb9ad42SAlex Richardson	utils/cmdline/base_command.cpp		\
612eb9ad42SAlex Richardson	utils/cmdline/exceptions.cpp		\
622eb9ad42SAlex Richardson	utils/cmdline/globals.cpp		\
632eb9ad42SAlex Richardson	utils/cmdline/options.cpp		\
642eb9ad42SAlex Richardson	utils/cmdline/parser.cpp		\
652eb9ad42SAlex Richardson	utils/cmdline/ui.cpp			\
662eb9ad42SAlex Richardson	utils/cmdline/ui_mock.cpp		\
672eb9ad42SAlex Richardson	utils/config/exceptions.cpp		\
682eb9ad42SAlex Richardson	utils/config/keys.cpp			\
692eb9ad42SAlex Richardson	utils/config/lua_module.cpp		\
702eb9ad42SAlex Richardson	utils/config/nodes.cpp			\
712eb9ad42SAlex Richardson	utils/config/parser.cpp			\
722eb9ad42SAlex Richardson	utils/config/tree.cpp			\
732eb9ad42SAlex Richardson	utils/format/exceptions.cpp		\
742eb9ad42SAlex Richardson	utils/format/formatter.cpp		\
752eb9ad42SAlex Richardson	utils/fs/auto_cleaners.cpp		\
762eb9ad42SAlex Richardson	utils/fs/directory.cpp			\
772eb9ad42SAlex Richardson	utils/fs/exceptions.cpp			\
782eb9ad42SAlex Richardson	utils/fs/lua_module.cpp			\
792eb9ad42SAlex Richardson	utils/fs/operations.cpp			\
802eb9ad42SAlex Richardson	utils/fs/path.cpp			\
812eb9ad42SAlex Richardson	utils/logging/operations.cpp		\
822eb9ad42SAlex Richardson	utils/process/child.cpp			\
832eb9ad42SAlex Richardson	utils/process/deadline_killer.cpp	\
842eb9ad42SAlex Richardson	utils/process/exceptions.cpp		\
852eb9ad42SAlex Richardson	utils/process/executor.cpp		\
862eb9ad42SAlex Richardson	utils/process/fdstream.cpp		\
872eb9ad42SAlex Richardson	utils/process/isolation.cpp		\
882eb9ad42SAlex Richardson	utils/process/operations.cpp		\
892eb9ad42SAlex Richardson	utils/process/status.cpp		\
902eb9ad42SAlex Richardson	utils/process/system.cpp		\
912eb9ad42SAlex Richardson	utils/process/systembuf.cpp		\
922eb9ad42SAlex Richardson	utils/signals/exceptions.cpp		\
932eb9ad42SAlex Richardson	utils/signals/interrupts.cpp		\
942eb9ad42SAlex Richardson	utils/signals/misc.cpp			\
952eb9ad42SAlex Richardson	utils/signals/programmer.cpp		\
962eb9ad42SAlex Richardson	utils/signals/timer.cpp			\
972eb9ad42SAlex Richardson	utils/sqlite/c_gate.cpp			\
982eb9ad42SAlex Richardson	utils/sqlite/database.cpp		\
992eb9ad42SAlex Richardson	utils/sqlite/exceptions.cpp		\
1002eb9ad42SAlex Richardson	utils/sqlite/statement.cpp		\
1012eb9ad42SAlex Richardson	utils/sqlite/transaction.cpp		\
1022eb9ad42SAlex Richardson	utils/text/exceptions.cpp		\
1032eb9ad42SAlex Richardson	utils/text/operations.cpp		\
1042eb9ad42SAlex Richardson	utils/text/regex.cpp			\
1052eb9ad42SAlex Richardson	utils/text/table.cpp			\
1062eb9ad42SAlex Richardson	utils/text/templates.cpp
1072eb9ad42SAlex Richardson
1082eb9ad42SAlex RichardsonSRCS+=	model/context.cpp	\
1092eb9ad42SAlex Richardson	model/exceptions.cpp	\
1102eb9ad42SAlex Richardson	model/metadata.cpp	\
1112eb9ad42SAlex Richardson	model/test_case.cpp	\
1122eb9ad42SAlex Richardson	model/test_program.cpp	\
1132eb9ad42SAlex Richardson	model/test_result.cpp
1142eb9ad42SAlex Richardson
1152eb9ad42SAlex RichardsonSRCS+=	engine/atf.cpp			\
1162eb9ad42SAlex Richardson	engine/atf_list.cpp		\
1172eb9ad42SAlex Richardson	engine/atf_result.cpp		\
1182eb9ad42SAlex Richardson	engine/config.cpp		\
1192eb9ad42SAlex Richardson	engine/exceptions.cpp		\
1202eb9ad42SAlex Richardson	engine/filters.cpp		\
1212eb9ad42SAlex Richardson	engine/kyuafile.cpp		\
1222eb9ad42SAlex Richardson	engine/plain.cpp		\
1232eb9ad42SAlex Richardson	engine/requirements.cpp		\
1242eb9ad42SAlex Richardson	engine/scanner.cpp		\
1252eb9ad42SAlex Richardson	engine/tap.cpp			\
1262eb9ad42SAlex Richardson	engine/tap_parser.cpp		\
127257e70f1SIgor Ostapenko	engine/scheduler.cpp		\
128257e70f1SIgor Ostapenko	engine/execenv/execenv.cpp	\
129257e70f1SIgor Ostapenko	engine/execenv/execenv_host.cpp
130257e70f1SIgor Ostapenko
131257e70f1SIgor OstapenkoSRCS+=	os/freebsd/execenv_jail_manager.cpp	\
132*939fec44SIgor Ostapenko	os/freebsd/main.cpp			\
133*939fec44SIgor Ostapenko	os/freebsd/reqs_checker_kmods.cpp
1342eb9ad42SAlex Richardson
1352eb9ad42SAlex RichardsonSRCS+=	store/dbtypes.cpp		\
1362eb9ad42SAlex Richardson	store/exceptions.cpp		\
1372eb9ad42SAlex Richardson	store/layout.cpp		\
1382eb9ad42SAlex Richardson	store/metadata.cpp		\
1392eb9ad42SAlex Richardson	store/migrate.cpp		\
1402eb9ad42SAlex Richardson	store/read_backend.cpp		\
1412eb9ad42SAlex Richardson	store/read_transaction.cpp	\
1422eb9ad42SAlex Richardson	store/write_backend.cpp		\
1432eb9ad42SAlex Richardson	store/write_transaction.cpp
1442eb9ad42SAlex Richardson
1452eb9ad42SAlex RichardsonSRCS+=	drivers/debug_test.cpp		\
1462eb9ad42SAlex Richardson	drivers/list_tests.cpp		\
1472eb9ad42SAlex Richardson	drivers/report_junit.cpp	\
1482eb9ad42SAlex Richardson	drivers/run_tests.cpp		\
1492eb9ad42SAlex Richardson	drivers/scan_results.cpp
1502eb9ad42SAlex Richardson
1512eb9ad42SAlex RichardsonSRCS+=	cli/cmd_about.cpp		\
1522eb9ad42SAlex Richardson	cli/cmd_config.cpp		\
1532eb9ad42SAlex Richardson	cli/cmd_db_exec.cpp		\
1542eb9ad42SAlex Richardson	cli/cmd_db_migrate.cpp		\
1552eb9ad42SAlex Richardson	cli/cmd_debug.cpp		\
1562eb9ad42SAlex Richardson	cli/cmd_help.cpp		\
1572eb9ad42SAlex Richardson	cli/cmd_list.cpp		\
1582eb9ad42SAlex Richardson	cli/cmd_report.cpp		\
1592eb9ad42SAlex Richardson	cli/cmd_report_html.cpp		\
1602eb9ad42SAlex Richardson	cli/cmd_report_junit.cpp	\
1612eb9ad42SAlex Richardson	cli/cmd_test.cpp		\
1622eb9ad42SAlex Richardson	cli/common.cpp			\
1632eb9ad42SAlex Richardson	cli/config.cpp			\
1642eb9ad42SAlex Richardson	cli/main.cpp
165b0d29bc4SBrooks Davis
166257e70f1SIgor Ostapenko.if ${MK_JAIL} == "no"
167257e70f1SIgor OstapenkoSRCS+=	os/freebsd/execenv_jail_stub.cpp
168257e70f1SIgor Ostapenko.else
169257e70f1SIgor OstapenkoSRCS+=	os/freebsd/execenv_jail.cpp	\
170257e70f1SIgor Ostapenko	os/freebsd/utils/jail.cpp
171257e70f1SIgor OstapenkoLIBADD+=	jail
172257e70f1SIgor Ostapenko.endif
173257e70f1SIgor Ostapenko
174395cb8fbSEmmanuel VadotFILESGROUPS=	DOCS MISC STORE
175395cb8fbSEmmanuel Vadot
176395cb8fbSEmmanuel Vadot.if ${MK_EXAMPLES} != "no"
177395cb8fbSEmmanuel VadotFILESGROUPS+=	EXAMPLES
178395cb8fbSEmmanuel Vadot.endif
179b0d29bc4SBrooks Davis
18031711131SBrooks Davis# Install a minimal default config that uses the 'tests' user.
18131711131SBrooks Davis# The examples config is not appropriate for general use.
18231711131SBrooks DavisCONFS=		kyua.conf-default
183b0d29bc4SBrooks DavisCONFSDIR=	${KYUA_CONFDIR}
18431711131SBrooks DavisCONFSNAME=	kyua.conf
185066a8c69SEmmanuel VadotCONFSDIRTAGS=	package=tests
186b0d29bc4SBrooks Davis
187daa006f8SBrooks DavisDOCS=		AUTHORS CONTRIBUTORS LICENSE
188daa006f8SBrooks DavisDOCSDIR=	${KYUA_DOCDIR}
189066a8c69SEmmanuel VadotDOCSTAGS=	package=tests
190daa006f8SBrooks Davis
191b0d29bc4SBrooks DavisEXAMPLES=	Kyuafile.top kyua.conf
192b0d29bc4SBrooks DavisEXAMPLESDIR=	${KYUA_EGDIR}
193066a8c69SEmmanuel VadotEXAMPLESTAGS=	package=tests
194b0d29bc4SBrooks Davis.PATH:		${KYUA_SRCDIR}/examples
195b0d29bc4SBrooks Davis
196b0d29bc4SBrooks DavisMISC=		context.html index.html report.css test_result.html
197b0d29bc4SBrooks DavisMISCDIR=	${KYUA_MISCDIR}
198066a8c69SEmmanuel VadotMISCTAGS=	package=tests
199b0d29bc4SBrooks Davis.PATH:		${KYUA_SRCDIR}/misc
200b0d29bc4SBrooks Davis
201b0d29bc4SBrooks DavisSTORE=		migrate_v1_v2.sql migrate_v2_v3.sql schema_v3.sql
202b0d29bc4SBrooks DavisSTOREDIR=	${KYUA_STOREDIR}
203066a8c69SEmmanuel VadotSTORETAGS=	package=tests
204b0d29bc4SBrooks Davis.PATH:		${KYUA_SRCDIR}/store
205b0d29bc4SBrooks Davis
20609ae09a9SEnji CooperCLEANFILES+=	${MAN}
207b0d29bc4SBrooks Davis.PATH: ${KYUA_SRCDIR}/doc
20809ae09a9SEnji Cooper.for man in ${MAN}
20909ae09a9SEnji Cooper${man}: ${man}.in
2109fd4b8ffSBrooks Davis	sh ${KYUA_SRCDIR}/doc/manbuild.sh \
21109ae09a9SEnji Cooper	    -v "CONFDIR=${KYUA_CONFDIR}" \
21209ae09a9SEnji Cooper	    -v "DOCDIR=${KYUA_DOCDIR}" \
21309ae09a9SEnji Cooper	    -v "EGDIR=${KYUA_EGDIR}" \
21409ae09a9SEnji Cooper	    -v "MISCDIR=${KYUA_MISCDIR}" \
21509ae09a9SEnji Cooper	    -v "PACKAGE=kyua" \
21609ae09a9SEnji Cooper	    -v "STOREDIR=${KYUA_STOREDIR}" \
21709ae09a9SEnji Cooper	    -v "TESTSDIR=${TESTSBASE}" \
21809ae09a9SEnji Cooper	    -v "VERSION=${KYUA_VERSION}" \
21909ae09a9SEnji Cooper	    ${.ALLSRC} ${.TARGET}
22009ae09a9SEnji Cooper.endfor
221b0d29bc4SBrooks Davis
222b0d29bc4SBrooks Davis.include <bsd.prog.mk>
223