4 Комити 719aecf8f7 ... e90f9c1802

Аутор SHA1 Порука Датум
  mio e90f9c1802 Minor fixups пре 5 месеци
  mio 36138bb569 Update raylib to raylib 5.5 пре 5 месеци
  mio 46c5635efd Replace build.py with nob пре 5 месеци
  mio 68a00e0aae C11 and style changes пре 5 месеци
10 измењених фајлова са 2641 додато и 1438 уклоњено
  1. 10 1
      .gitignore
  2. 7 19
      README.md
  3. 0 251
      build.py
  4. 513 0
      nob.c
  5. 2111 0
      nob.h
  6. 0 5
      raylib/raylib-5.0/README
  7. 0 126
      raylib/raylib-5.0/src/CMakeLists.txt
  8. 0 809
      raylib/raylib-5.0/src/Makefile
  9. 0 227
      raylib/raylib-5.0/src/build.zig
  10. 0 0
      raylib/raylib-5.0/src/external/glfw/README.md

+ 10 - 1
.gitignore

@@ -1 +1,10 @@
-build/
+# Build Files
+nob
+nob.old
+*.o
+*.moc
+libraylib.a
+.nob-cache
+
+# Executable
+ex

+ 7 - 19
README.md

@@ -8,29 +8,17 @@ External Dependencies:
 - [libarchive](https://libarchive.org) to handle extracting of various archive formats.
 - [uchardet](https://www.freedesktop.org/wiki/Software/uchardet/) to detect text encoding.
 
-```console
-$ ./build.py
-$ ./build/ex <archive.ext>
-```
-
-Optionally, you can build with a custom raylib GUI:
-
-```console
-$ EX_BUILD_GUI=raylib ./build.py
-$ ./build/ex -gui <archive.ext>
-```
-
-There is also a TQt GUI:
+You will first need to compile the build program. This only needs to be done once as
+it will recompile itself.
 
 ```console
-$ EX_BUILD_GUI=tqt ./build.py
-$ ./build/ex -gui <archive.ext>
+$ cc -o nob nob.c
 ```
 
-If you have the TQt header files in a non-standard location, you can set the
-include directory with the `TQTDIR` path:
+From there, you can configure and compile EX as you would like:
 
 ```console
-$ TQTDIR=/opt/tqt/ EX_BUILD_GUI=tqt ./build.py
-$ ./build/ex -gui <archive.ext>
+$ ./nob [-gui:<type>] [-j:<n>] [-release]
+; <type> = GUI Backend [ raylib tqt ]
+; <n>    = Max number of compile jobs (default 1)
 ```

+ 0 - 251
build.py

@@ -1,251 +0,0 @@
-#!/usr/bin/env python3
-#
-# Build script for ex.
-import os
-import subprocess
-import sys
-
-RAYLIB_MODULES = [
-    "rcore",
-    "rglfw",
-    "rshapes",
-    "rtext",
-    "rtextures",
-    "utils"
-]
-
-INFO = 0
-WARNING = 1
-ERROR = 2
-
-TQTDIR = os.environ.get('TQTDIR', '/usr')
-TQTINCS = [ TQTDIR + '/include/tqt', TQTDIR + '/include/tqt3' ]
-
-def log(level, *msg):
-    if (level == INFO):
-        print('[INFO] ', end='')
-    elif (level == WARNING):
-        print('[WARNING] ', end='')
-    elif (level == ERROR):
-        print('[ERROR] ', end='')
-    else:
-        assert False, "unreachable"
-
-    print(*msg)
-    sys.stdout.flush()
-
-def run_async(args):
-    cpid = -1
-    try:
-        cpid = os.fork()
-    except OSError as e:
-        log(ERROR, "Could not fork child process: %s" % e)
-        return -1
-
-    if cpid == 0:
-        os.execvp(args[0], args)
-
-    return cpid
-
-
-def needs_rebuild(output_path, input_paths):
-    statbuf = None
-    try:
-        statbuf = os.stat(output_path)
-    except FileNotFoundError:
-        return True
-    assert statbuf is not None
-    output_mtime = statbuf.st_mtime
-
-    for input_path in input_paths:
-        try:
-            statbuf = os.stat(input_path)
-        except FileNotFoundError as e:
-            log(ERROR, "Could not stat %s: %s" % (input_path, e))
-            return True
-        input_mtime = statbuf.st_mtime
-        if input_mtime > output_mtime:
-            return True
-    return False
-
-def wait_for_pid(pid):
-    if pid == -1:
-        return False
-
-    while True:
-        status = 0
-
-        _, status = os.waitpid(pid, 0)
-        if status < 0:
-            log(ERROR, "Could not wait on command (pid %d)" % pid)
-            return False
-
-        if os.WIFEXITED(status):
-            exit_status = os.WEXITSTATUS(status)
-            if exit_status != 0:
-                log(ERROR, "Command exited with exit code %d" % exit_status)
-                return False
-            break
-
-        if os.WIFSIGNALED(status):
-            from signal import strsignal
-
-            log(ERROR, "Command process was terminated by %s" % (
-                strsignal(os.WTERMSIG(status))))
-            return False
-
-    return True
-
-def wait_for_pids(pids):
-    success = True
-    for pid in pids:
-        success = wait_for_pid(pid) and success
-    return success
-
-def tqmoc(input_file, output_file):
-    subprocess.run(['tqmoc', input_file, '-o', output_file])
-
-def build_raylib():
-    result = True
-    object_files = list()
-    procs = list()
-
-    if not os.path.exists("./build/raylib"):
-        os.makedirs("./build/raylib")
-
-    build_path = "./build/raylib/linux"
-
-    if not os.path.exists(build_path):
-        os.makedirs(build_path)
-
-    for module in RAYLIB_MODULES:
-        input_path = "./raylib/raylib-5.0/src/%s.c" % module
-        output_path = "%s/%s.o" % (build_path, module)
-
-        object_files.append(output_path)
-
-        if needs_rebuild(output_path, [input_path]):
-            procs.append(run_async([
-                'cc',
-                '-ggdb', '-DPLATFORM_DESKTOP', '-fPIC',
-                '-I./raylib/raylib-5.0/src/external/glfw/include',
-                '-c', input_path,
-                '-o', output_path
-            ]))
-
-    if not wait_for_pids(procs):
-        return False
-
-    libraylib_path = "%s/libraylib.a" % build_path
-
-    if needs_rebuild(libraylib_path, object_files):
-        subprocess.run(["ar",
-                        "-crs",
-                        libraylib_path,
-                        *object_files])
-
-    return result
-
-def build_ex(backend):
-    cc = os.environ.get('CC', 'cc')
-    cxx = os.environ.get('CXX', 'c++')
-    cfiles = []
-    cflags = []
-    lflags = []
-    log(INFO, "Building for {}".format(backend))
-
-    use_cxx = False
-
-    if backend != 'cli':
-        cflags.append('-DEX_GUI')
-
-    if backend == 'raylib':
-        cflags.append('-DEX_GUI_RAYLIB')
-        cflags.append('-I./raylib/raylib-5.0/src/')
-        cflags.append('-L./build/raylib/linux')
-        lflags.append('-l:libraylib.a')
-        cfiles.append('./src/extractor-raylib.c')
-
-    if backend == 'tqt':
-        use_cxx = True
-        cfiles.append('./src/extractor-tqt.cpp')
-        cflags.append('-DTQT_NO_ASCII_CAST')
-        cflags.append('-DTQT_NO_STL')
-        cflags.append('-D_REENTRANT')
-        cflags.append('-DTQT_THREAD_SUPPORT')
-        cflags.append('-I{}'.format(TQTINCS[0]))
-        cflags.append('-I{}'.format(TQTINCS[1]))
-        cflags.append('-Ibuild/')
-        lflags.append('-ltqt-mt')
-
-        tqmoc('./src/extractor-tqt.cpp', './build/extractor-tqt.moc')
-
-    os.makedirs('build', exist_ok=True)
-
-    if use_cxx:
-        std = '-std=c++11'
-    else:
-        std = '-std=c89' # TODO: c11
-
-    res = subprocess.run([
-        cxx if use_cxx else cc,
-        '-Wall', '-Wextra', '-Wconversion', '-Wdouble-promotion',
-        '-Wno-unused-parameter', '-Wno-unused-function', '-Wno-sign-conversion',
-        '-ggdb3',
-        std,
-        '-pedantic',
-        '-I./build/',
-        '-I/usr/include/uchardet/',
-        *cflags,
-        '-o', './build/ex',
-        './src/ar.c',
-        './src/common.c',
-        './src/ex.c',
-        './src/extractor-cli.c',
-        *cfiles,
-        *lflags,
-        '-larchive',
-        '-luchardet',
-        '-lm',
-        '-ldl',
-        '-lpthread'
-    ])
-
-    return res.returncode == 0
-
-def main(args = sys.argv):
-    program = args.pop(0)
-
-    subcommand = None
-    if len(args) <= 0:
-        subcommand = "build"
-    else:
-        subcommand = args.pop(0)
-
-    backend = "cli"
-    if 'EX_BUILD_GUI' in os.environ:
-        gui = os.environ['EX_BUILD_GUI'].lower()
-        if gui == 'raylib':
-            backend = 'raylib'
-            if not build_raylib():
-                return 1
-        elif gui == 'tqt':
-            backend = 'tqt'
-        else:
-            log(ERROR, "Unknown EX_BUILD_GUI: {}".format(gui))
-            return 1
-
-
-    if subcommand == "build":
-        if not build_ex(backend):
-            return 1
-    elif subcommand == "help":
-        print("usage: {} [subcommand]".format(program))
-        print("Subcommands:")
-        print("   build (default)")
-        print("   help")
-
-    return 0
-
-if __name__ == '__main__':
-    sys.exit(main())

+ 513 - 0
nob.c

@@ -0,0 +1,513 @@
+#define NOB_IMPLEMENTATION
+#include "nob.h"
+
+#define DEFAULT_CC "cc"
+#define DEFAULT_CXX "c++"
+
+#define RAYLIB_DIR "./raylib/raylib-5.5/src"
+#define NOB_CACHE ".nob-cache"
+
+enum GuiType
+{
+    GUI_TYPE_NONE = 0,
+    GUI_TYPE_RAYLIB,
+    GUI_TYPE_TQT,
+    GUI_TYPE_MAX
+};
+
+enum BuildType
+{
+    BUILD_TYPE_DEBUG = 0,
+    BUILD_TYPE_RELEASE,
+    BUILD_TYPE_MAX
+};
+
+struct BuildOptions
+{
+    enum GuiType gui_type;
+    enum BuildType build_type;
+    const char *cc;
+    int jobs;
+    bool need_rebuild;
+};
+
+static const char *global_default_cflags[] = {
+    "-Wall", "-Wextra", "-Wconversion", "-Wformat=2", "-Wformat-security", "-Wno-unused-parameter"
+};
+
+static const char *global_cli_files_and_deps[][2] = {
+    { "./src/common.c", "./src/common.o" },
+    { "./src/log.c", "./src/log.o" },
+    { "./src/ar.c", "./src/ar.o" },
+    { "./src/ex.c", "./src/ex.o" },
+    { "./src/extractor-cli.c", "./src/extractor-cli.o" }
+};
+
+static const char *global_raylib_files_and_deps[][2] = {
+    { "./src/extractor-raylib.c", "./src/extractor-raylib.o" },
+};
+
+static const char *global_tqt_files_and_deps[][2] = {
+    { "./src/extractor-tqt.cpp", "./src/extractor-tqt.o" },
+};
+
+void parse_options(struct BuildOptions *options, int argc, char **argv)
+{
+    enum GuiType gui_type = GUI_TYPE_NONE;
+    enum BuildType build_type = BUILD_TYPE_DEBUG;
+
+    for (int i = 1; i < argc; ++i)
+    {
+        if (strncmp("-gui:", argv[i], sizeof("-gui:")-1) == 0)
+        {
+            char *gui = strchr(argv[i], ':');
+            if (strlen(gui) > 1)
+            {
+                ++gui;
+                if (strcmp(gui, "raylib") == 0)
+                {
+                    gui_type = GUI_TYPE_RAYLIB;
+                }
+                else if (strcmp(gui, "tqt") == 0)
+                {
+                    gui_type = GUI_TYPE_TQT;
+                    options->cc = DEFAULT_CXX;
+                }
+                else
+                {
+                    fprintf(stderr, "[ERROR] Unknown GUI backend: %s\n", gui);
+                    abort();
+                }
+            }
+            else
+            {
+                fputs("[ERROR] -gui expects a value.\n", stderr);
+                abort();
+            }
+        }
+        else if (strncmp("-j:", argv[i], 3) == 0)
+        {
+            char *jobs = strchr(argv[i], ':');
+            if (strlen(jobs) > 1)
+            {
+                ++jobs;
+                int num = atoi(jobs);
+                if (num <= 0)
+                {
+                    fprintf(stderr, "[WARN] -j: expects positive number. Will use %d.\n", options->jobs);
+                    continue;
+                }
+                options->jobs = num;
+            }
+            else
+            {
+                fprintf(stderr, "[WARN] -j: expects positive number. Will use %d.\n", options->jobs);
+                continue;
+            }
+        }
+        else if (strncmp("-release", argv[i], sizeof("-release")-1) == 0)
+        {
+            build_type = BUILD_TYPE_RELEASE;
+        }
+    }
+
+    if (options->gui_type != gui_type)
+        options->need_rebuild = true;
+    if (options->build_type != build_type)
+        options->need_rebuild = true;
+
+    options->gui_type = gui_type;
+    options->build_type = build_type;
+}
+
+void build_cli(const struct BuildOptions *options)
+{
+    Nob_Cmd cmd = { 0 };
+    Nob_Procs procs = { 0 };
+    bool needs_link = options->need_rebuild;
+    
+    for (size_t i = 0; i < NOB_ARRAY_LEN(global_cli_files_and_deps); ++i)
+    {
+        if (options->need_rebuild || nob_needs_rebuild1(global_cli_files_and_deps[i][1], global_cli_files_and_deps[i][0]))
+        {
+            needs_link = true;
+            nob_cmd_append(&cmd, options->cc, "-std=c11", "-c", global_cli_files_and_deps[i][0], "-o", global_cli_files_and_deps[i][1]);
+            nob_da_append_many(&cmd, global_default_cflags, NOB_ARRAY_LEN(global_default_cflags));
+
+            if (strcmp("./src/ar.c", global_cli_files_and_deps[i][0]) == 0)
+                nob_cmd_append(&cmd, "-I/usr/include/uchardet");
+
+            if (options->build_type == BUILD_TYPE_RELEASE)
+                nob_cmd_append(&cmd, "-DNDEBUG", "-UDEBUG", "-g", "-O2");
+            else
+                nob_cmd_append(&cmd, "-DDEBUG", "-UNDEBUG", "-g3", "-ggdb", "-O0");
+
+            nob_procs_append_with_flush(&procs, nob_cmd_run_async(cmd), options->jobs);
+
+            cmd.count = 0;
+        }
+    }
+
+    cmd.count = 0;
+
+    if (!nob_procs_wait(procs))
+        abort();
+
+    if (!needs_link && nob_file_exists("ex") == 1)
+        return;
+
+    nob_cmd_append(&cmd, options->cc, "-o", "ex");
+
+    for (size_t i = 0; i < NOB_ARRAY_LEN(global_cli_files_and_deps); ++i)
+    {
+        nob_cmd_append(&cmd, global_cli_files_and_deps[i][1]);
+    }
+
+    nob_cmd_append(&cmd, "-larchive", "-luchardet");
+
+    if (!nob_cmd_run_sync(cmd))
+        abort();
+
+    nob_da_free(procs);
+    nob_cmd_free(cmd);
+}
+
+bool build_libraylib(const struct BuildOptions* options)
+{
+    char dir[PATH_MAX];;
+    memset(dir, '\0', sizeof(dir));
+    getcwd(dir, sizeof(dir));
+    bool result = true;
+
+    if (!nob_set_current_dir(RAYLIB_DIR))
+    {
+        nob_return_defer(false);
+    }
+
+    const char *raylib_files_and_deps[][2] = {
+        { "rcore.c", "rcore.o" },
+        { "rshapes.c", "rshapes.o" },
+        { "rtext.c", "rtext.o" },
+        { "rtextures.c", "rtextures.o" },
+        { "utils.c", "utils.o" }
+    };
+
+    Nob_Procs procs = { 0 };
+    Nob_Cmd cmd = { 0 };
+    bool need_link = false;
+    bool existing_archive = (nob_file_exists("libraylib.a") == 1);
+
+    for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_files_and_deps); ++i)
+    {
+        if (nob_needs_rebuild1(raylib_files_and_deps[i][1], raylib_files_and_deps[i][0]))
+        {
+            need_link = true;
+
+            nob_cmd_append(&cmd, options->cc,
+                           "-std=c11", "-DPLATFORM_DESKTOP_RGFW", "-fPIC",
+                           "-I" RAYLIB_DIR "/external/glfw/include",
+                           "-c", raylib_files_and_deps[i][0],
+                           "-o", raylib_files_and_deps[i][1]);
+
+            nob_procs_append_with_flush(&procs, nob_cmd_run_async_and_reset(&cmd), options->jobs);
+        }
+    }
+
+    if (!nob_procs_wait(procs))
+    {
+        nob_return_defer(false);
+    }
+
+    if (!existing_archive || need_link)
+    {
+        nob_cmd_append(&cmd, "ar", "-crs", "libraylib.a");
+        for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_files_and_deps); ++i)
+        {
+            nob_cmd_append(&cmd, raylib_files_and_deps[i][1]);
+        }
+
+        if (!nob_cmd_run_sync(cmd))
+        {
+            nob_return_defer(false);
+        }
+    }
+
+    nob_set_current_dir(dir);
+    if (nob_file_exists("libraylib.a") == 0 || !existing_archive)
+        nob_copy_file(RAYLIB_DIR "/libraylib.a", "libraylib.a");
+
+    return result;
+
+defer:
+    nob_set_current_dir(dir);
+    return result;
+}
+ 
+void build_raylib(const struct BuildOptions *options)
+{
+    if (!build_libraylib(options))
+        abort();
+
+    if (nob_file_exists("libraylib.a") != 1)
+    {
+        nob_log(NOB_ERROR, "Missing libraylib.a");
+        abort();
+    }
+    
+    Nob_Cmd cmd = { 0 };
+    Nob_Procs procs = { 0 };
+    bool needs_link = options->need_rebuild;
+
+    for (size_t i = 0; i < NOB_ARRAY_LEN(global_cli_files_and_deps); ++i)
+    {
+        if (options->need_rebuild || nob_needs_rebuild1(global_cli_files_and_deps[i][1], global_cli_files_and_deps[i][0]))
+        {
+            needs_link = true;
+            nob_cmd_append(&cmd, options->cc, "-std=c11", "-c", global_cli_files_and_deps[i][0], "-o", global_cli_files_and_deps[i][1]);
+            nob_da_append_many(&cmd, global_default_cflags, NOB_ARRAY_LEN(global_default_cflags));
+
+            if (strcmp("./src/ar.c", global_cli_files_and_deps[i][0]) == 0)
+                nob_cmd_append(&cmd, "-I/usr/include/uchardet");
+            else if (strcmp("./src/ex.c", global_cli_files_and_deps[i][0]) == 0)
+                nob_cmd_append(&cmd, "-DEX_GUI");
+
+            if (options->build_type == BUILD_TYPE_RELEASE)
+                nob_cmd_append(&cmd, "-DNDEBUG", "-UDEBUG", "-g", "-O2");
+            else
+                nob_cmd_append(&cmd, "-DDEBUG", "-UNDEBUG", "-g3", "-ggdb", "-O0");
+
+            nob_procs_append_with_flush(&procs, nob_cmd_run_async(cmd), options->jobs);
+
+            cmd.count = 0;
+        }
+    }
+
+    for (size_t i = 0; i < NOB_ARRAY_LEN(global_raylib_files_and_deps); ++i)
+    {
+        if (options->need_rebuild || nob_needs_rebuild1(global_raylib_files_and_deps[i][1], global_raylib_files_and_deps[i][0]))
+        {
+            needs_link = true;
+            nob_cmd_append(&cmd, options->cc, "-std=c11", "-c", global_raylib_files_and_deps[i][0], "-o", global_raylib_files_and_deps[i][1]);
+            nob_da_append_many(&cmd, global_default_cflags, NOB_ARRAY_LEN(global_default_cflags));
+            nob_cmd_append(&cmd, "-I" RAYLIB_DIR);
+
+            if (options->build_type == BUILD_TYPE_RELEASE)
+                nob_cmd_append(&cmd, "-DNDEBUG", "-UDEBUG", "-g", "-O2");
+            else
+                nob_cmd_append(&cmd, "-DDEBUG", "-UNDEBUG", "-g3", "-ggdb", "-O0");
+
+            nob_procs_append_with_flush(&procs, nob_cmd_run_async(cmd), options->jobs);
+
+            cmd.count = 0;
+        }
+    }
+
+    cmd.count = 0;
+
+    if (!nob_procs_wait(procs))
+        abort();
+
+    if (!needs_link && nob_file_exists("ex"))
+        return;
+
+    nob_cmd_append(&cmd, options->cc, "-o", "ex");
+
+    for (size_t i = 0; i < NOB_ARRAY_LEN(global_cli_files_and_deps); ++i)
+        nob_cmd_append(&cmd, global_cli_files_and_deps[i][1]);
+    for (size_t i = 0; i < NOB_ARRAY_LEN(global_raylib_files_and_deps); ++i)
+        nob_cmd_append(&cmd, global_raylib_files_and_deps[i][1]);
+
+    nob_cmd_append(&cmd, "libraylib.a", "-lm", "-larchive", "-luchardet", "-lX11", "-lXrandr", "-lGLX");
+
+    if (!nob_cmd_run_sync(cmd))
+        abort();
+}
+
+void build_tqt(const struct BuildOptions *options)
+{
+    Nob_Cmd cmd = { 0 };
+
+    if (nob_needs_rebuild1("src/extractor-tqt.moc", "src/extractor-tqt.cpp"))
+    {
+        nob_cmd_append(&cmd, "tqmoc", "src/extractor-tqt.cpp", "-o", "src/extractor-tqt.moc");
+        if (!nob_cmd_run_sync(cmd))
+            abort();
+
+        cmd.count = 0;
+    }
+
+    Nob_Procs procs = { 0 };
+    bool needs_link = options->need_rebuild;
+
+    for (size_t i = 0; i < NOB_ARRAY_LEN(global_cli_files_and_deps); ++i)
+    {
+        if (options->need_rebuild || nob_needs_rebuild1(global_cli_files_and_deps[i][1], global_cli_files_and_deps[i][0]))
+        {
+            needs_link = true;
+            nob_cmd_append(&cmd, options->cc, "-std=c++11", "-c", global_cli_files_and_deps[i][0], "-o", global_cli_files_and_deps[i][1]);
+            nob_da_append_many(&cmd, global_default_cflags, NOB_ARRAY_LEN(global_default_cflags));
+
+            if (strcmp("./src/ar.c", global_cli_files_and_deps[i][0]) == 0)
+                nob_cmd_append(&cmd, "-I/usr/include/uchardet");
+            else if (strcmp("./src/ex.c", global_cli_files_and_deps[i][0]) == 0)
+                nob_cmd_append(&cmd, "-DEX_GUI");
+
+            if (options->build_type == BUILD_TYPE_RELEASE)
+                nob_cmd_append(&cmd, "-DNDEBUG", "-UDEBUG", "-g", "-O2");
+            else
+                nob_cmd_append(&cmd, "-DDEBUG", "-UNDEBUG", "-g3", "-ggdb", "-O0");
+
+            nob_procs_append_with_flush(&procs, nob_cmd_run_async(cmd), options->jobs);
+
+            cmd.count = 0;
+        }
+    }
+
+    for (size_t i = 0; i < NOB_ARRAY_LEN(global_tqt_files_and_deps); ++i)
+    {
+        if (options->need_rebuild || nob_needs_rebuild1(global_tqt_files_and_deps[i][1], global_tqt_files_and_deps[i][0]))
+        {
+            needs_link = true;
+            nob_cmd_append(&cmd, options->cc, "-c", global_tqt_files_and_deps[i][0], "-o", global_tqt_files_and_deps[i][1]);
+            nob_da_append_many(&cmd, global_default_cflags, NOB_ARRAY_LEN(global_default_cflags));
+            nob_cmd_append(&cmd, "-I/usr/include/tqt3", "-DTQT_THREAD_SUPPORT", "-DTQT_NO_ASCII_CAST", "-DTQT_NO_STL", "-D_REENTRANT");
+
+            if (options->build_type == BUILD_TYPE_RELEASE)
+                nob_cmd_append(&cmd, "-DNDEBUG", "-UDEBUG", "-g", "-O2");
+            else
+                nob_cmd_append(&cmd, "-DDEBUG", "-UNDEBUG", "-g3", "-ggdb", "-O0");
+
+            nob_procs_append_with_flush(&procs, nob_cmd_run_async(cmd), options->jobs);
+
+            cmd.count = 0;
+        }
+    }
+
+    cmd.count = 0;
+
+    if (!nob_procs_wait(procs))
+        abort();
+
+    if (!needs_link && nob_file_exists("ex") == 1)
+        return;
+
+    nob_cmd_append(&cmd, options->cc, "-o", "ex");
+
+    for (size_t i = 0; i < NOB_ARRAY_LEN(global_cli_files_and_deps); ++i)
+    {
+        nob_cmd_append(&cmd, global_cli_files_and_deps[i][1]);
+    }
+
+    for (size_t i = 0; i < NOB_ARRAY_LEN(global_tqt_files_and_deps); ++i)
+    {
+        nob_cmd_append(&cmd, global_tqt_files_and_deps[i][1]);
+    }
+
+    nob_cmd_append(&cmd, "-larchive", "-ltqt-mt", "-luchardet");
+
+    if (!nob_cmd_run_sync(cmd))
+        abort();
+
+    nob_da_free(procs);
+    nob_cmd_free(cmd);
+}
+
+void parse_previous_config(struct BuildOptions *options)
+{
+    // Defaults
+    options->gui_type = GUI_TYPE_NONE;
+    options->build_type = BUILD_TYPE_DEBUG;
+    options->cc = DEFAULT_CC;
+    options->jobs = 1;
+
+    FILE *config = fopen(NOB_CACHE, "r");
+    if (!config)
+        return;
+
+    char *line = NULL;
+    size_t len = 0;
+    size_t nread;
+
+    while ((nread = getline(&line, &len, config)) != -1)
+    {
+        char *token = strtok(line, "=");
+        if (!token)
+        {
+            nob_log(NOB_WARNING, "Invalid previous configuration line (no '='): %s", line);
+            continue;
+        }
+
+        char *value = strtok(NULL, "=");
+        if (!value)
+        {
+            nob_log(NOB_WARNING, "Invalid previous configuration line (no value): %s", line);
+            continue;
+        }
+
+        if (strcmp(token, "gui_type") == 0)
+        {
+            int type = atoi(value);
+            if (type >= GUI_TYPE_MAX || type < GUI_TYPE_NONE)
+            {
+                nob_log(NOB_WARNING, "Invalid previous configuration GuiType: %d", value);
+                continue;
+            }
+            options->gui_type = type;
+        }
+        else if (strcmp(token, "build_type") == 0)
+        {
+            int type = atoi(value);
+            if (type >= BUILD_TYPE_MAX || type < BUILD_TYPE_DEBUG)
+            {
+                nob_log(NOB_WARNING, "Invalid previous configuration BuildType: %d", value);
+                continue;
+            }
+            options->build_type = type;
+        }
+    }
+}
+
+void write_config(const struct BuildOptions *options)
+{
+    FILE *config = fopen(NOB_CACHE, "w");
+    if (!config)
+    {
+        perror("fopen");
+        return;
+    }
+
+    fprintf(config, "gui_type=%d\n", options->gui_type);
+    fprintf(config, "build_type=%d\n", options->build_type);
+
+    fflush(config);
+    fclose(config);
+}
+
+int main(int argc, char **argv)
+{
+    NOB_GO_REBUILD_URSELF(argc, argv);
+
+    struct BuildOptions options;
+    parse_previous_config(&options);
+    parse_options(&options, argc, argv);
+
+    switch (options.gui_type)
+    {
+    case GUI_TYPE_NONE:
+        build_cli(&options);
+        break;
+    case GUI_TYPE_RAYLIB:
+        build_raylib(&options);
+        break;
+    case GUI_TYPE_TQT:
+        build_tqt(&options);
+        break;
+    default:
+        fprintf(stderr, "[ERROR] Do not know how to build GUI for GuiType %d\n", options.gui_type);
+        exit(1);
+    }
+
+    write_config(&options);
+
+    return 0;
+}

