diff options
Diffstat (limited to 'code')
| -rw-r--r-- | code/build.cpp | 32 | ||||
| -rw-r--r-- | code/handmade.h | 5 |
2 files changed, 27 insertions, 10 deletions
diff --git a/code/build.cpp b/code/build.cpp index 9583de3..ffd0668 100644 --- a/code/build.cpp +++ b/code/build.cpp @@ -1,17 +1,11 @@ #include "libs/build.h" -int main(int ArgsCount, char *Args[], char *Env[]) +void Build(char *Name, str8 Flags) { - LinuxChangeToExecutableDirectory(Args); - LinuxRebuildSelf(ArgsCount, Args, Env); - printf("[linux handmade compile]\n"); + printf("%s\n", Name); str8_list BuildCommandList = CommonBuildCommand(false, true ,true); - Str8ListAppend(&BuildCommandList, - S8Lit("-DHANDMADE_INTERNAL=1 -DHANDMADE_SLOW=1 -DHANDMADE_SMALL_RESOLUTION=1 " - "-lX11 -lXfixes -lasound -lcurl " - "-o linux_handmade " - "../code/libs/hm_linux/linux_handmade.cpp")); + Str8ListAppend(&BuildCommandList, Flags); str8 BuildCommand = Str8ListJoin(BuildCommandList, sizeof(OutputBuffer), OutputBuffer, ' '); linux_command_result CommandResult = LinuxRunCommandString(BuildCommand, Env, true); @@ -21,5 +15,25 @@ int main(int ArgsCount, char *Args[], char *Env[]) printf("%*s", (int)BytesToRead, OutputBuffer); } +} + + +int main(int ArgsCount, char *Args[], char *Env[]) +{ + LinuxChangeToExecutableDirectory(Args); + LinuxRebuildSelf(ArgsCount, Args, Env); + + Build("[linux handmade compile]", S8Lit("-DHANDMADE_INTERNAL=1 -DHANDMADE_SLOW=1 -DHANDMADE_SMALL_RESOLUTION=1 " + "-lX11 -lXfixes -lasound " + "-o linux_handmade " + "../code/libs/hm_linux/linux_handmade.cpp")); + + Build("[handmade compile]", + S8Lit("-shared -fPIC " + "-DHANDMADE_INTERNAL=1 -DHANDMADE_SLOW=1" + "-Wno-conversion " + "-o handmade.so " + "../code/handmade.cpp")); + return 0; } diff --git a/code/handmade.h b/code/handmade.h index b59ae8c..b8e4616 100644 --- a/code/handmade.h +++ b/code/handmade.h @@ -1,9 +1,12 @@ #if !defined(HANDMADE_H) +#include "handmade_platform.h" + //~ Libraries +PUSH_WARNINGS #define STB_TRUETYPE_IMPLEMENTATION #include "libs/stb_truetype.h" -#include "handmade_platform.h" +POP_WARNINGS #include "handmade_intrinsics.h" #include "handmade_math.h" |
