From 81d0a9d343e01240a74f3de561781fcd389dc320 Mon Sep 17 00:00:00 2001 From: hanez Date: Tue, 30 Sep 2025 23:26:34 +0200 Subject: [PATCH] Added more Makefile stuff for testing and README update. (0.15.2) --- CMakeLists.txt | 2 +- Makefile | 12 ++++++++++-- README.md | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f821fd..9d5cea4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16) -project(fun VERSION 0.15.1 LANGUAGES C) +project(fun VERSION 0.15.2 LANGUAGES C) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) diff --git a/Makefile b/Makefile index 13b58ee..45f8106 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ CMAKE ?= cmake # Default to a build with extra logging disabled CMAKE_FLAGS ?= -DFUN_DEBUG=OFF +# Convenience: default path to bundled stdlib +FUN_LIB ?= $(CURDIR)/lib + # 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/" @@ -73,8 +76,13 @@ repl: fun run: fun ./$(BUILD_DIR)/fun $(SCRIPT) +# Run the OO threading demo with FUN_LIB_DIR set +threads-demo: fun + @echo "Running Thread class demo with FUN_LIB_DIR=$(FUN_LIB)" + FUN_LIB_DIR="$(FUN_LIB)" ./$(BUILD_DIR)/fun examples/threads_demo.fun + # Additional convenience targets -.PHONY: verify-ops examples run-examples +.PHONY: verify-ops examples run-examples threads-demo # Verify that each OP_* in bytecode.h has a corresponding vm_case_*.inc include in vm.c verify-ops: @@ -82,4 +90,4 @@ verify-ops: # Build and run all examples (searches for the fun binary automatically) examples run-examples: fun - @./scripts/run_examples.sh + @FUN_LIB_DIR="$(FUN_LIB)" ./scripts/run_examples.sh diff --git a/README.md b/README.md index d41038c..55d9d40 100644 --- a/README.md +++ b/README.md @@ -145,3 +145,6 @@ That's it! For testing it run: ``` ./build/fun ./demo.fun ``` +## Author + +[Johannes Findeisen](https://hanez.org)