11#define NOB_IMPLEMENTATION
2- #include "./src/ nob.h"
2+ #include "nob.h"
33
4- #define BUILD_DIR "./build"
5- #define SRC_DIR "./src"
4+ // Folder must with with forward slash /
5+ #define BUILD_DIR "./build/"
6+ #define PANIM_DIR "./panim/"
7+ #define PLUGS_DIR "./plugs/"
68
79void cflags (Nob_Cmd * cmd )
810{
911 nob_cmd_append (cmd , "-Wall" , "-Wextra" , "-ggdb" );
1012 nob_cmd_append (cmd , "-I./raylib/raylib-5.0_linux_amd64/include" );
11- nob_cmd_append (cmd , "-I./src/" );
13+ nob_cmd_append (cmd , "-I" PANIM_DIR );
14+ nob_cmd_append (cmd , "-I." );
1215}
1316
1417void cc (Nob_Cmd * cmd )
@@ -27,7 +30,7 @@ void cxx(Nob_Cmd *cmd)
2730void libs (Nob_Cmd * cmd )
2831{
2932 nob_cmd_append (cmd , "-Wl,-rpath=./raylib/raylib-5.0_linux_amd64/lib/" );
30- nob_cmd_append (cmd , "-Wl,-rpath=" BUILD_DIR );
33+ nob_cmd_append (cmd , "-Wl,-rpath=" PANIM_DIR );
3134 nob_cmd_append (cmd , "-L./raylib/raylib-5.0_linux_amd64/lib" );
3235 nob_cmd_append (cmd , "-l:libraylib.so" , "-lm" , "-ldl" , "-lpthread" );
3336}
@@ -42,7 +45,7 @@ bool build_plug_c(bool force, Nob_Cmd *cmd, const char *source_path, const char
4245 cc (cmd );
4346 nob_cmd_append (cmd , "-fPIC" , "-shared" , "-Wl,--no-undefined" );
4447 nob_cmd_append (cmd , "-o" , output_path );
45- nob_cmd_append (cmd , source_path , SRC_DIR "/tasks.c" );
48+ nob_cmd_append (cmd , source_path );
4649 libs (cmd );
4750 return nob_cmd_run_sync (* cmd );
4851 }
@@ -61,7 +64,7 @@ bool build_plug_cxx(bool force, Nob_Cmd *cmd, const char *source_path, const cha
6164 cxx (cmd );
6265 nob_cmd_append (cmd , "-fPIC" , "-shared" , "-Wl,--no-undefined" );
6366 nob_cmd_append (cmd , "-o" , output_path );
64- nob_cmd_append (cmd , source_path , SRC_DIR "/tasks.c" );
67+ nob_cmd_append (cmd , source_path );
6568 libs (cmd );
6669 return nob_cmd_run_sync (* cmd );
6770 }
@@ -109,17 +112,17 @@ int main(int argc, char **argv)
109112 if (!nob_mkdir_if_not_exists (BUILD_DIR )) return 1 ;
110113
111114 Nob_Cmd cmd = {0 };
112- if (!build_plug_c (force , & cmd , SRC_DIR "/tm .c" , BUILD_DIR "/ libtm.so" )) return 1 ;
113- if (!build_plug_c (force , & cmd , SRC_DIR "/ template.c" , BUILD_DIR "/ libtemplate.so" )) return 1 ;
114- if (!build_plug_c (force , & cmd , SRC_DIR "/ squares.c" , BUILD_DIR "/ libsquare.so" )) return 1 ;
115- if (!build_plug_c (force , & cmd , SRC_DIR "/ bezier.c" , BUILD_DIR "/ libbezier.so" )) return 1 ;
116- if (!build_plug_cxx (force , & cmd , SRC_DIR "/probe .cpp" , BUILD_DIR "/libprobe .so" )) return 1 ;
115+ if (!build_plug_c (force , & cmd , PLUGS_DIR "tm/plug .c" , BUILD_DIR "libtm.so" )) return 1 ;
116+ if (!build_plug_c (force , & cmd , PLUGS_DIR " template/plug .c" , BUILD_DIR "libtemplate.so" )) return 1 ;
117+ if (!build_plug_c (force , & cmd , PLUGS_DIR " squares/plug .c" , BUILD_DIR "libsquare.so" )) return 1 ;
118+ if (!build_plug_c (force , & cmd , PLUGS_DIR " bezier/plug .c" , BUILD_DIR "libbezier.so" )) return 1 ;
119+ if (!build_plug_cxx (force , & cmd , PLUGS_DIR "cpp/plug .cpp" , BUILD_DIR "libcpp .so" )) return 1 ;
117120
118121 {
119- const char * output_path = BUILD_DIR "/ panim" ;
122+ const char * output_path = BUILD_DIR "panim" ;
120123 const char * input_paths [] = {
121- SRC_DIR "/ panim.c" ,
122- SRC_DIR "/ ffmpeg_linux.c"
124+ PANIM_DIR " panim.c" ,
125+ PANIM_DIR " ffmpeg_linux.c"
123126 };
124127 size_t input_paths_len = NOB_ARRAY_LEN (input_paths );
125128 if (!build_exe (force , & cmd , input_paths , input_paths_len , output_path )) return 1 ;
0 commit comments