1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

Simplify and speed up the kyua build

Instead of having multiple kyua libraries, just include the files as part
of usr.bin/kyua. Previously, we would build each kyua source up to four
times: once as a .o file and once as a .pieo. Additionally, the kyua
libraries might be built again for compat32. As all the kyua libraries
amount to 102 C++ sources the build time is significant (especially when
using an assertions enabled compiler). This change ensures that we build
306 fewer .cpp source files as part of buildworld.

Reviewed By:	brooks
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30967
This commit is contained in:
Alex Richardson 2021-07-02 09:21:04 +01:00
parent acb1f1269c
commit 2eb9ad4274
13 changed files with 134 additions and 234 deletions

View File

@ -1,10 +0,0 @@
# $FreeBSD$
SUBDIR= cli \
drivers \
engine \
model \
store \
utils
.include <bsd.subdir.mk>

View File

@ -1,20 +0,0 @@
# $FreeBSD$
KYUA_LIBDIR:= ${.PARSEDIR}
.include "${KYUA_LIBDIR}/Makefile.kyua"
LIB_CXX= kyua_${KYUA_LIB}
INTERNALLIB=
.PATH: ${KYUA_SRCDIR}/${KYUA_LIB}
CFLAGS+= -I${KYUA_LIBDIR} \
-I${KYUA_SRCDIR} \
-I${SRCTOP}/contrib/lutok/include
CFLAGS+= -DHAVE_CONFIG_H
# kyua uses auto_ptr
CFLAGS+= -Wno-deprecated-declarations
.include "${.PARSEDIR}/../Makefile.inc"

View File

@ -1,11 +0,0 @@
# $FreeBSD$
KYUA_VERSION= 0.13
KYUA_CONFDIR= /etc/kyua
KYUA_DOCDIR= /usr/share/doc/kyua
KYUA_EGDIR= /usr/share/examples/kyua
KYUA_MISCDIR= /usr/share/kyua/misc
KYUA_STOREDIR= /usr/share/kyua/store
KYUA_SRCDIR= ${SRCTOP}/contrib/kyua

View File

@ -1,29 +0,0 @@
# $FreeBSD$
KYUA_LIB= cli
INTERNALLIB=
LIBADD= kyua_drivers kyua_engine kyua_model kyua_store kyua_utils
CFLAGS+= -DKYUA_CONFDIR=\"${KYUA_CONFDIR}\" \
-DKYUA_DOCDIR=\"${KYUA_DOCDIR}\" \
-DKYUA_MISCDIR=\"${KYUA_MISCDIR}\" \
-DPACKAGE=\"kyua\" \
-DPACKAGE_NAME=\"Kyua\" \
-DPACKAGE_VERSION=\"${KYUA_VERSION}\" \
-DVERSION=\"${KYUA_VERSION}\"
SRCS= cmd_about.cpp \
cmd_config.cpp \
cmd_db_exec.cpp \
cmd_db_migrate.cpp \
cmd_debug.cpp \
cmd_help.cpp \
cmd_list.cpp \
cmd_report.cpp \
cmd_report_html.cpp \
cmd_report_junit.cpp \
cmd_test.cpp \
common.cpp \
config.cpp \
main.cpp
.include <bsd.lib.mk>

View File

@ -1,12 +0,0 @@
# $FreeBSD$
KYUA_LIB= drivers
LIBADD= kyua_model kyua_engine kyua_store
SRCS= debug_test.cpp \
list_tests.cpp \
report_junit.cpp \
run_tests.cpp \
scan_results.cpp
.include <bsd.lib.mk>

View File

@ -1,22 +0,0 @@
# $FreeBSD$
KYUA_LIB= engine
LIBADD= lutok kyua_utils
CFLAGS= -DKYUA_ARCHITECTURE=\"${MACHINE_ARCH}\" \
-DKYUA_PLATFORM=\"${MACHINE}\"
SRCS= atf.cpp \
atf_list.cpp \
atf_result.cpp \
config.cpp \
exceptions.cpp \
filters.cpp \
kyuafile.cpp \
plain.cpp \
requirements.cpp \
scanner.cpp \
tap.cpp \
tap_parser.cpp \
scheduler.cpp
.include <bsd.lib.mk>

