From ea6553fb190815edd0d429be5ee6eea8523e2e0c Mon Sep 17 00:00:00 2001 From: hanez Date: Fri, 12 Dec 2025 02:34:47 +0100 Subject: [PATCH] Added a simple Bash based ./make script to make development more fun. (0.37.9) --- CMakeLists.txt | 2 +- make | 156 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+), 1 deletion(-) create mode 100755 make diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f4f92f..ad6be87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(fun VERSION 0.37.8 LANGUAGES C) +project(fun VERSION 0.37.9 LANGUAGES C) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) diff --git a/make b/make new file mode 100755 index 0000000..3009268 --- /dev/null +++ b/make @@ -0,0 +1,156 @@ +#!/bin/bash + +# This file is part of the Fun programming language. +# https://fun-lang.xyz/ +# +# Copyright 2025 Johannes Findeisen +# Licensed under the terms of the Apache-2.0 license. +# https://opensource.org/license/apache-2-0 +# +# Added: 2025-12-12 + +if [ -z "$1" ]; then + echo "Build target is unset, using 'minimal'"; + target="minimal"; +else + echo "Build target is set to '$1'"; + target=$1; +fi + +if [ "$target" = "all" ]; then + rm -rf build \ + && cmake -S . -B build \ + -DFUN_WITH_PCSC=ON \ + -DFUN_WITH_REPL=ON \ + -DFUN_WITH_LIBSQL=ON \ + -DFUN_WITH_SQLITE=ON \ + -DFUN_WITH_CURL=ON \ + -DFUN_WITH_PCRE2=ON \ + -DFUN_WITH_XML2=ON \ + -DFUN_WITH_JSON=ON \ + -DFUN_WITH_TCLTK=ON \ + -DFUN_WITH_INI=ON \ + -DFUN_LINK_STATIC=OFF \ + -DFUN_USE_MUSL=OFF \ + -DFUN_DEBUG=OFF \ + && cmake --build build --target fun +elif [ "$target" = "alpine" ]; then + rm -rf build \ + && cmake -S . -B build \ + -DFUN_WITH_PCSC=OFF \ + -DFUN_WITH_REPL=ON \ + -DFUN_WITH_LIBSQL=ON \ + -DFUN_WITH_SQLITE=ON \ + -DFUN_WITH_CURL=ON \ + -DFUN_WITH_PCRE2=ON \ + -DFUN_WITH_XML2=ON \ + -DFUN_WITH_JSON=ON \ + -DFUN_WITH_TCLTK=OFF \ + -DFUN_WITH_INI=ON \ + -DFUN_LINK_STATIC=OFF \ + -DFUN_DEBUG=OFF \ + && cmake --build build --target fun +elif [ "$target" = "debug" ]; then + rm -rf build \ + && cmake -S . -B build \ + -DFUN_WITH_PCSC=OFF \ + -DFUN_WITH_REPL=ON \ + -DFUN_WITH_LIBSQL=OFF \ + -DFUN_WITH_SQLITE=OFF \ + -DFUN_WITH_CURL=OFF \ + -DFUN_WITH_PCRE2=OFF \ + -DFUN_WITH_XML2=OFF \ + -DFUN_WITH_JSON=OFF \ + -DFUN_WITH_TCLTK=OFF \ + -DFUN_WITH_INI=OFF \ + -DFUN_LINK_STATIC=OFF \ + -DFUN_USE_MUSL=OFF \ + -DFUN_DEBUG=ON \ + && cmake --build build --target fun +elif [ "$target" = "debug_all" ]; then + rm -rf build \ + && cmake -S . -B build \ + -DFUN_WITH_PCSC=ON \ + -DFUN_WITH_REPL=ON \ + -DFUN_WITH_LIBSQL=ON \ + -DFUN_WITH_SQLITE=ON \ + -DFUN_WITH_CURL=ON \ + -DFUN_WITH_PCRE2=ON \ + -DFUN_WITH_XML2=ON \ + -DFUN_WITH_JSON=ON \ + -DFUN_WITH_TCLTK=ON \ + -DFUN_WITH_INI=ON \ + -DFUN_LINK_STATIC=OFF \ + -DFUN_USE_MUSL=OFF \ + -DFUN_DEBUG=ON \ + && cmake --build build --target fun +elif [ "$target" = "freebsd" ]; then + rm -rf build \ + && cmake -S . -B build \ + -DFUN_WITH_PCSC=OFF \ + -DFUN_WITH_REPL=ON \ + -DFUN_WITH_LIBSQL=OFF \ + -DFUN_WITH_SQLITE=OFF \ + -DFUN_WITH_CURL=OFF \ + -DFUN_WITH_PCRE2=OFF \ + -DFUN_WITH_XML2=OFF \ + -DFUN_WITH_JSON=OFF \ + -DFUN_WITH_TCLTK=OFF \ + -DFUN_WITH_INI=OFF \ + -DFUN_LINK_STATIC=OFF \ + -DFUN_DEBUG=OFF \ + && cmake --build build --target fun +elif [ "$target" = "minimal" ]; then + rm -rf build \ + && cmake -S . -B build \ + -DFUN_WITH_PCSC=OFF \ + -DFUN_WITH_REPL=OFF \ + -DFUN_WITH_LIBSQL=OFF \ + -DFUN_WITH_SQLITE=OFF \ + -DFUN_WITH_CURL=OFF \ + -DFUN_WITH_PCRE2=OFF \ + -DFUN_WITH_XML2=OFF \ + -DFUN_WITH_JSON=OFF \ + -DFUN_WITH_TCLTK=OFF \ + -DFUN_WITH_INI=OFF \ + -DFUN_LINK_STATIC=OFF \ + -DFUN_USE_MUSL=OFF \ + -DFUN_DEBUG=OFF \ + && cmake --build build --target fun +elif [ "$target" = "musl" ]; then + rm -rf build \ + && cmake -S . -B build \ + -DFUN_WITH_PCSC=OFF \ + -DFUN_WITH_REPL=ON \ + -DFUN_WITH_LIBSQL=OFF \ + -DFUN_WITH_SQLITE=OFF \ + -DFUN_WITH_CURL=OFF \ + -DFUN_WITH_PCRE2=OFF \ + -DFUN_WITH_XML2=OFF \ + -DFUN_WITH_JSON=OFF \ + -DFUN_WITH_TCLTK=OFF \ + -DFUN_WITH_INI=OFF \ + -DFUN_LINK_STATIC=OFF \ + -DFUN_USE_MUSL=ON \ + -DFUN_DEBUG=OFF \ + && cmake --build build --target fun +elif [ "$target" = "repl" ]; then + rm -rf build \ + && cmake -S . -B build \ + -DFUN_WITH_PCSC=OFF \ + -DFUN_WITH_REPL=ON \ + -DFUN_WITH_LIBSQL=OFF \ + -DFUN_WITH_SQLITE=OFF \ + -DFUN_WITH_CURL=OFF \ + -DFUN_WITH_PCRE2=OFF \ + -DFUN_WITH_XML2=OFF \ + -DFUN_WITH_JSON=OFF \ + -DFUN_WITH_TCLTK=OFF \ + -DFUN_WITH_INI=OFF \ + -DFUN_LINK_STATIC=OFF \ + -DFUN_USE_MUSL=OFF \ + -DFUN_DEBUG=OFF \ + && cmake --build build --target fun +else + echo "Build target $target not found... aborting!"; +fi