Разлика између датотеке није приказан због своје велике величине
+ 2111 - 0
nob.h


+ 0 - 5
raylib/raylib-5.0/README

@@ -1,5 +0,0 @@
-Original raylib 5.0 source code downloaded from https://github.com/raysan5/raylib/releases/tag/5.0
-Removed everything except the LICENSE file and src directory.
-Made changes to raylib.h to support including when compiling in C89.
-
-- mio

+ 0 - 126
raylib/raylib-5.0/src/CMakeLists.txt

@@ -1,126 +0,0 @@
-# Setup the project and settings
-project(raylib C)
-set(PROJECT_VERSION 4.5.0)
-set(API_VERSION 450)
-
-include(GNUInstallDirs)
-include(JoinPaths)
-
-# Sets build type if not set by now
-if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
-    if(RAYLIB_IS_MAIN)
-        set(default_build_type Debug)
-    else()
-        message(WARNING "Default build type is not set (CMAKE_BUILD_TYPE)")
-    endif()
-
-    message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
-    
-    set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
-    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
-endif()
-
-# Used as public API to be included into other projects
-set(raylib_public_headers
-    raylib.h
-    rlgl.h
-    raymath.h
-    )
-
-# Sources to be compiled
-set(raylib_sources
-    rcore.c
-    rmodels.c
-    rshapes.c
-    rtext.c
-    rtextures.c
-    utils.c
-    )
-
-# <root>/cmake/GlfwImport.cmake handles the details around the inclusion of glfw
-if (NOT ${PLATFORM} MATCHES "Web")
-    include(GlfwImport)
-endif ()
-
-# Sets additional platform options and link libraries for each platform
-# also selects the proper graphics API and version for that platform
-# Produces a variable LIBS_PRIVATE that will be used later
-include(LibraryConfigurations)
-
-if (USE_AUDIO)
-    MESSAGE(STATUS "Audio Backend: miniaudio")
-    list(APPEND raylib_sources raudio.c)
-else ()
-    MESSAGE(STATUS "Audio Backend: None (-DUSE_AUDIO=OFF)")
-endif ()
-
-
-add_library(raylib ${raylib_sources} ${raylib_public_headers})
-
-if (NOT BUILD_SHARED_LIBS)
-    MESSAGE(STATUS "Building raylib static library")
-    add_library(raylib_static ALIAS raylib)
-else()
-    MESSAGE(STATUS "Building raylib shared library")
-    if (WIN32)
-        target_compile_definitions(raylib
-                                   PRIVATE $<BUILD_INTERFACE:BUILD_LIBTYPE_SHARED>
-                                   INTERFACE $<INSTALL_INTERFACE:USE_LIBTYPE_SHARED>
-                                   )
-    endif ()
-endif()
-
-if (${PLATFORM} MATCHES "Web")
-    target_link_options(raylib PRIVATE "-sUSE_GLFW=3")
-endif()
-
-set_target_properties(raylib PROPERTIES
-                      PUBLIC_HEADER "${raylib_public_headers}"
-                      VERSION ${PROJECT_VERSION}
-                      SOVERSION ${API_VERSION}
-                      )
-
-if (WITH_PIC OR BUILD_SHARED_LIBS)
-    set_property(TARGET raylib PROPERTY POSITION_INDEPENDENT_CODE ON)
-endif ()
-
-target_link_libraries(raylib "${LIBS_PRIVATE}")
-
-# Sets some compile time definitions for the pre-processor
-# If CUSTOMIZE_BUILD option is on you will not use config.h by default
-# and you will be able to select more build options
-include(CompileDefinitions)
-
-# Registering include directories
-target_include_directories(raylib
-                           PUBLIC
-                           $<INSTALL_INTERFACE:include>
-                           $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
-                           PRIVATE
-                           ${CMAKE_CURRENT_SOURCE_DIR}
-                           ${OPENGL_INCLUDE_DIR}
-                           ${OPENAL_INCLUDE_DIR}
-                           )
-
-# Copy the header files to the build directory for convenience
-file(COPY ${raylib_public_headers} DESTINATION "include")
-
-# Includes information on how the library will be installed on the system
-# when cmake --install is run
-include(InstallConfigurations)
-
-# Print the flags for the user
-if (DEFINED CMAKE_BUILD_TYPE)
-    message(STATUS "Generated build type: ${CMAKE_BUILD_TYPE}")
-else ()
-    message(STATUS "Generated config types: ${CMAKE_CONFIGURATION_TYPES}")
-endif ()
-
-message(STATUS "Compiling with the flags:")
-message(STATUS "  PLATFORM=" ${PLATFORM_CPP})
-message(STATUS "  GRAPHICS=" ${GRAPHICS})
-
-# Options if you want to create an installer using CPack
-include(PackConfigurations)
-
-enable_testing()

