1
0
Fork 0
forked from fun/fun

Added a custom lib dir. E.g.: FUN_LIB_DIR="/some/dir\ ./path/to/fun and added DEFAULT_LIB_DIR as compile time option.

This commit is contained in:
Johannes Findeisen 2025-09-29 18:22:40 +02:00
commit 728b4f67da
3 changed files with 42 additions and 7 deletions

View file

@ -4,6 +4,14 @@ CMAKE ?= cmake
# Default to a build with extra logging disabled
CMAKE_FLAGS ?= -DFUN_DEBUG=OFF
# Optional: override default library directory for #include <...> lookups
# Usage: make DEFAULT_LIB_DIR=/custom/fun/lib
# This injects a compiler define: -DDEFAULT_LIB_DIR="/custom/fun/lib/"
ifneq ($(strip $(DEFAULT_LIB_DIR)),)
CMAKE_FLAGS += -DCMAKE_C_FLAGS="$(CMAKE_C_FLAGS) -DDEFAULT_LIB_DIR=\\\"$(DEFAULT_LIB_DIR)/\\\""
CMAKE_FLAGS += -DCMAKE_CXX_FLAGS="$(CMAKE_CXX_FLAGS) -DDEFAULT_LIB_DIR=\\\"$(DEFAULT_LIB_DIR)/\\\""
endif
.PHONY: all configure build fun fun_test test_opcodes clean distclean install repl run
all: clean fun fun_test test_opcodes