make.lua (3451B)
1 require( "scripts.gen_makefile" ) 2 3 local common_objs = { "memory_arena", "log", "ggformat", "patterns", "strlcpy", "strlcat", "strtonum", "profiler", "stats", "rng/pcg", "breakbools" } 4 local game_objs = { "work_queue", "renderer", "shaders", "gl", "glad", "immediate", "text_renderer", "liberation", "obj", "blue_noise", "rng/csprng", "ggentropy", common_objs } 5 local game_libs = { "glfw", "stb_image", "stb_truetype", "monocypher", "tinyobjloader" } 6 7 if OS ~= "windows" then 8 bin( "srv", { "server/main", "platform_network", "ggentropy", "rng/csprng", "ggentropy", common_objs }, { "monocypher" } ) 9 end 10 11 if OS == "openbsd" then 12 return 13 end 14 15 local game_ldflags = "-lX11" 16 17 if OS == "macos" then 18 game_ldflags = "-framework Cocoa -framework CoreVideo -framework IOKit" 19 end 20 21 bin( "medfall", { "main", "medfall_manifest", "clipmap", "heightmap", "decompress_bc", "skybox", "platform_network", game_objs }, { "lz4", "par_shapes", game_libs } ) 22 msvc_bin_ldflags( "medfall", "opengl32.lib gdi32.lib Ws2_32.lib" ) 23 rc( "medfall_manifest" ) 24 gcc_bin_ldflags( "medfall", game_ldflags ) 25 26 bin( "launch", { "launcher/main", "launch_manifest", "http", "platform_network", game_objs }, { "imgui", "monocypher", "whereami", game_libs } ) 27 msvc_bin_ldflags( "launch", "opengl32.lib gdi32.lib Ws2_32.lib" ) 28 rc( "launch_manifest" ) 29 gcc_bin_ldflags( "launch", game_ldflags ) 30 31 if OS == "windows" then 32 bin( "elevate_for_update", { "elevate_for_update", "elevate_for_update_manifest", common_objs }, { } ) 33 rc( "elevate_for_update_manifest" ) 34 end 35 36 require( "libs/cgltf" ) 37 require( "libs/imgui" ) 38 require( "libs/glfw" ) 39 require( "libs/lz4" ) 40 require( "libs/monocypher" ) 41 require( "libs/par" ) 42 require( "libs/stb" ) 43 require( "libs/tinyobjloader" ) 44 require( "libs/whereami" ) 45 require( "libs/xxhash" ) 46 47 if config == "release" then 48 return 49 end 50 51 require( "libs/squish" ) 52 53 bin( "bsp", { "main", "bsp", "bsp_renderer", game_objs }, { game_libs } ) 54 bin( "sm", { "main", "shadow_map", game_objs }, { game_libs } ) 55 bin( "gltf", { "main", "gltf", game_objs }, { "cgltf", game_libs } ) 56 bin( "msdf", { "main", "msdf", game_objs }, game_libs ) 57 bin( "fullscreen", { "main", "fullscreen", game_objs }, { game_libs } ) 58 59 msvc_bin_ldflags( "bsp", "opengl32.lib gdi32.lib" ) 60 gcc_bin_ldflags( "bsp", game_ldflags ) 61 msvc_bin_ldflags( "sm", "opengl32.lib gdi32.lib" ) 62 gcc_bin_ldflags( "sm", game_ldflags ) 63 msvc_bin_ldflags( "gltf", "opengl32.lib gdi32.lib" ) 64 gcc_bin_ldflags( "gltf", game_ldflags ) 65 msvc_bin_ldflags( "msdf", "opengl32.lib gdi32.lib" ) 66 gcc_bin_ldflags( "msdf", game_ldflags ) 67 msvc_bin_ldflags( "fullscreen", "opengl32.lib gdi32.lib" ) 68 gcc_bin_ldflags( "fullscreen", game_ldflags ) 69 70 bin( "sound", { "audio", "mixer", "wave", "platform_audio_output", common_objs } ) 71 msvc_bin_ldflags( "sound", "ole32.lib" ) 72 if OS == "macos" then 73 bin_ldflags( "sound", "-framework AudioUnit" ) 74 end 75 76 bin( "pp", { "pp", "heightmap", "heightmap", "decompress_bc", common_objs }, { "lz4", "squish", "stb_image", "stb_image_write" } ) 77 gcc_obj_cxxflags( "pp", "-O2" ) 78 msvc_obj_cxxflags( "pp", "/O2" ) 79 80 if io.open( "utils/genkeys/secret_key.h" ) then 81 bin( "utils/b2sum/b2sum", { "utils/b2sum/b2sum", common_objs }, { "monocypher" } ) 82 gcc_obj_cxxflags( "utils/b2/b2sum", "-O2" ) 83 msvc_obj_cxxflags( "utils/b2/b2sum", "/O2" ) 84 85 bin( "utils/genkeys/genkeys", { "utils/genkeys/genkeys", common_objs }, { "monocypher" } ) 86 bin( "utils/genkeys/sign", { "utils/genkeys/sign", common_objs }, { "monocypher" } ) 87 end