Selaa lähdekoodia

Factor out everything related to the buidl to src_build/ folder

rexim 1 vuosi sitten
vanhempi
commit
797baf4de3
10 muutettua tiedostoa jossa 30 lisäystä ja 30 poistoa
  1. 7 7
      nob.c
  2. 0 0
      nob.h
  3. 2 2
      src/hotreload.h
  4. 3 3
      src/plug.c
  5. 3 3
      src_build/nob_linux.c
  6. 3 3
      src_build/nob_macos.c
  7. 3 3
      src_build/nob_openbsd.c
  8. 3 3
      src_build/nob_win64_mingw.c
  9. 6 6
      src_build/nob_win64_msvc.c
  10. 0 0
      src_build/targets.h

+ 7 - 7
nob.c

@@ -7,13 +7,13 @@
 #include <errno.h>
 
 #define NOB_IMPLEMENTATION
-#include "./src/nob.h"
+#include "./nob.h"
 
 #define CONFIG_PATH "./build/config.h"
 
 #ifdef CONFIGURED
 
-#include "./src/targets.h"
+#include "./src_build/targets.h"
 #include CONFIG_PATH
 
 #define RAYLIB_VERSION "5.0"
@@ -37,15 +37,15 @@ static const char *raylib_modules[] = {
 };
 
 #if MUSIALIZER_TARGET == TARGET_LINUX
-#include "src/nob_linux.c"
+#include "src_build/nob_linux.c"
 #elif MUSIALIZER_TARGET == TARGET_MACOS
-#include "src/nob_macos.c"
+#include "src_build/nob_macos.c"
 #elif MUSIALIZER_TARGET == TARGET_WIN64_MINGW
-#include "src/nob_win64_mingw.c"
+#include "src_build/nob_win64_mingw.c"
 #elif MUSIALIZER_TARGET == TARGET_WIN64_MSVC
-#include "src/nob_win64_msvc.c"
+#include "src_build/nob_win64_msvc.c"
 #elif MUSIALIZER_TARGET == TARGET_OPENBSD
-#include "src/nob_openbsd.c"
+#include "src_build/nob_openbsd.c"
 #endif // MUSIALIZER_TARGET
 
 void log_available_subcommands(const char *program, Nob_Log_Level level)

+ 0 - 0
src/nob.h → nob.h


+ 2 - 2
src/hotreload.h

@@ -4,8 +4,8 @@
 #include <stdbool.h>
 
 #include "plug.h"
-#include "targets.h"
-#include "config.h"
+#include "src_build/targets.h"
+#include "build/config.h"
 
 #ifdef MUSIALIZER_HOTRELOAD
     #define PLUG(name, ...) extern name##_t *name;

+ 3 - 3
src/plug.c

@@ -6,8 +6,8 @@
 #include <string.h>
 #include <complex.h>
 
-#include "targets.h"
-#include "config.h"
+#include "src_build/targets.h"
+#include "build/config.h"
 #include "plug.h"
 #include "ffmpeg.h"
 #define NOB_IMPLEMENTATION
@@ -27,7 +27,7 @@ LIST_OF_PLUGS
 #undef PLUG
 
 #ifndef MUSIALIZER_UNBUNDLE
