diff --git a/tools/gen-zam/CMakeLists.txt b/tools/gen-zam/CMakeLists.txt new file mode 100644 index 0000000000..3f87375db6 --- /dev/null +++ b/tools/gen-zam/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +project(Gen-ZAM C CXX) + +include(cmake/CommonCMakeConfig.cmake) + +include(FindRequiredPackage) + +include(RequireCXX17) + +set(GEN_ZAM_SRCS src/Gen-ZAM.cc) +set(GEN_ZAM_HEADERS src/Gen-ZAM.h) +add_executable(gen-zam ${GEN_ZAM_SRCS} ${GEN_ZAM_HEADERS}) +install(TARGETS gen-zam DESTINATION bin) + +if (CMAKE_BUILD_TYPE) + string(TOUPPER ${CMAKE_BUILD_TYPE} BuildType) +endif () + +message( + "\n===================| Gen-ZAM Build Summary |==================\n" + "\n" + "\nBuild type: ${CMAKE_BUILD_TYPE}" + "\nBuild dir: ${PROJECT_BINARY_DIR}" + "\nInstall prefix: ${CMAKE_INSTALL_PREFIX}" + "\nDebug mode: ${ENABLE_DEBUG}" + "\n" + "\nCC: ${CMAKE_C_COMPILER}" + "\nCFLAGS: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BuildType}}" + "\nCXX: ${CMAKE_CXX_COMPILER}" + "\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}" + "\nCPP: ${CMAKE_CXX_COMPILER}" + "\n" + "\n================================================================\n" +) + +include(UserChangedWarning) diff --git a/tools/gen-zam/README.md b/tools/gen-zam/README.md new file mode 100644 index 0000000000..89fb4381ad --- /dev/null +++ b/tools/gen-zam/README.md @@ -0,0 +1,6 @@ +# Gen-ZAM, a templator for the Zeek Abstract Machine + +Zeek uses the `gen-zam` tool during its build, to synthesize operations in ZAM, +the Zeek Abstract Machine. The main reason for why you might want to use this +repository on its own is cross-compilation, for which you'll need `gen-zam` on +the build host, much like `bifcl` and `binpac`.