opnsense-src/libexec/flua/Makefile
Baptiste Daroussin 7899f917b1 flua: move modules source into the main source directory
Follow the path of what is done with bsnmp, build the modules along
with the main binary, this allows to build the modules at a moment
where all needed libraries are already built and available in the
linker path instead of having to declare all the libraries which a
flua module will be linked to in _prebuild_libs.

Discused with:	markj
Reviewed by:	markj, jrtc27, kevans, imp
Accepted by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D46610
2024-09-12 09:03:44 +02:00

39 lines
795 B
Makefile

.include <src.lua.mk>
SUBDIR+= libfreebsd
SUBDIR+= libhash
SUBDIR+= libjail
SUBDIR+= libucl
LUASRC?= ${SRCTOP}/contrib/lua/src
.PATH: ${LUASRC}
PROG= flua
WARNS?= 3
MAN= # No manpage; this is internal.
CWARNFLAGS.gcc+= -Wno-format-nonliteral
LIBADD= lua
# Entry point
SRCS+= lua.c
# FreeBSD Extensions
.PATH: ${.CURDIR}/modules
SRCS+= linit_flua.c
SRCS+= lfs.c lposix.c lfbsd.c
CFLAGS+= -I${SRCTOP}/lib/liblua -I${.CURDIR}/modules -I${LUASRC}
CFLAGS+= -DLUA_PROGNAME="\"${PROG}\""
# readline bits; these aren't needed if we're building a bootstrap flua, as we
# don't expect that one to see any REPL usage.
.if !defined(BOOTSTRAPPING)
CFLAGS+= -DLUA_USE_READLINE
CFLAGS+= -I${SRCTOP}/lib/libedit -I${SRCTOP}/contrib/libedit
LIBADD+= edit
LDFLAGS+= -Wl,-E
.endif
.include <bsd.prog.mk>