View File

@ -1,13 +0,0 @@
# $FreeBSD$
KYUA_LIB= model
LIBADD= lutok
SRCS= context.cpp \
exceptions.cpp \
metadata.cpp \
test_case.cpp \
test_program.cpp \
test_result.cpp
.include <bsd.lib.mk>

View File

@ -1,18 +0,0 @@
# $FreeBSD$
KYUA_LIB= store
LIBADD= kyua_model kyua_utils sqlite3
CFLAGS+= -DKYUA_STOREDIR=\"${KYUA_STOREDIR}\"
SRCS= dbtypes.cpp \
exceptions.cpp \
layout.cpp \
metadata.cpp \
migrate.cpp \
read_backend.cpp \
read_transaction.cpp \
write_backend.cpp \
write_transaction.cpp
.include <bsd.lib.mk>

View File

@ -1,65 +0,0 @@
# $FreeBSD$
KYUA_LIB= utils
LIBADD= lutok
CFLAGS+= -I${SRCTOP}/contrib/sqlite3
CFLAGS+= -DGDB=\"/usr/local/bin/gdb\"
SRCS= datetime.cpp \
env.cpp \
memory.cpp \
passwd.cpp \
sanity.cpp \
stacktrace.cpp \
stream.cpp \
units.cpp \
cmdline/base_command.cpp \
cmdline/exceptions.cpp \
cmdline/globals.cpp \
cmdline/options.cpp \
cmdline/parser.cpp \
cmdline/ui.cpp \
cmdline/ui_mock.cpp \
config/exceptions.cpp \
config/keys.cpp \
config/lua_module.cpp \
config/nodes.cpp \
config/parser.cpp \
config/tree.cpp \
format/exceptions.cpp \
format/formatter.cpp \
fs/auto_cleaners.cpp \
fs/directory.cpp \
fs/exceptions.cpp \
fs/lua_module.cpp \
fs/operations.cpp \
fs/path.cpp \
logging/operations.cpp \
process/child.cpp \
process/deadline_killer.cpp \
process/exceptions.cpp \
process/executor.cpp \
process/fdstream.cpp \
process/isolation.cpp \
process/operations.cpp \
process/status.cpp \
process/system.cpp \
process/systembuf.cpp \
signals/exceptions.cpp \
signals/interrupts.cpp \
signals/misc.cpp \
signals/programmer.cpp \
signals/timer.cpp \
sqlite/c_gate.cpp \
sqlite/database.cpp \
sqlite/exceptions.cpp \
sqlite/statement.cpp \
sqlite/transaction.cpp \
text/exceptions.cpp \
text/operations.cpp \
text/regex.cpp \
text/table.cpp \
text/templates.cpp \
.include <bsd.lib.mk>

View File

