comparison Makefile @ 18:90e117952f74

add: basic vertex buffer functionality
author Sam <sam@basx.dev>
date Thu, 05 Jan 2023 01:16:48 +0700
parents 617c6dcddbe2
children 316923e9247c
comparison
equal deleted inserted replaced
17:b40466fa446a 18:90e117952f74
1 SOURCES := $(shell find src -name '*.nim') 1 SOURCES := $(shell find src -name '*.nim')
2 COMPILE_OPTIONS := --path:src --mm:orc --experimental:strictEffects --threads:on --app:gui
3 DEBUG_OPTIONS := --debugger:native --checks:on --assertions:on 2 DEBUG_OPTIONS := --debugger:native --checks:on --assertions:on
4 RELEASE_OPTIONS := -d:release --checks:off --assertions:off 3 RELEASE_OPTIONS := -d:release --checks:off --assertions:off
5 WINDOWS_DEBUG_OPTIONS := --cc:vcc --passC:'/MDd' --passL:'ucrtd.lib' 4 WINDOWS_DEBUG_OPTIONS := --cc:vcc --passC:'/MDd' --passL:'ucrtd.lib'
6 WINDOWS_RELEASE_OPTIONS := --cc:vcc --passC:'/MD' --passL:'ucrt.lib' 5 WINDOWS_RELEASE_OPTIONS := --cc:vcc --passC:'/MD' --passL:'ucrt.lib'
7 6
26 WINE_NIM := WINEPATH="${CL_DIR}" wine ./build/nim_windows/nim-${WINE_NIM_VERSION}/bin/nim.exe --path:"${MSVC_ADDITIONAL_PATH}" --path:"${CL_INCL_DIR}" --passC:'/I "${CL_INCL_DIR}"' --passC:'/I "${WINDOWS_KIT_INCLUDE_BASE}/ucrt"' --passC:'/I "${WINDOWS_KIT_INCLUDE_BASE}/um"' --passC:'/I "${WINDOWS_KIT_INCLUDE_BASE}/shared"' --passL:'/LIBPATH:"${WINDOWS_KIT_LIBS_BASE}/ucrt/x64"' --passL:'/LIBPATH:"${WINDOWS_KIT_LIBS_BASE}/um/x64"' --passL:'/LIBPATH:"${MSVC_PATH}/lib/x64"' 25 WINE_NIM := WINEPATH="${CL_DIR}" wine ./build/nim_windows/nim-${WINE_NIM_VERSION}/bin/nim.exe --path:"${MSVC_ADDITIONAL_PATH}" --path:"${CL_INCL_DIR}" --passC:'/I "${CL_INCL_DIR}"' --passC:'/I "${WINDOWS_KIT_INCLUDE_BASE}/ucrt"' --passC:'/I "${WINDOWS_KIT_INCLUDE_BASE}/um"' --passC:'/I "${WINDOWS_KIT_INCLUDE_BASE}/shared"' --passL:'/LIBPATH:"${WINDOWS_KIT_LIBS_BASE}/ucrt/x64"' --passL:'/LIBPATH:"${WINDOWS_KIT_LIBS_BASE}/um/x64"' --passL:'/LIBPATH:"${MSVC_PATH}/lib/x64"'
27 26
28 # end of HACK----------------------------------------------------------- 27 # end of HACK-----------------------------------------------------------
29 28
30 29
31 make_dirs:
32 mkdir -p build/debug/linux
33 mkdir -p build/release/linux
34 mkdir -p build/debug/windows
35 mkdir -p build/release/windows
36
37 # build hello_triangle 30 # build hello_triangle
38 build/debug/linux/hello_triangle: ${SOURCES} make_dirs 31 build/debug/linux/hello_triangle: ${SOURCES}
39 nim c ${COMPILE_OPTIONS} ${DEBUG_OPTIONS} -o:$@ examples/hello_triangle.nim 32 nim build_linux_debug ${DEBUG_OPTIONS} -o:$@ examples/hello_triangle.nim
40 build/release/linux/hello_triangle: ${SOURCES} make_dirs 33 build/release/linux/hello_triangle: ${SOURCES}
41 nim c ${COMPILE_OPTIONS} ${RELEASE_OPTIONS} -o:$@ examples/hello_triangle.nim 34 nim build_linux_release c ${RELEASE_OPTIONS} -o:$@ examples/hello_triangle.nim
42 build/debug/windows/hello_triangle.exe: ${SOURCES} make_dirs build/nim_windows 35 build/debug/windows/hello_triangle.exe: ${SOURCES} build/nim_windows
43 ${WINE_NIM} c ${COMPILE_OPTIONS} ${DEBUG_OPTIONS} ${WINDOWS_DEBUG_OPTIONS} -o:$@ examples/hello_triangle.nim 36 ${WINE_NIM} c ${DEBUG_OPTIONS} ${WINDOWS_DEBUG_OPTIONS} -o:$@ examples/hello_triangle.nim
44 build/release/windows/hello_triangle.exe: ${SOURCES} make_dirs build/nim_windows 37 build/release/windows/hello_triangle.exe: ${SOURCES} build/nim_windows
45 ${WINE_NIM} c ${COMPILE_OPTIONS} ${RELEASE_OPTIONS} ${WINDOWS_RELEASE_OPTIONS} -o:$@ examples/hello_triangle.nim 38 ${WINE_NIM} c ${RELEASE_OPTIONS} ${WINDOWS_RELEASE_OPTIONS} -o:$@ examples/hello_triangle.nim
46 39
47 build_all_linux: build/debug/linux/hello_triangle build/release/linux/hello_triangle 40 build_all_linux: build/debug/linux/hello_triangle build/release/linux/hello_triangle
48 build_all_windows: build/debug/windows/hello_triangle.exe build/release/windows/hello_triangle.exe 41 build_all_windows: build/debug/windows/hello_triangle.exe build/release/windows/hello_triangle.exe
49 build_all: build_all_linux build_all_windows 42 build_all: build_all_linux build_all_windows
50 43