-#include "bundle.h"
+#include "build/bundle.h"
 
 MUSIALIZER_PLUG void plug_free_resource(void *data)
 {

+ 3 - 3
src/nob_linux.c → src_build/nob_linux.c

@@ -13,7 +13,7 @@ bool build_musializer(void)
                 // Like `clang` for instance
                 nob_cmd_append(&cmd, "cc");
                 nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
-                nob_cmd_append(&cmd, "-I./build/");
+                nob_cmd_append(&cmd, "-I.");
                 nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
                 nob_cmd_append(&cmd, "-fPIC", "-shared");
                 nob_cmd_append(&cmd, "-o", "./build/libplug.so");
@@ -29,7 +29,7 @@ bool build_musializer(void)
             cmd.count = 0;
                 nob_cmd_append(&cmd, "cc");
                 nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
-                nob_cmd_append(&cmd, "-I./build/");
+                nob_cmd_append(&cmd, "-I.");
                 nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
                 nob_cmd_append(&cmd, "-o", "./build/musializer");
                 nob_cmd_append(&cmd,
@@ -51,7 +51,7 @@ bool build_musializer(void)
         cmd.count = 0;
             nob_cmd_append(&cmd, "cc");
             nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
-            nob_cmd_append(&cmd, "-I./build/");
+            nob_cmd_append(&cmd, "-I.");
             nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
             nob_cmd_append(&cmd, "-o", "./build/musializer");
             nob_cmd_append(&cmd,

+ 3 - 3
src/nob_macos.c → src_build/nob_macos.c

@@ -14,7 +14,7 @@ bool build_musializer(void)
         // Like `clang` for instance
         nob_cmd_append(&cmd, "clang");
         nob_cmd_append(&cmd, "-Wall", "-Wextra", "-g");
-        nob_cmd_append(&cmd, "-I./build/");
+        nob_cmd_append(&cmd, "-I.");
         nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
         nob_cmd_append(&cmd, "-fPIC", "-shared");
         nob_cmd_append(&cmd, "-o", "./build/libplug.dylib");
@@ -28,7 +28,7 @@ bool build_musializer(void)
     cmd.count = 0;
         nob_cmd_append(&cmd, "clang");
         nob_cmd_append(&cmd, "-Wall", "-Wextra", "-g");
-        nob_cmd_append(&cmd, "-I./build/");
+        nob_cmd_append(&cmd, "-I.");
         nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
         nob_cmd_append(&cmd, "-o", "./build/musializer");
         nob_cmd_append(&cmd,
@@ -46,7 +46,7 @@ bool build_musializer(void)
     cmd.count = 0;
         nob_cmd_append(&cmd, "clang");
         nob_cmd_append(&cmd, "-Wall", "-Wextra", "-g");
-        nob_cmd_append(&cmd, "-I./build/");
+        nob_cmd_append(&cmd, "-I.");
         nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
         nob_cmd_append(&cmd, "-o", "./build/musializer");
         nob_cmd_append(&cmd,

+ 3 - 3
src/nob_openbsd.c → src_build/nob_openbsd.c

@@ -13,7 +13,7 @@ bool build_musializer(void)
                 // Like `clang` for instance
                 nob_cmd_append(&cmd, "cc");
                 nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
-                nob_cmd_append(&cmd, "-I./build/");
+                nob_cmd_append(&cmd, "-I.");
                 nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
                 nob_cmd_append(&cmd, "-fPIC", "-shared");
                 nob_cmd_append(&cmd, "-o", "./build/libplug.so");
@@ -29,7 +29,7 @@ bool build_musializer(void)
             cmd.count = 0;
                 nob_cmd_append(&cmd, "cc");
                 nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
-                nob_cmd_append(&cmd, "-I./build/");
+                nob_cmd_append(&cmd, "-I.");
                 nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
                 nob_cmd_append(&cmd, "-o", "./build/musializer");
                 nob_cmd_append(&cmd,
@@ -51,7 +51,7 @@ bool build_musializer(void)
         cmd.count = 0;
             nob_cmd_append(&cmd, "cc");
             nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
-            nob_cmd_append(&cmd, "-I./build/");
+            nob_cmd_append(&cmd, "-I.");
             nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
             nob_cmd_append(&cmd, "-o", "./build/musializer");
             nob_cmd_append(&cmd,

+ 3 - 3
src/nob_win64_mingw.c → src_build/nob_win64_mingw.c

@@ -23,7 +23,7 @@ bool build_musializer(void)
             cmd.count = 0;
                 nob_cmd_append(&cmd, "x86_64-w64-mingw32-gcc");
                 nob_cmd_append(&cmd, "-mwindows", "-Wall", "-Wextra", "-ggdb");
-                nob_cmd_append(&cmd, "-I./build/");
+                nob_cmd_append(&cmd, "-I.");
                 nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
                 nob_cmd_append(&cmd, "-fPIC", "-shared");
                 nob_cmd_append(&cmd, "-static-libgcc");
@@ -40,7 +40,7 @@ bool build_musializer(void)
             cmd.count = 0;
                 nob_cmd_append(&cmd, "x86_64-w64-mingw32-gcc");
                 nob_cmd_append(&cmd, "-mwindows", "-Wall", "-Wextra", "-ggdb");
-                nob_cmd_append(&cmd, "-I./build/");
+                nob_cmd_append(&cmd, "-I.");
                 nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
                 nob_cmd_append(&cmd, "-o", "./build/musializer");
                 nob_cmd_append(&cmd,
@@ -62,7 +62,7 @@ bool build_musializer(void)
     cmd.count = 0;
         nob_cmd_append(&cmd, "x86_64-w64-mingw32-gcc");
         nob_cmd_append(&cmd, "-mwindows", "-Wall", "-Wextra", "-ggdb");
-        nob_cmd_append(&cmd, "-I./build/");
+        nob_cmd_append(&cmd, "-I.");
         nob_cmd_append(&cmd, "-I./raylib/raylib-"RAYLIB_VERSION"/src/");
         nob_cmd_append(&cmd, "-o", "./build/musializer");
         nob_cmd_append(&cmd,

+ 6 - 6
src/nob_win64_msvc.c → src_build/nob_win64_msvc.c

@@ -19,7 +19,7 @@ bool build_musializer(void)
             nob_cmd_append(&cmd, "cl.exe");
             nob_cmd_append(&cmd, "/LD");
             nob_cmd_append(&cmd, "/Fobuild\\", "/Fe./build/libplug.dll");
-            nob_cmd_append(&cmd, "/I", "./build/");
+            nob_cmd_append(&cmd, "/I", "./");
             nob_cmd_append(&cmd, "/I", "./raylib/raylib-"RAYLIB_VERSION"/src/");
             nob_cmd_append(&cmd,
                 "src/plug.c",
@@ -30,10 +30,10 @@ bool build_musializer(void)
                 "raylib.lib");
             nob_cmd_append(&cmd, "Winmm.lib", "gdi32.lib", "User32.lib", "Shell32.lib");
         nob_da_append(&procs, nob_cmd_run_async(cmd));
-            
+
         cmd.count = 0;
             nob_cmd_append(&cmd, "cl.exe");
-            nob_cmd_append(&cmd, "/I", "./build/");
+            nob_cmd_append(&cmd, "/I", "./");
             nob_cmd_append(&cmd, "/I", "./raylib/raylib-"RAYLIB_VERSION"/src/");
             nob_cmd_append(&cmd, "/Fobuild\\", "/Febuild\\musializer.exe");
             nob_cmd_append(&cmd,
@@ -52,7 +52,7 @@ bool build_musializer(void)
 #else
     cmd.count = 0;
         nob_cmd_append(&cmd, "cl.exe");
-        nob_cmd_append(&cmd, "/I", "./build/");
+        nob_cmd_append(&cmd, "/I", "./");
         nob_cmd_append(&cmd, "/I", "./raylib/raylib-"RAYLIB_VERSION"/src/");
         nob_cmd_append(&cmd, "/Fobuild\\", "/Febuild\\musializer.exe");
         nob_cmd_append(&cmd,
@@ -141,7 +141,7 @@ bool build_raylib(void)
         if (!nob_cmd_run_sync(cmd)) nob_return_defer(false);
     }
 #endif // MUSIALIZER_HOTRELOAD
-    
+
 defer:
     nob_cmd_free(cmd);
     nob_da_free(object_files);
@@ -157,4 +157,4 @@ bool build_dist(void)
     nob_log(NOB_ERROR, "TODO: Creating distro for MSVC build is not implemented yet");
     return false;
 #endif // MUSIALIZER_HOTRELOAD
-}
+}

+ 0 - 0
src/targets.h → src_build/targets.h