@ -41,12 +41,6 @@ _INTERNALLIBS= \
fifolog \
ifconfig \
ipf \
kyua_cli \
kyua_drivers \
kyua_engine \
kyua_model \
kyua_store \
kyua_utils \
lpr \
lua \
lutok \
@ -286,12 +280,6 @@ _DP_bsnmp= crypto
_DP_geom= bsdxml sbuf
_DP_cam= sbuf
_DP_kvm= elf
_DP_kyua_cli= kyua_drivers kyua_engine kyua_model kyua_store kyua_utils
_DP_kyua_drivers= kyua_model kyua_engine kyua_store
_DP_kyua_engine= lutok kyua_utils
_DP_kyua_model= lutok
_DP_kyua_utils= lutok
_DP_kyua_store= kyua_model kyua_utils sqlite3
_DP_casper= nv
_DP_cap_dns= nv
_DP_cap_fileargs= nv
@ -510,24 +498,6 @@ _LIB_OBJTOP?= ${OBJTOP}
LIBELFTCDIR= ${_LIB_OBJTOP}/lib/libelftc
LIBELFTC?= ${LIBELFTCDIR}/libelftc${PIE_SUFFIX}.a
LIBKYUA_CLIDIR= ${_LIB_OBJTOP}/lib/kyua/cli
LIBKYUA_CLI?= ${LIBKYUA_CLIDIR}/libkyua_cli${PIE_SUFFIX}.a
LIBKYUA_DRIVERSDIR= ${_LIB_OBJTOP}/lib/kyua/drivers
LIBKYUA_DRIVERS?= ${LIBKYUA_DRIVERSDIR}/libkyua_drivers${PIE_SUFFIX}.a
LIBKYUA_ENGINEDIR= ${_LIB_OBJTOP}/lib/kyua/engine
LIBKYUA_ENGINE?= ${LIBKYUA_ENGINEDIR}/libkyua_engine${PIE_SUFFIX}.a
LIBKYUA_MODELDIR= ${_LIB_OBJTOP}/lib/kyua/model
LIBKYUA_MODEL?= ${LIBKYUA_MODELDIR}/libkyua_model${PIE_SUFFIX}.a
LIBKYUA_STOREDIR= ${_LIB_OBJTOP}/lib/kyua/store
LIBKYUA_STORE?= ${LIBKYUA_STOREDIR}/libkyua_store${PIE_SUFFIX}.a
LIBKYUA_UTILSDIR= ${_LIB_OBJTOP}/lib/kyua/utils
LIBKYUA_UTILS?= ${LIBKYUA_UTILSDIR}/libkyua_utils${PIE_SUFFIX}.a
LIBLUADIR= ${_LIB_OBJTOP}/lib/liblua
LIBLUA?= ${LIBLUADIR}/liblua${PIE_SUFFIX}.a

View File