+ 0 - 809
raylib/raylib-5.0/src/Makefile

@@ -1,809 +0,0 @@
-#******************************************************************************
-#
-#   raylib makefile
-#
-#   This file supports building raylib library for the following platforms:
-#
-#     > PLATFORM_DESKTOP (GLFW backend):
-#         - Windows (Win32, Win64)
-#         - Linux (X11/Wayland desktop mode)
-#         - macOS/OSX (x64, arm64)
-#         - FreeBSD, OpenBSD, NetBSD, DragonFly (X11 desktop)
-#     > PLATFORM_DESKTOP_SDL (SDL backend):
-#         - Windows (Win32, Win64)
-#         - Linux (X11/Wayland desktop mode)
-#         - Others (not tested)
-#     > PLATFORM_WEB:
-#         - HTML5 (WebAssembly)
-#     > PLATFORM_DRM:
-#         - Raspberry Pi 0-5 (DRM/KMS)
-#         - Linux DRM subsystem (KMS mode)
-#     > PLATFORM_ANDROID:
-#         - Android (ARM, ARM64)
-#
-#   Many thanks to Milan Nikolic (@gen2brain) for implementing Android platform pipeline.
-#   Many thanks to Emanuele Petriglia for his contribution on GNU/Linux pipeline.
-#
-#   Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
-#
-#   This software is provided "as-is", without any express or implied warranty. In no event
-#   will the authors be held liable for any damages arising from the use of this software.
-#
-#   Permission is granted to anyone to use this software for any purpose, including commercial
-#   applications, and to alter it and redistribute it freely, subject to the following restrictions:
-#
-#     1. The origin of this software must not be misrepresented; you must not claim that you
-#     wrote the original software. If you use this software in a product, an acknowledgment
-#     in the product documentation would be appreciated but is not required.
-#
-#     2. Altered source versions must be plainly marked as such, and must not be misrepresented
-#     as being the original software.
-#
-#     3. This notice may not be removed or altered from any source distribution.
-#
-#**************************************************************************************************
-
-# NOTE: Highly recommended to read the raylib Wiki to know how to compile raylib for different platforms
-# https://github.com/raysan5/raylib/wiki
-
-.PHONY: all clean install uninstall
-
-# Define required environment variables
-#------------------------------------------------------------------------------------------------
-# Define target platform: PLATFORM_DESKTOP, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
-PLATFORM             ?= PLATFORM_DESKTOP
-
-# Define required raylib variables
-RAYLIB_VERSION        = 5.0.0
-RAYLIB_API_VERSION    = 500
-
-# Define raylib source code path
-RAYLIB_SRC_PATH      ?= ../src
-
-# Define output directory for compiled library, defaults to src directory
-# NOTE: If externally provided, make sure directory exists
-RAYLIB_RELEASE_PATH  ?= $(RAYLIB_SRC_PATH)
-
-# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
-RAYLIB_LIBTYPE       ?= STATIC
-
-# Build mode for library: DEBUG or RELEASE
-RAYLIB_BUILD_MODE    ?= RELEASE
-
-# Build output name for the library
-RAYLIB_LIB_NAME      ?= raylib
-
-# Define resource file for DLL properties
-RAYLIB_RES_FILE      ?= ./raylib.dll.rc.data
-
-# Define external config flags
-# NOTE: It will override config.h flags with the provided ones,
-# if NONE, default config.h flags are used
-RAYLIB_CONFIG_FLAGS  ?= NONE
-
-# To define additional cflags: Use make CUSTOM_CFLAGS=""
-
-# Include raylib modules on compilation
-# NOTE: Some programs like tools could not require those modules
-RAYLIB_MODULE_AUDIO  ?= TRUE
-RAYLIB_MODULE_MODELS ?= TRUE
-RAYLIB_MODULE_RAYGUI ?= FALSE
-
-# NOTE: Additional libraries have been moved to their own repos:
-# raygui: https://github.com/raysan5/raygui
-RAYLIB_MODULE_RAYGUI_PATH ?= $(RAYLIB_SRC_PATH)/../../raygui/src
-
-# Use external GLFW library instead of rglfw module
-USE_EXTERNAL_GLFW     ?= FALSE
-
-# PLATFORM_DESKTOP_SDL: It requires SDL library to be provided externally
-# WARNING: Library is not included in raylib, it MUST be configured by users
-SDL_INCLUDE_PATH      ?= $(RAYLIB_SRC_PATH)/external/SDL2-2.28.4/include
-SDL_LIBRARY_PATH      ?= $(RAYLIB_SRC_PATH)/external/SDL2-2.28.4/lib/x64
-
-# Use Wayland display server protocol on Linux desktop (by default it uses X11 windowing system)
-# NOTE: This variable is only used for PLATFORM_OS: LINUX
-USE_WAYLAND_DISPLAY   ?= FALSE
-
-# Determine if the file has root access (only required to install raylib)
-# "whoami" prints the name of the user that calls him (so, if it is the root user, "whoami" prints "root")
-ROOT = $(shell whoami)
-
-# By default we suppose we are working on Windows
-HOST_PLATFORM_OS ?= WINDOWS
-PLATFORM_OS ?= WINDOWS
-
-# Determine PLATFORM_OS when required
-ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_DESKTOP_SDL PLATFORM_WEB))
-    # No uname.exe on MinGW!, but OS=Windows_NT on Windows!
-    # ifeq ($(UNAME),Msys) -> Windows
-    ifeq ($(OS),Windows_NT)
-        PLATFORM_OS = WINDOWS
-        ifndef PLATFORM_SHELL
-            PLATFORM_SHELL = cmd
-        endif
-    else
-        UNAMEOS = $(shell uname)
-        ifeq ($(UNAMEOS),Linux)
-            PLATFORM_OS = LINUX
-        endif
-        ifeq ($(UNAMEOS),FreeBSD)
-            PLATFORM_OS = BSD
-        endif
-        ifeq ($(UNAMEOS),OpenBSD)
-            PLATFORM_OS = BSD
-        endif
-        ifeq ($(UNAMEOS),NetBSD)
-            PLATFORM_OS = BSD
-        endif
-        ifeq ($(UNAMEOS),DragonFly)
-            PLATFORM_OS = BSD
-        endif
-        ifeq ($(UNAMEOS),Darwin)
-            PLATFORM_OS = OSX
-        endif
-        ifndef PLATFORM_SHELL
-            PLATFORM_SHELL = sh
-        endif
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_DRM)
-    UNAMEOS = $(shell uname)
-    ifeq ($(UNAMEOS),Linux)
-        PLATFORM_OS = LINUX
-    endif
-    ifndef PLATFORM_SHELL
-        PLATFORM_SHELL = sh
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_WEB)
-    ifeq ($(PLATFORM_OS),LINUX)
-        ifndef PLATFORM_SHELL
-            PLATFORM_SHELL = sh
-        endif
-    endif
-endif
-
-ifeq ($(PLATFORM),PLATFORM_WEB)
-    ifeq ($(PLATFORM_OS), WINDOWS)
-        # Emscripten required variables
-        EMSDK_PATH         ?= C:/emsdk
-        EMSCRIPTEN_PATH    ?= $(EMSDK_PATH)/upstream/emscripten
-        CLANG_PATH         := $(EMSDK_PATH)/upstream/bin
-        PYTHON_PATH        := $(EMSDK_PATH)/python/3.9.2-1_64bit
-        NODE_PATH          := $(EMSDK_PATH)/node/14.15.5_64bit/bin
-        export PATH        := $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:/raylib/MinGW/bin;$(PATH)
-    endif
-endif
-
-ifeq ($(PLATFORM),PLATFORM_ANDROID)
-    # Android architecture
-    # Starting at 2019 using arm64 is mandatory for published apps,
-    # Starting on August 2020, minimum required target API is Android 10 (API level 29)
-    ANDROID_ARCH ?= arm64
-    ANDROID_API_VERSION ?= 29
-
-    # Android required path variables
-    # NOTE: Starting with Android NDK r21, no more toolchain generation is required, NDK is the toolchain on itself
-    ifeq ($(OS),Windows_NT)
-        ANDROID_NDK ?= C:/android-ndk
-        ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64
-    else
-        ANDROID_NDK ?= /usr/lib/android/ndk
-        ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64
-    endif
-
-    # NOTE: Sysroot can also be reference from $(ANDROID_NDK)/sysroot
-    ANDROID_SYSROOT ?= $(ANDROID_TOOLCHAIN)/sysroot
-
-    ifeq ($(ANDROID_ARCH),arm)
-        ANDROID_COMPILER_ARCH = armv7a
-    endif
-    ifeq ($(ANDROID_ARCH),arm64)
-        ANDROID_COMPILER_ARCH = aarch64
-    endif
-    ifeq ($(ANDROID_ARCH),x86)
-        ANDROID_COMPILER_ARCH = i686
-    endif
-    ifeq ($(ANDROID_ARCH),x86_64)
-        ANDROID_COMPILER_ARCH = x86_64
-    endif
-
-endif
-
-# Define raylib graphics api depending on selected platform
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-    # By default use OpenGL 3.3 on desktop platforms
-    GRAPHICS ?= GRAPHICS_API_OPENGL_33
-    #GRAPHICS = GRAPHICS_API_OPENGL_11      # Uncomment to use OpenGL 1.1
-    #GRAPHICS = GRAPHICS_API_OPENGL_21      # Uncomment to use OpenGL 2.1
-    #GRAPHICS = GRAPHICS_API_OPENGL_43      # Uncomment to use OpenGL 4.3
-    #GRAPHICS = GRAPHICS_API_OPENGL_ES2     # Uncomment to use OpenGL ES 2.0 (ANGLE)
-endif
-ifeq ($(PLATFORM),PLATFORM_DESKTOP_SDL)
-    # By default use OpenGL 3.3 on desktop platform with SDL backend
-    GRAPHICS ?= GRAPHICS_API_OPENGL_33
-endif
-ifeq ($(PLATFORM),PLATFORM_DRM)
-    # On DRM OpenGL ES 2.0 must be used
-    GRAPHICS = GRAPHICS_API_OPENGL_ES2
-endif
-ifeq ($(PLATFORM),PLATFORM_WEB)
-    # On HTML5 OpenGL ES 2.0 is used, emscripten translates it to WebGL 1.0
-    GRAPHICS = GRAPHICS_API_OPENGL_ES2
-    #GRAPHICS = GRAPHICS_API_OPENGL_ES3      # Uncomment to use ES3/WebGL2 (preliminary support).
-endif
-ifeq ($(PLATFORM),PLATFORM_ANDROID)
-    # By default use OpenGL ES 2.0 on Android
-    GRAPHICS = GRAPHICS_API_OPENGL_ES2
-endif
-
-# Define default C compiler and archiver to pack library: CC, AR
-#------------------------------------------------------------------------------------------------
-CC = gcc
-AR = ar
-
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-    ifeq ($(PLATFORM_OS),OSX)
-        # OSX default compiler
-        CC = clang
-        GLFW_OSX = -x objective-c
-    endif
-    ifeq ($(PLATFORM_OS),BSD)
-        # FreeBSD, OpenBSD, NetBSD, DragonFly default compiler
-        CC = clang
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_DRM)
-    ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
-        # Define RPI cross-compiler
-        #CC = armv6j-hardfloat-linux-gnueabi-gcc
-        CC = $(RPI_TOOLCHAIN)/bin/$(RPI_TOOLCHAIN_NAME)-gcc
-        AR = $(RPI_TOOLCHAIN)/bin/$(RPI_TOOLCHAIN_NAME)-ar
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_WEB)
-    # HTML5 emscripten compiler
-    CC = emcc
-    AR = emar
-endif
-ifeq ($(PLATFORM),PLATFORM_ANDROID)
-    # Android toolchain (must be provided for desired architecture and compiler)
-    ifeq ($(ANDROID_ARCH),arm)
-        CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-androideabi$(ANDROID_API_VERSION)-clang
-    endif
-    ifeq ($(ANDROID_ARCH),arm64)
-        CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-android$(ANDROID_API_VERSION)-clang
-    endif
-    ifeq ($(ANDROID_ARCH),x86)
-        CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-android$(ANDROID_API_VERSION)-clang
-    endif
-    ifeq ($(ANDROID_ARCH),x86_64)
-        CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-android$(ANDROID_API_VERSION)-clang
-    endif
-    # It seems from Android NDK r22 onwards we need to use llvm-ar
-    AR = $(ANDROID_TOOLCHAIN)/bin/llvm-ar
-endif
-
-# Define compiler flags: CFLAGS
-#------------------------------------------------------------------------------------------------
-#  -O1                      defines optimization level
-#  -g                       include debug information on compilation
-#  -s                       strip unnecessary data from build --> linker
-#  -Wall                    turns on most, but not all, compiler warnings
-#  -std=c99                 defines C language mode (standard C from 1999 revision)
-#  -std=gnu99               defines C language mode (GNU C from 1999 revision)
-#  -Wno-missing-braces      ignore invalid warning (GCC bug 53119)
-#  -Wno-unused-value        ignore unused return values of some functions (i.e. fread())
-#  -D_DEFAULT_SOURCE        use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
-#  -D_GNU_SOURCE            access to lots of nonstandard GNU/Linux extension functions
-#  -Werror=pointer-arith    catch unportable code that does direct arithmetic on void pointers
-#  -fno-strict-aliasing     jar_xm.h does shady stuff (breaks strict aliasing)
-CFLAGS = -Wall -D_GNU_SOURCE -D$(PLATFORM) -D$(GRAPHICS) -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing $(CUSTOM_CFLAGS)
-
-ifneq ($(RAYLIB_CONFIG_FLAGS), NONE)
-    CFLAGS += -DEXTERNAL_CONFIG_FLAGS $(RAYLIB_CONFIG_FLAGS)
-endif
-
-ifeq ($(PLATFORM), PLATFORM_WEB)
-    # NOTE: When using multi-threading in the user code, it requires -pthread enabled
-    CFLAGS += -std=gnu99
-else
-    CFLAGS += -std=c99
-endif
-
-ifeq ($(PLATFORM_OS), LINUX)
-    CFLAGS += -fPIC
-endif
-
-ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
-    CFLAGS += -g -D_DEBUG
-endif
-
-ifeq ($(RAYLIB_BUILD_MODE),RELEASE)
-    ifeq ($(PLATFORM),PLATFORM_WEB)
-        CFLAGS += -Os
-    endif
-    ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-        CFLAGS += -O1
-    endif
-    ifeq ($(PLATFORM),PLATFORM_ANDROID)
-        CFLAGS += -O2
-    endif
-endif
-
-# Additional flags for compiler (if desired)
-#  -Wextra                  enables some extra warning flags that are not enabled by -Wall
-#  -Wmissing-prototypes     warn if a global function is defined without a previous prototype declaration
-#  -Wstrict-prototypes      warn if a function is declared or defined without specifying the argument types
-#  -Werror=implicit-function-declaration   catch function calls without prior declaration
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-    CFLAGS += -Werror=implicit-function-declaration
-endif
-ifeq ($(PLATFORM),PLATFORM_WEB)
-    # -Os                        # size optimization
-    # -O2                        # optimization level 2, if used, also set --memory-init-file 0
-    # -s USE_GLFW=3              # Use glfw3 library (context/input management) -> Only for linker!
-    # -s ALLOW_MEMORY_GROWTH=1   # to allow memory resizing -> WARNING: Audio buffers could FAIL!
-    # -s TOTAL_MEMORY=16777216   # to specify heap memory size (default = 16MB)
-    # -s USE_PTHREADS=1          # multithreading support
-    # -s FORCE_FILESYSTEM=1      # force filesystem to load/save files data
-    # -s ASSERTIONS=1            # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
-    # --profiling                # include information for code profiling
-    # --memory-init-file 0       # to avoid an external memory initialization code file (.mem)
-    # --preload-file resources   # specify a resources folder for data compilation
-    ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
-        CFLAGS += -s ASSERTIONS=1 --profiling
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_ANDROID)
-    # Compiler flags for arquitecture
-    ifeq ($(ANDROID_ARCH),arm)
-        CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16
-    endif
-    ifeq ($(ANDROID_ARCH),arm64)
-        CFLAGS += -target aarch64 -mfix-cortex-a53-835769
-    endif
-    ifeq ($(ANDROID_ARCH),x86)
-        CFLAGS += -march=i686
-    endif
-    ifeq ($(ANDROID_ARCH),x86_64)
-        CFLAGS += -march=x86-64
-    endif
-    # Compilation functions attributes options
-    CFLAGS += -ffunction-sections -funwind-tables -fstack-protector-strong -fPIE -fPIC
-    # Compiler options for the linker
-    # -Werror=format-security
-    CFLAGS += -Wa,--noexecstack -Wformat -no-canonical-prefixes
-    # Preprocessor macro definitions
-    CFLAGS += -D__ANDROID__ -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION) -DMAL_NO_OSS
-endif
-
-# Define required compilation flags for raylib SHARED lib
-ifeq ($(RAYLIB_LIBTYPE),SHARED)
-    # make sure code is compiled as position independent
-    # BE CAREFUL: It seems that for gcc -fpic is not the same as -fPIC
-    # MinGW32 just doesn't need -fPIC, it shows warnings
-    CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED
-endif
-ifeq ($(PLATFORM),PLATFORM_DRM)
-    # without EGL_NO_X11 eglplatform.h tears Xlib.h in which tears X.h in
-    # which contains a conflicting type Font
-    CFLAGS += -DEGL_NO_X11
-    CFLAGS += -Werror=implicit-function-declaration
-endif
-# Use Wayland display on Linux desktop
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-    ifeq ($(PLATFORM_OS), LINUX)
-        ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
-            CFLAGS += -D_GLFW_WAYLAND
-            LDFLAGS += $(shell pkg-config wayland-client wayland-cursor wayland-egl xkbcommon --libs)
-
-            WL_PROTOCOLS_DIR := $(shell pkg-config wayland-protocols --variable=pkgdatadir)
-            WL_CLIENT_DIR := $(shell pkg-config wayland-client --variable=pkgdatadir)
-
-            wl_generate = \
-                $(eval protocol=$(1)) \
-                $(eval basename=$(2)) \
-                $(shell wayland-scanner client-header $(protocol) $(RAYLIB_SRC_PATH)/$(basename).h) \
-                $(shell wayland-scanner private-code $(protocol) $(RAYLIB_SRC_PATH)/$(basename)-code.h)
-
-            $(call wl_generate, $(WL_CLIENT_DIR)/wayland.xml, wayland-client-protocol)
-            $(call wl_generate, $(WL_PROTOCOLS_DIR)/stable/xdg-shell/xdg-shell.xml, wayland-xdg-shell-client-protocol)
-            $(call wl_generate, $(WL_PROTOCOLS_DIR)/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml, wayland-xdg-decoration-client-protocol)
-            $(call wl_generate, $(WL_PROTOCOLS_DIR)/stable/viewporter/viewporter.xml, wayland-viewporter-client-protocol)
-            $(call wl_generate, $(WL_PROTOCOLS_DIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml, wayland-relative-pointer-unstable-v1-client-protocol)
-            $(call wl_generate, $(WL_PROTOCOLS_DIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml, wayland-pointer-constraints-unstable-v1-client-protocol)
-            $(call wl_generate, $(WL_PROTOCOLS_DIR)/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml, wayland-idle-inhibit-unstable-v1-client-protocol)
-        endif
-    endif
-endif
-
-# Define include paths for required headers: INCLUDE_PATHS
-# NOTE: Several external required libraries (stb and others)
-#------------------------------------------------------------------------------------------------
-INCLUDE_PATHS = -I. 
-
-# Define additional directories containing required header files
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-    INCLUDE_PATHS += -Iexternal/glfw/include -Iexternal/glfw/deps/mingw
-    ifeq ($(PLATFORM_OS),BSD)
-        INCLUDE_PATHS += -I/usr/local/include
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_DESKTOP_SDL)
-    INCLUDE_PATHS += -I$(SDL_INCLUDE_PATH)
-endif
-ifeq ($(PLATFORM),PLATFORM_WEB)
-    INCLUDE_PATHS += -Iexternal/glfw/include -Iexternal/glfw/deps/mingw
-endif
-ifeq ($(PLATFORM),PLATFORM_DRM)
-    INCLUDE_PATHS += -I/usr/include/libdrm
-    ifeq ($(USE_RPI_CROSSCOMPILER), TRUE)
-        INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/usr/include
-        INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_ANDROID)
-    NATIVE_APP_GLUE = $(ANDROID_NDK)/sources/android/native_app_glue
-    # Include android_native_app_glue.h
-    INCLUDE_PATHS += -I$(NATIVE_APP_GLUE)
-
-    # Android required libraries
-    INCLUDE_PATHS += -I$(ANDROID_SYSROOT)/usr/include
-    ifeq ($(ANDROID_ARCH),arm)
-        INCLUDE_PATHS += -I$(ANDROID_SYSROOT)/usr/include/arm-linux-androideabi
-    endif
-    ifeq ($(ANDROID_ARCH),arm64)
-        INCLUDE_PATHS += -I$(ANDROID_SYSROOT)/usr/include/aarch64-linux-android
-    endif
-    ifeq ($(ANDROID_ARCH),x86)
-        INCLUDE_PATHS += -I$(ANDROID_SYSROOT)/usr/include/i686-linux-android
-    endif
-    ifeq ($(ANDROID_ARCH),x86_64)
-        INCLUDE_PATHS += -I$(ANDROID_SYSROOT)/usr/include/x86_64-linux-android
-    endif
-endif
-
-# Define library paths containing required libs: LDFLAGS
-# NOTE: This is only required for dynamic library generation
-#------------------------------------------------------------------------------------------------
-LDFLAGS = $(CUSTOM_LDFLAGS) -L. -L$(RAYLIB_RELEASE_PATH)
-
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-    ifeq ($(PLATFORM_OS),WINDOWS)
-        ifneq ($(CC), tcc)
-            LDFLAGS += -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME)dll.a
-        endif
-    endif
-    ifeq ($(PLATFORM_OS),OSX)
-        LDFLAGS += -compatibility_version $(RAYLIB_API_VERSION) -current_version $(RAYLIB_VERSION)
-    endif
-    ifeq ($(PLATFORM_OS),LINUX)
-        LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
-    endif
-    ifeq ($(PLATFORM_OS),BSD)
-        LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).so -Lsrc -L/usr/local/lib
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_DESKTOP_SDL)
-    LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
-    LDFLAGS += -L$(SDL_LIBRARY_PATH)
-endif
-ifeq ($(PLATFORM),PLATFORM_DRM)
-    LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
-    ifeq ($(USE_RPI_CROSSCOMPILER), TRUE)
-        LDFLAGS += -L$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/lib -L$(RPI_TOOLCHAIN_SYSROOT)/usr/lib
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_ANDROID)
-    LDFLAGS += -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -Wl,--exclude-libs,libatomic.a
-    LDFLAGS += -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings
-    # Force linking of library module to define symbol
-    LDFLAGS += -u ANativeActivity_onCreate
-    # Library paths containing required libs
-    LDFLAGS += -Lsrc
-    # Avoid unresolved symbol pointing to external main()
-    LDFLAGS += -Wl,-undefined,dynamic_lookup
-endif
-
-# Define libraries required on linking: LDLIBS
-# NOTE: This is only required for dynamic library generation
-#------------------------------------------------------------------------------------------------
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-    ifeq ($(PLATFORM_OS),WINDOWS)
-        ifeq ($(CC), tcc)
-            LDLIBS = -lopengl32 -lgdi32 -lwinmm -lshell32
-        else
-            LDLIBS = -static-libgcc -lopengl32 -lgdi32 -lwinmm
-        endif
-    endif
-    ifeq ($(PLATFORM_OS),LINUX)
-        LDLIBS = -lGL -lc -lm -lpthread -ldl -lrt
-        ifeq ($(USE_WAYLAND_DISPLAY),FALSE)
-            LDLIBS += -lX11
-        endif
-        # TODO: On ARM 32bit arch, miniaudio requires atomics library
-        #LDLIBS += -latomic
-    endif
-    ifeq ($(PLATFORM_OS),OSX)
-        LDLIBS = -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo
-    endif
-    ifeq ($(PLATFORM_OS),BSD)
-        LDLIBS = -lGL -lpthread
-    endif
-    ifeq ($(USE_EXTERNAL_GLFW),TRUE)
-        # Check the version name. If GLFW3 was built manually, it may have produced
-        # a static library known as libglfw3.a. In that case, the name should be -lglfw3
-        LDLIBS = -lglfw
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_DESKTOP_SDL)
-    ifeq ($(PLATFORM_OS),WINDOWS)
-        LDLIBS = -static-libgcc -lopengl32 -lgdi32
-    endif
-    ifeq ($(PLATFORM_OS),LINUX)
-        LDLIBS = -lGL -lc -lm -lpthread -ldl -lrt
-        ifeq ($(USE_WAYLAND_DISPLAY),FALSE)
-            LDLIBS += -lX11
-        endif
-    endif
-    LDLIBS += -lSDL2 -lSDL2main
-endif
-ifeq ($(PLATFORM),PLATFORM_DRM)
-    LDLIBS = -lGLESv2 -lEGL -ldrm -lgbm -lpthread -lrt -lm -ldl
-    ifeq ($(RAYLIB_MODULE_AUDIO),TRUE)
-        LDLIBS += -latomic
-    endif
-endif
-ifeq ($(PLATFORM),PLATFORM_ANDROID)
-    LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm
-endif
-
-# Define source code object files required
-#------------------------------------------------------------------------------------------------
-OBJS = rcore.o \
-       rshapes.o \
-       rtextures.o \
-       rtext.o \
-       utils.o
-
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
-    ifeq ($(USE_EXTERNAL_GLFW),FALSE)
-        OBJS += rglfw.o
-    endif
-endif
-ifeq ($(RAYLIB_MODULE_MODELS),TRUE)
-    OBJS += rmodels.o
-endif
-ifeq ($(RAYLIB_MODULE_AUDIO),TRUE)
-    OBJS += raudio.o
-endif
-ifeq ($(RAYLIB_MODULE_RAYGUI),TRUE)
-    OBJS += raygui.o
-endif
-
-ifeq ($(PLATFORM),PLATFORM_ANDROID)
-    OBJS += android_native_app_glue.o
-endif
-
-# Define processes to execute
-#------------------------------------------------------------------------------------------------
-# Default target entry
-all: raylib
-
-# Compile raylib library
-# NOTE: Release directory is created if not exist
-raylib: $(OBJS)
-ifeq ($(PLATFORM),PLATFORM_WEB)
-    # Compile raylib libray for web
-    #$(CC) $(OBJS) -r -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).bc
-	$(AR) rcs $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(OBJS)
-	@echo "raylib library generated (lib$(RAYLIB_LIB_NAME).a)!"
-else
-    ifeq ($(RAYLIB_LIBTYPE),SHARED)
-        ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_DESKTOP_SDL))
-            ifeq ($(PLATFORM_OS),WINDOWS)
-                # NOTE: Linking with provided resource file
-				$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/$(RAYLIB_LIB_NAME).dll $(OBJS) $(RAYLIB_RES_FILE) $(LDFLAGS) $(LDLIBS)
-				@echo "raylib dynamic library ($(RAYLIB_LIB_NAME).dll) and import library (lib$(RAYLIB_LIB_NAME)dll.a) generated!"
-            endif
-            ifeq ($(PLATFORM_OS),LINUX)
-                # Compile raylib shared library version $(RAYLIB_VERSION).
-                # WARNING: you should type "make clean" before doing this target
-				$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION) $(OBJS) $(LDFLAGS) $(LDLIBS)
-				@echo "raylib shared library generated (lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION)) in $(RAYLIB_RELEASE_PATH)!"
-				cd $(RAYLIB_RELEASE_PATH) && ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION) lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
-				cd $(RAYLIB_RELEASE_PATH) && ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) lib$(RAYLIB_LIB_NAME).so
-            endif
-            ifeq ($(PLATFORM_OS),OSX)
-				$(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib $(OBJS) $(LDFLAGS) $(LDLIBS)
-				install_name_tool -id "@rpath/lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).dylib" $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib
-				@echo "raylib shared library generated (lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib)!"
-				cd $(RAYLIB_RELEASE_PATH) && ln -fs lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).dylib
-				cd $(RAYLIB_RELEASE_PATH) && ln -fs lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib lib$(RAYLIB_LIB_NAME).dylib
-            endif
-            ifeq ($(PLATFORM_OS),BSD)
-                # WARNING: you should type "gmake clean" before doing this target
-				$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS)
-				@echo "raylib shared library generated (lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so)!"
-				cd $(RAYLIB_RELEASE_PATH) && ln -fs lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).so
-				cd $(RAYLIB_RELEASE_PATH) && ln -fs lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so lib$(RAYLIB_LIB_NAME).so
-            endif
-        endif
-        ifeq ($(PLATFORM),PLATFORM_DRM)
-                # Compile raylib shared library version $(RAYLIB_VERSION).
-                # WARNING: you should type "make clean" before doing this target
-				$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION) $(OBJS) $(LDFLAGS) $(LDLIBS)
-				@echo "raylib shared library generated (lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION)) in $(RAYLIB_RELEASE_PATH)!"
-				cd $(RAYLIB_RELEASE_PATH) && ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION) lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
-				cd $(RAYLIB_RELEASE_PATH) && ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) lib$(RAYLIB_LIB_NAME).so
-        endif
-        ifeq ($(PLATFORM),PLATFORM_ANDROID)
-			$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS)
-			@echo "raylib shared library generated (lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so)!"
-            # WARNING: symbolic links creation on Windows should be done using mklink command, no ln available
-            ifeq ($(HOST_PLATFORM_OS),LINUX)
-				cd $(RAYLIB_RELEASE_PATH) && ln -fs lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).so
-				cd $(RAYLIB_RELEASE_PATH) && ln -fs lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so lib$(RAYLIB_LIB_NAME).so
-            endif
-        endif
-    else
-        # Compile raylib static library version $(RAYLIB_VERSION)
-        # WARNING: You should type "make clean" before doing this target.
-		$(AR) rcs $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(OBJS)
-		@echo "raylib static library generated (lib$(RAYLIB_LIB_NAME).a) in $(RAYLIB_RELEASE_PATH)!"
-    endif
-endif
-
-# Compile all modules with their prerequisites
-
-# Prerequisites of core module
-rcore.o : platforms/*.c
-
-# Compile core module
-rcore.o : rcore.c raylib.h rlgl.h utils.h raymath.h rcamera.h rgestures.h
-	$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS)
-
-# Compile rglfw module
-rglfw.o : rglfw.c
-	$(CC) $(GLFW_OSX) -c $< $(CFLAGS) $(INCLUDE_PATHS)
-
-# Compile shapes module
-rshapes.o : rshapes.c raylib.h rlgl.h
-	$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS)
-
-# Compile textures module
-rtextures.o : rtextures.c raylib.h rlgl.h utils.h
-	$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS)
-
-# Compile text module
-rtext.o : rtext.c raylib.h utils.h
-	$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS)
-
-# Compile utils module
-utils.o : utils.c utils.h
-	$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS)
-
-# Compile models module
-rmodels.o : rmodels.c raylib.h rlgl.h raymath.h
-	$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS)
-
-# Compile audio module
-raudio.o : raudio.c raylib.h
-	$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS)
-
-# Compile raygui module
-# NOTE: raygui header should be distributed with raylib.h
-raygui.o : raygui.c
-	$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS)
-raygui.c:
-ifeq ($(PLATFORM_SHELL), cmd)
-	@echo #define RAYGUI_IMPLEMENTATION > raygui.c
-	@echo #include "$(RAYLIB_MODULE_RAYGUI_PATH)/raygui.h" >> raygui.c
-else
-	@echo "#define RAYGUI_IMPLEMENTATION" > raygui.c
-	@echo "#include \"$(RAYLIB_MODULE_RAYGUI_PATH)/raygui.h\"" >> raygui.c
-endif
-
-# Compile android_native_app_glue module
-android_native_app_glue.o : $(NATIVE_APP_GLUE)/android_native_app_glue.c
-	$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS)
-
-# Install generated and needed files to desired directories.
-# On GNU/Linux and BSDs, there are some standard directories that contain extra
-# libraries and header files. These directories (often /usr/local/lib and
-# /usr/local/include) are for libraries that are installed manually
-# (without a package manager). We'll use /usr/local/lib/raysan5 and /usr/local/include/raysan5
-# for our -L and -I specification to simplify management of the raylib source package.
-# Customize these locations if you like but don't forget to pass them to make
-# for compilation and enable runtime linking with -rpath, LD_LIBRARY_PATH, or ldconfig.
-# HINT: Add -L$(RAYLIB_INSTALL_PATH) -I$(RAYLIB_H_INSTALL_PATH) to your own makefiles.
-# See below and ../examples/Makefile for more information.
-
-# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths.
-DESTDIR ?= /usr/local
-RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib
-# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files.
-RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include
-
-install :
-ifeq ($(ROOT),root)
-    ifeq ($(PLATFORM_OS),LINUX)
-        # Attention! You are root, writing files to $(RAYLIB_INSTALL_PATH)
-        # and $(RAYLIB_H_INSTALL_PATH). Consult this Makefile for more information.
-        # Prepare the environment as needed.
-		mkdir --parents --verbose $(RAYLIB_INSTALL_PATH)
-		mkdir --parents --verbose $(RAYLIB_H_INSTALL_PATH)
-        ifeq ($(RAYLIB_LIBTYPE),SHARED)
-            # Installing raylib to $(RAYLIB_INSTALL_PATH).
-			cp --update --verbose $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(RAYLIB_INSTALL_PATH)/lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION)
-			cd $(RAYLIB_INSTALL_PATH); ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION) lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
-			cd $(RAYLIB_INSTALL_PATH); ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) lib$(RAYLIB_LIB_NAME).so
-            # Uncomment to update the runtime linker cache with RAYLIB_INSTALL_PATH.
-            # Not necessary if later embedding RPATH in your executable. See examples/Makefile.
-			ldconfig $(RAYLIB_INSTALL_PATH)
-        else
-            # Installing raylib to $(RAYLIB_INSTALL_PATH).
-			cp --update --verbose $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(RAYLIB_INSTALL_PATH)/lib$(RAYLIB_LIB_NAME).a
-        endif
-        # Copying raylib development files to $(RAYLIB_H_INSTALL_PATH).
-		cp --update raylib.h $(RAYLIB_H_INSTALL_PATH)/raylib.h
-		cp --update raymath.h $(RAYLIB_H_INSTALL_PATH)/raymath.h
-		cp --update rlgl.h $(RAYLIB_H_INSTALL_PATH)/rlgl.h
-		@echo "raylib development files installed/updated!"
-    else
-		@echo "This function currently works on GNU/Linux systems. Add yours today (^;"
-    endif
-else
-	@echo "Error: Root permissions needed for installation. Try sudo make install"
-endif
-
-# Remove raylib dev files installed on the system
-# NOTE: see 'install' target.
-uninstall :
-ifeq ($(ROOT),root)
-    # WARNING: You are root, about to delete items from $(RAYLIB_INSTALL_PATH).
-    # and $(RAYLIB_H_INSTALL_PATH). Please confirm each item.
-    ifeq ($(PLATFORM_OS),LINUX)
-        ifeq ($(RAYLIB_LIBTYPE),SHARED)
-			rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so
-			rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_API_VERSION)
-			rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION)
-            # Uncomment to clean up the runtime linker cache. See install target.
-			ldconfig
-        else
-			rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.a
-        endif
-		rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/raylib.h
-		rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/raymath.h
-		rm --force --interactive --verbose $(RAYLIB_H_INSTALL_PATH)/rlgl.h
-		@echo "raylib development files removed!"
-    else
-		@echo "This function currently works on GNU/Linux systems. Add yours today (^;"
-    endif
-else
-	@echo "Error: Root permissions needed for uninstallation. Try sudo make uninstall"
-endif
-
-.PHONY: clean_shell_cmd clean_shell_sh
-
-# Clean everything
-clean:	clean_shell_$(PLATFORM_SHELL)
-	@echo "removed all generated files!"
-
-clean_shell_sh:
-	rm -fv *.o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).bc $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).so* raygui.c
-ifeq ($(PLATFORM),PLATFORM_ANDROID)
-	rm -fv $(NATIVE_APP_GLUE)/android_native_app_glue.o
-endif
-
-# Set specific target variable
-clean_shell_cmd: SHELL=cmd
-clean_shell_cmd:
-	del *.o /s
-	cd $(RAYLIB_RELEASE_PATH) & \
-	del lib$(RAYLIB_LIB_NAME).a /s & \
-	del lib$(RAYLIB_LIB_NAME)dll.a /s & \
-	del $(RAYLIB_LIB_NAME).dll /s & \
-	del raygui.c /s & \

+ 0 - 227
raylib/raylib-5.0/src/build.zig

@@ -1,227 +0,0 @@
-const std = @import("std");
-const builtin = @import("builtin");
-
-// This has been tested to work with zig 0.11.0 and zig 0.12.0-dev.1390+94cee4fb2
-pub fn addRaylib(b: *std.Build, target: std.zig.CrossTarget, optimize: std.builtin.OptimizeMode, options: Options) *std.Build.CompileStep {
-    const raylib_flags = &[_][]const u8{
-        "-std=gnu99",
-        "-D_GNU_SOURCE",
-        "-DGL_SILENCE_DEPRECATION=199309L",
-    };
-
-    const raylib = b.addStaticLibrary(.{
-        .name = "raylib",
-        .target = target,
-        .optimize = optimize,
-    });
-    raylib.linkLibC();
-
-    // No GLFW required on PLATFORM_DRM
-    if (!options.platform_drm) {
-        raylib.addIncludePath(.{ .path = srcdir ++ "/external/glfw/include" });
-    }
-
-    addCSourceFilesVersioned(raylib, &.{
-        srcdir ++ "/rcore.c",
-        srcdir ++ "/utils.c",
-    }, raylib_flags);
-
-    if (options.raudio) {
-        addCSourceFilesVersioned(raylib, &.{
-            srcdir ++ "/raudio.c",
-        }, raylib_flags);
-    }
-    if (options.rmodels) {
-        addCSourceFilesVersioned(raylib, &.{
-            srcdir ++ "/rmodels.c",
-        }, &[_][]const u8{
-            "-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/1891
-        } ++ raylib_flags);
-    }
-    if (options.rshapes) {
-        addCSourceFilesVersioned(raylib, &.{
-            srcdir ++ "/rshapes.c",
-        }, raylib_flags);
-    }
-    if (options.rtext) {
-        addCSourceFilesVersioned(raylib, &.{
-            srcdir ++ "/rtext.c",
-        }, raylib_flags);
-    }
-    if (options.rtextures) {
-        addCSourceFilesVersioned(raylib, &.{
-            srcdir ++ "/rtextures.c",
-        }, raylib_flags);
-    }
-
-    var gen_step = b.addWriteFiles();
-    raylib.step.dependOn(&gen_step.step);
-
-    if (options.raygui) {
-        const raygui_c_path = gen_step.add("raygui.c", "#define RAYGUI_IMPLEMENTATION\n#include \"raygui.h\"\n");
-        raylib.addCSourceFile(.{ .file = raygui_c_path, .flags = raylib_flags });
-        raylib.addIncludePath(.{ .path = srcdir });
-        raylib.addIncludePath(.{ .path = srcdir ++ "/../../raygui/src" });
-    }
-
-    switch (target.getOsTag()) {
-        .windows => {
-            addCSourceFilesVersioned(raylib, &.{
-                srcdir ++ "/rglfw.c",
-            }, raylib_flags);
-            raylib.linkSystemLibrary("winmm");
-            raylib.linkSystemLibrary("gdi32");
-            raylib.linkSystemLibrary("opengl32");
-            raylib.addIncludePath(.{ .path = "external/glfw/deps/mingw" });
-
-            raylib.defineCMacro("PLATFORM_DESKTOP", null);
-        },
-        .linux => {
-            if (!options.platform_drm) {
-                addCSourceFilesVersioned(raylib, &.{
-                    srcdir ++ "/rglfw.c",
-                }, raylib_flags);
-                raylib.linkSystemLibrary("GL");
-                raylib.linkSystemLibrary("rt");
-                raylib.linkSystemLibrary("dl");
-                raylib.linkSystemLibrary("m");
-                raylib.linkSystemLibrary("X11");
-                raylib.addLibraryPath(.{ .path = "/usr/lib" });
-                raylib.addIncludePath(.{ .path = "/usr/include" });
-
-                raylib.defineCMacro("PLATFORM_DESKTOP", null);
-            } else {
-                raylib.linkSystemLibrary("GLESv2");
-                raylib.linkSystemLibrary("EGL");
-                raylib.linkSystemLibrary("drm");
-                raylib.linkSystemLibrary("gbm");
-                raylib.linkSystemLibrary("pthread");
-                raylib.linkSystemLibrary("rt");
-                raylib.linkSystemLibrary("m");
-                raylib.linkSystemLibrary("dl");
-                raylib.addIncludePath(.{ .path = "/usr/include/libdrm" });
-
-                raylib.defineCMacro("PLATFORM_DRM", null);
-                raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null);
-                raylib.defineCMacro("EGL_NO_X11", null);
-                raylib.defineCMacro("DEFAULT_BATCH_BUFFER_ELEMENT", "2048");
-            }
-        },
-        .freebsd, .openbsd, .netbsd, .dragonfly => {
-            addCSourceFilesVersioned(raylib, &.{
-                srcdir ++ "/rglfw.c",
-            }, raylib_flags);
-            raylib.linkSystemLibrary("GL");
-            raylib.linkSystemLibrary("rt");
-            raylib.linkSystemLibrary("dl");
-            raylib.linkSystemLibrary("m");
-            raylib.linkSystemLibrary("X11");
-            raylib.linkSystemLibrary("Xrandr");
-            raylib.linkSystemLibrary("Xinerama");
-            raylib.linkSystemLibrary("Xi");
-            raylib.linkSystemLibrary("Xxf86vm");
-            raylib.linkSystemLibrary("Xcursor");
-
-            raylib.defineCMacro("PLATFORM_DESKTOP", null);
-        },
-        .macos => {
-            // On macos rglfw.c include Objective-C files.
-            const raylib_flags_extra_macos = &[_][]const u8{
-                "-ObjC",
-            };
-            addCSourceFilesVersioned(raylib, &.{
-                srcdir ++ "/rglfw.c",
-            }, raylib_flags ++ raylib_flags_extra_macos);
-            raylib.linkFramework("Foundation");
-            raylib.linkFramework("CoreServices");
-            raylib.linkFramework("CoreGraphics");
-            raylib.linkFramework("AppKit");
-            raylib.linkFramework("IOKit");
-
-            raylib.defineCMacro("PLATFORM_DESKTOP", null);
-        },
-        .emscripten => {
-            raylib.defineCMacro("PLATFORM_WEB", null);
-            raylib.defineCMacro("GRAPHICS_API_OPENGL_ES2", null);
-
-            if (b.sysroot == null) {
-                @panic("Pass '--sysroot \"$EMSDK/upstream/emscripten\"'");
-            }
-
-            const cache_include = std.fs.path.join(b.allocator, &.{ b.sysroot.?, "cache", "sysroot", "include" }) catch @panic("Out of memory");
-            defer b.allocator.free(cache_include);
-
-            var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
-            dir.close();
-
-            raylib.addIncludePath(.{ .path = cache_include });
-        },
-        else => {
-            @panic("Unsupported OS");
-        },
-    }
-
-    return raylib;
-}
-
-pub const Options = struct {
-    raudio: bool = true,
-    rmodels: bool = true,
-    rshapes: bool = true,
-    rtext: bool = true,
-    rtextures: bool = true,
-    raygui: bool = false,
-    platform_drm: bool = false,
-};
-
-pub fn build(b: *std.Build) void {
-    // Standard target options allows the person running `zig build` to choose
-    // what target to build for. Here we do not override the defaults, which
-    // means any target is allowed, and the default is native. Other options
-    // for restricting supported target set are available.
-    const target = b.standardTargetOptions(.{});
-    // Standard optimization options allow the person running `zig build` to select
-    // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
-    // set a preferred release mode, allowing the user to decide how to optimize.
-    const optimize = b.standardOptimizeOption(.{});
-
-    const defaults = Options{};
-    const options = Options{
-        .platform_drm = b.option(bool, "platform_drm", "Compile raylib in native mode (no X11)") orelse defaults.platform_drm,
-        .raudio = b.option(bool, "raudio", "Compile with audio support") orelse defaults.raudio,
-        .rmodels = b.option(bool, "rmodels", "Compile with models support") orelse defaults.rmodels,
-        .rtext = b.option(bool, "rtext", "Compile with text support") orelse defaults.rtext,
-        .rtextures = b.option(bool, "rtextures", "Compile with textures support") orelse defaults.rtextures,
-        .rshapes = b.option(bool, "rshapes", "Compile with shapes support") orelse defaults.rshapes,
-        .raygui = b.option(bool, "raygui", "Compile with raygui support") orelse defaults.raygui,
-    };
-
-    const lib = addRaylib(b, target, optimize, options);
-
-    lib.installHeader("src/raylib.h", "raylib.h");
-    lib.installHeader("src/raymath.h", "raymath.h");
-    lib.installHeader("src/rlgl.h", "rlgl.h");
-
-    if (options.raygui) {
-        lib.installHeader("../raygui/src/raygui.h", "raygui.h");
-    }
-
-    b.installArtifact(lib);
-}
-
-const srcdir = struct {
-    fn getSrcDir() []const u8 {
-        return std.fs.path.dirname(@src().file).?;
-    }
-}.getSrcDir();
-
-fn addCSourceFilesVersioned(exe: *std.Build.Step.Compile, files: []const []const u8, flags: []const []const u8) void {
-    if (comptime builtin.zig_version.minor >= 12) {
-        exe.addCSourceFiles(.{
-            .files = files,
-            .flags = flags,
-        });
-    } else {
-        exe.addCSourceFiles(files, flags);
-    }
-}

+ 0 - 0
raylib/raylib-5.0/src/external/glfw/README.md


Неке датотеке нису приказане због велике количине промена