1.include <src.lua.mk> 2 3PACKAGE= flua 4 5# New flua modules should be added here rather than to SUBDIR so that we can do 6# the right thing for both bootstrap flua and target flua. The former does not 7# do any shared libs, so we just build them all straight into flua itself rather 8# than mucking about with the infrastructure to make them linkable -- thus, why 9# these are all structured to have a Makefile that describes what we want 10# *installed*, and a Makefile.inc that describes what we need to *build*. 11FLUA_MODULES+= lfbsd 12FLUA_MODULES+= lfs 13FLUA_MODULES+= libhash 14.ifndef BOOTSTRAPPING 15# Bootstrap flua can't usefully do anything with libjail anyways, because it 16# can't assume it's being run on a system that even supports jails. 17FLUA_MODULES+= libjail 18.endif 19FLUA_MODULES+= libucl 20FLUA_MODULES+= liblyaml 21 22.ifdef BOOTSTRAPPING 23# libfreebsd is generally omitted from the bootstrap flua because its 24# functionality largely assumes a FreeBSD kernel/system headers, so it doesn't 25# really offer functionality that we can use in bootstrap. 26CFLAGS+= -I${.CURDIR} -DBOOTSTRAPPING 27 28SHAREDIR= ${WORLDTMP}/legacy/usr/share/flua 29FLUA_PATH= ${SHAREDIR}/?.lua;${SHAREDIR}/?/init.lua 30CFLAGS+= -DBOOTSTRAP_FLUA_PATH=\"${FLUA_PATH:Q}\" 31 32.for mod in ${FLUA_MODULES} 33.include "${mod}/Makefile.inc" 34.endfor 35 36.else 37 38FLUA_MODULES+= libfreebsd 39SUBDIR+= ${FLUA_MODULES} 40 41.endif 42 43LUASRC?= ${SRCTOP}/contrib/lua/src 44.PATH: ${LUASRC} 45 46PROG= flua 47 48CWARNFLAGS.gcc+= -Wno-format-nonliteral 49 50LIBADD+= lua 51 52# Entry point 53SRCS+= lua.c 54 55# FreeBSD Extensions 56.PATH: ${.CURDIR}/modules 57SRCS+= linit_flua.c 58SRCS+= lposix.c 59 60CFLAGS+= -I${SRCTOP}/lib/liblua -I${.CURDIR}/modules -I${LUASRC} 61CFLAGS+= -DLUA_PROGNAME="\"${PROG}\"" 62 63# readline bits; these aren't needed if we're building a bootstrap flua, as we 64# don't expect that one to see any REPL usage. 65.if !defined(BOOTSTRAPPING) 66CFLAGS+= -DLUA_USE_READLINE 67CFLAGS+= -I${SRCTOP}/lib/libedit -I${SRCTOP}/contrib/libedit 68LIBADD+= edit 69LDFLAGS+= -Wl,-E 70.endif 71 72.include <bsd.prog.mk> 73