@ -2,14 +2,20 @@
.include <src.opts.mk>
.include "${SRCTOP}/lib/kyua/Makefile.kyua"
KYUA_CONFDIR= /etc/kyua
KYUA_DOCDIR= /usr/share/doc/kyua
KYUA_EGDIR= /usr/share/examples/kyua
KYUA_MISCDIR= /usr/share/kyua/misc
KYUA_STOREDIR= /usr/share/kyua/store
KYUA_VERSION= 0.13
KYUA_SRCDIR= ${SRCTOP}/contrib/kyua
.PATH: ${KYUA_SRCDIR}
PACKAGE= tests
PROG_CXX= kyua
SRCS= main.cpp
LIBADD= kyua_cli kyua_drivers kyua_engine kyua_model kyua_store
LIBADD= lutok sqlite3
MAN= kyua-about.1 \
kyua-config.1 \
@ -26,10 +32,134 @@ MAN= kyua-about.1 \
kyua.conf.5 \
kyuafile.5
CFLAGS+= -I${KYUA_SRCDIR}
CFLAGS+= -I${KYUA_SRCDIR} -I${.CURDIR}
CFLAGS+= -I${SRCTOP}/contrib/lutok/include
CFLAGS+= -I${SRCTOP}/contrib/sqlite3
# kyua uses auto_ptr
CFLAGS+= -Wno-deprecated-declarations
CFLAGS+= -DHAVE_CONFIG_H
# We compile the kyua libraries as part of the main executable as this saves
# compile time and we don't install them anyway.
CFLAGS+= -DGDB=\"/usr/local/bin/gdb\" \
-DKYUA_ARCHITECTURE=\"${MACHINE_ARCH}\" \
-DKYUA_CONFDIR=\"${KYUA_CONFDIR}\" \
-DKYUA_DOCDIR=\"${KYUA_DOCDIR}\" \
-DKYUA_MISCDIR=\"${KYUA_MISCDIR}\" \
-DKYUA_PLATFORM=\"${MACHINE}\" \
-DKYUA_STOREDIR=\"${KYUA_STOREDIR}\" \
-DPACKAGE=\"kyua\" \
-DPACKAGE_NAME=\"Kyua\" \
-DPACKAGE_VERSION=\"${KYUA_VERSION}\" \
-DVERSION=\"${KYUA_VERSION}\"
SRCS+= utils/datetime.cpp \
utils/env.cpp \
utils/memory.cpp \
utils/passwd.cpp \
utils/sanity.cpp \
utils/stacktrace.cpp \
utils/stream.cpp \
utils/units.cpp \
utils/cmdline/base_command.cpp \
utils/cmdline/exceptions.cpp \
utils/cmdline/globals.cpp \
utils/cmdline/options.cpp \
utils/cmdline/parser.cpp \
utils/cmdline/ui.cpp \
utils/cmdline/ui_mock.cpp \
utils/config/exceptions.cpp \
utils/config/keys.cpp \
utils/config/lua_module.cpp \
utils/config/nodes.cpp \
utils/config/parser.cpp \
utils/config/tree.cpp \
utils/format/exceptions.cpp \
utils/format/formatter.cpp \
utils/fs/auto_cleaners.cpp \
utils/fs/directory.cpp \
utils/fs/exceptions.cpp \
utils/fs/lua_module.cpp \
utils/fs/operations.cpp \
utils/fs/path.cpp \
utils/logging/operations.cpp \
utils/process/child.cpp \
utils/process/deadline_killer.cpp \
utils/process/exceptions.cpp \
utils/process/executor.cpp \
utils/process/fdstream.cpp \
utils/process/isolation.cpp \
utils/process/operations.cpp \
utils/process/status.cpp \
utils/process/system.cpp \
utils/process/systembuf.cpp \
utils/signals/exceptions.cpp \
utils/signals/interrupts.cpp \
utils/signals/misc.cpp \
utils/signals/programmer.cpp \
utils/signals/timer.cpp \
utils/sqlite/c_gate.cpp \
utils/sqlite/database.cpp \
utils/sqlite/exceptions.cpp \
utils/sqlite/statement.cpp \
utils/sqlite/transaction.cpp \
utils/text/exceptions.cpp \
utils/text/operations.cpp \
utils/text/regex.cpp \
utils/text/table.cpp \
utils/text/templates.cpp
SRCS+= model/context.cpp \
model/exceptions.cpp \
model/metadata.cpp \
model/test_case.cpp \
model/test_program.cpp \
model/test_result.cpp
SRCS+= engine/atf.cpp \
engine/atf_list.cpp \
engine/atf_result.cpp \
engine/config.cpp \
engine/exceptions.cpp \
engine/filters.cpp \
engine/kyuafile.cpp \
engine/plain.cpp \
engine/requirements.cpp \
engine/scanner.cpp \
engine/tap.cpp \
engine/tap_parser.cpp \
engine/scheduler.cpp
SRCS+= store/dbtypes.cpp \
store/exceptions.cpp \
store/layout.cpp \
store/metadata.cpp \
store/migrate.cpp \
store/read_backend.cpp \
store/read_transaction.cpp \
store/write_backend.cpp \
store/write_transaction.cpp
SRCS+= drivers/debug_test.cpp \
drivers/list_tests.cpp \
drivers/report_junit.cpp \
drivers/run_tests.cpp \
drivers/scan_results.cpp
SRCS+= cli/cmd_about.cpp \
cli/cmd_config.cpp \
cli/cmd_db_exec.cpp \
cli/cmd_db_migrate.cpp \
cli/cmd_debug.cpp \
cli/cmd_help.cpp \
cli/cmd_list.cpp \
cli/cmd_report.cpp \
cli/cmd_report_html.cpp \
cli/cmd_report_junit.cpp \
cli/cmd_test.cpp \
cli/common.cpp \
cli/config.cpp \
cli/main.cpp
FILESGROUPS= DOCS MISC STORE