Mercurial > games > semicongine
annotate Makefile @ 481:c472abfcee57
add: generate ubermeshes
| author | Sam <sam@basx.dev> |
|---|---|
| date | Tue, 10 Jan 2023 00:23:40 +0700 |
| parents | 16842d15319a |
| children | 316923e9247c |
| rev | line source |
|---|---|
| 461 | 1 SOURCES := $(shell find src -name '*.nim') |
|
463
91544fc1afe5
did: hello world triangle, a bit of code organization
Sam <sam@basx.dev>
parents:
462
diff
changeset
|
2 DEBUG_OPTIONS := --debugger:native --checks:on --assertions:on |
|
91544fc1afe5
did: hello world triangle, a bit of code organization
Sam <sam@basx.dev>
parents:
462
diff
changeset
|
3 RELEASE_OPTIONS := -d:release --checks:off --assertions:off |
| 476 | 4 WINDOWS_DEBUG_OPTIONS := --cc:vcc --passC:'/MDd' --passL:'ucrtd.lib' |
| 5 WINDOWS_RELEASE_OPTIONS := --cc:vcc --passC:'/MD' --passL:'ucrt.lib' | |
| 6 | |
| 7 # HACK to get cross-compilation working -------------------------------- | |
| 8 | |
| 9 # anywhere with a windows filesystem that has the visual basic compiler tools installed | |
| 10 WINDOWS_BASE := /mnt | |
| 11 | |
| 12 # path variables, need to have correct versions | |
| 13 WINDOWS_PROGAMS := ${WINDOWS_BASE}/Program Files (x86) | |
| 14 MSVC_BUILDTOOLS_PATH := ${WINDOWS_PROGAMS}/Microsoft Visual Studio/2022/BuildTools/VC | |
| 15 WINDOWS_KIT_INCLUDE_BASE := ${WINDOWS_PROGAMS}/Windows Kits/10/Include/10.0.22000.0 | |
| 16 WINDOWS_KIT_LIBS_BASE := ${WINDOWS_PROGAMS}/Windows Kits/10/Lib/10.0.22000.0 | |
| 17 MSVC_PATH := ${MSVC_BUILDTOOLS_PATH}/Tools/MSVC/14.34.31933 | |
| 18 | |
| 19 MSVC_ADDITIONAL_PATH := ${MSVC_BUILDTOOLS_PATH}/Auxiliary/Build/ | |
| 20 CL_DIR := ${MSVC_PATH}/bin/Hostx64/x64/ | |
| 21 CL_INCL_DIR := ${MSVC_PATH}/include | |
| 22 WINE_NIM_VERSION := 1.6.10 | |
| 23 | |
| 24 # nim command: | |
| 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"' | |
| 26 | |
| 27 # end of HACK----------------------------------------------------------- | |
| 28 | |
| 461 | 29 |
|
474
d4750f2e0760
add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
473
diff
changeset
|
30 # build hello_triangle |
| 479 | 31 build/debug/linux/hello_triangle: ${SOURCES} |
| 32 nim build_linux_debug ${DEBUG_OPTIONS} -o:$@ examples/hello_triangle.nim | |
| 33 build/release/linux/hello_triangle: ${SOURCES} | |
| 34 nim build_linux_release c ${RELEASE_OPTIONS} -o:$@ examples/hello_triangle.nim | |
| 35 build/debug/windows/hello_triangle.exe: ${SOURCES} build/nim_windows | |
| 36 ${WINE_NIM} c ${DEBUG_OPTIONS} ${WINDOWS_DEBUG_OPTIONS} -o:$@ examples/hello_triangle.nim | |
| 37 build/release/windows/hello_triangle.exe: ${SOURCES} build/nim_windows | |
| 38 ${WINE_NIM} c ${RELEASE_OPTIONS} ${WINDOWS_RELEASE_OPTIONS} -o:$@ examples/hello_triangle.nim | |
|
463
91544fc1afe5
did: hello world triangle, a bit of code organization
Sam <sam@basx.dev>
parents:
462
diff
changeset
|
39 |
| 473 | 40 build_all_linux: build/debug/linux/hello_triangle build/release/linux/hello_triangle |
| 41 build_all_windows: build/debug/windows/hello_triangle.exe build/release/windows/hello_triangle.exe | |
|
474
d4750f2e0760
add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
473
diff
changeset
|
42 build_all: build_all_linux build_all_windows |
| 469 | 43 |
| 476 | 44 # clean |
| 473 | 45 clean: |
| 46 rm -rf build | |
| 476 | 47 # clean thirdparty too? |
| 473 | 48 |
| 477 | 49 .PHONY: tests |
| 50 | |
| 476 | 51 # tests |
|
474
d4750f2e0760
add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
473
diff
changeset
|
52 tests: |
|
d4750f2e0760
add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
473
diff
changeset
|
53 testament p tests/ |
|
d4750f2e0760
add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
473
diff
changeset
|
54 |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
55 # publish |
| 473 | 56 publish_linux_debug: build/debug/linux/hello_triangle |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
57 scp $< basx.dev:/var/www/public.basx.dev/joni/linux/debug/ |
| 473 | 58 publish_linux_release: build/release/linux/hello_triangle |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
59 scp $< basx.dev:/var/www/public.basx.dev/joni/linux/release/ |
| 473 | 60 publish_windows_debug: build/debug/linux/hello_triangle |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
61 scp $< basx.dev:/var/www/public.basx.dev/joni/windows/debug/ |
| 473 | 62 publish_windows_release: build/release/linux/hello_triangle |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
63 scp $< basx.dev:/var/www/public.basx.dev/joni/windows/release/ |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
64 |
| 476 | 65 publish_all_linux: publish_linux_debug publish_linux_release |
| 66 publish_all_windows: publish_windows_debug publish_windows_release | |
| 67 publish_all: publish_all_linux publish_all_windows | |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
68 |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
69 |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
70 # download thirdparty-libraries |
|
463
91544fc1afe5
did: hello world triangle, a bit of code organization
Sam <sam@basx.dev>
parents:
462
diff
changeset
|
71 |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
72 thirdparty/lib/glslang/linux_debug: |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
73 mkdir -p $@ |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
74 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Debug.zip |
| 476 | 75 unzip glslang-master-linux-Debug.zip -d $@ |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
76 thirdparty/lib/glslang/linux_release: |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
77 mkdir -p $@ |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
78 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip |
| 476 | 79 unzip glslang-master-linux-Release.zip -d $@ |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
80 thirdparty/lib/glslang/windows_debug: |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
81 mkdir -p $@ |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
82 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Debug.zip |
| 476 | 83 unzip glslang-master-windows-x64-Debug.zip -d $@ |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
84 thirdparty/lib/glslang/windows_release: |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
85 mkdir -p $@ |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
86 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Release.zip |
| 476 | 87 unzip glslang-master-windows-x64-Release.zip -d $@ |
|
464
7cae1900c9a7
add: skeleton to download thirdparty builds
Sam <sam@basx.dev>
parents:
463
diff
changeset
|
88 |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
89 thirdparty/lib/spirv-tools/linux_debug: |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
90 mkdir -p $@ |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
91 wget --directory-prefix=$@ https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-gcc-debug/continuous/1899/20221216-081758/install.tgz |
| 476 | 92 tar --directory $@ -xf $@/install.tgz |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
93 thirdparty/lib/spirv-tools/linux_release: |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
94 mkdir -p $@ |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
95 wget --directory-prefix=$@ https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-gcc-release/continuous/1889/20221216-081754/install.tgz |
| 476 | 96 tar --directory $@ -xf $@/install.tgz |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
97 thirdparty/lib/spirv-tools/windows_debug: |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
98 mkdir -p $@ |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
99 wget --directory-prefix=$@ https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/windows-msvc-2017-debug/continuous/1599/20221216-081803/install.zip |
| 476 | 100 unzip $@/install.zip -d $@ |
|
466
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
101 thirdparty/lib/spirv-tools/windows_release: |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
102 mkdir -p $@ |
|
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents:
464
diff
changeset
|
103 wget --directory-prefix=$@ https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/windows-msvc-2017-release/continuous/1885/20221216-081805/install.zip |
| 476 | 104 unzip $@/install.zip -d $@ |
| 105 | |
| 106 # set up cross compilation to compile for windows on linux | |
| 107 build/nim_windows/: | |
| 108 mkdir -p build/nim_windows | |
| 109 wget --directory-prefix=$@ https://nim-lang.org/download/nim-${WINE_NIM_VERSION}_x64.zip | |
| 110 unzip $@/nim-${WINE_NIM_VERSION}_x64.zip -d $@ |
