Mercurial > games > semicongine
annotate Makefile @ 474:d4750f2e0760
add: vector/matrix modules, tests, nim config script
| author | Sam <sam@basx.dev> | 
|---|---|
| date | Wed, 28 Dec 2022 11:42:21 +0700 | 
| parents | 04b8471bdab4 | 
| children | dde536a70483 | 
| rev | line source | 
|---|---|
| 461 | 1 SOURCES := $(shell find src -name '*.nim') | 
| 471 | 2 COMPILE_OPTIONS := --path:src --mm:orc --experimental:strictEffects --threads:on --app:gui | 
| 
463
 
91544fc1afe5
did: hello world triangle, a bit of code organization
 
Sam <sam@basx.dev> 
parents: 
462 
diff
changeset
 | 
3 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
 | 
4 RELEASE_OPTIONS := -d:release --checks:off --assertions:off | 
| 471 | 5 WINDOWS_DEBUG_OPTIONS := --cc:vcc --passC:'/MDd' --passL:'ucrtd.lib' | 
| 6 WINDOWS_RELEASE_OPTIONS := --cc:vcc --passC:'/MD' --passL:'ucrt.lib' | |
| 461 | 7 | 
| 
474
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
8 make_dirs: | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
9 mkdir -p build/debug/linux | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
10 mkdir -p build/release/linux | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
11 mkdir -p build/debug/windows | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
12 mkdir -p build/release/windows | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
13 | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
14 # build hello_triangle | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
15 build/debug/linux/hello_triangle: ${SOURCES} make_dirs | 
| 473 | 16 nim c ${COMPILE_OPTIONS} ${DEBUG_OPTIONS} -o:$@ examples/hello_triangle.nim | 
| 
474
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
17 build/release/linux/hello_triangle: ${SOURCES} make_dirs | 
| 473 | 18 nim c ${COMPILE_OPTIONS} ${RELEASE_OPTIONS} -o:$@ examples/hello_triangle.nim | 
| 
474
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
19 build/debug/windows/hello_triangle.exe: ${SOURCES} make_dirs | 
| 473 | 20 nim c ${COMPILE_OPTIONS} ${DEBUG_OPTIONS} ${WINDOWS_DEBUG_OPTIONS} -o:$@ examples/hello_triangle.nim | 
| 
474
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
21 build/release/windows/hello_triangle.exe: ${SOURCES} make_dirs | 
| 473 | 22 nim c ${COMPILE_OPTIONS} ${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
 | 
23 | 
| 473 | 24 build_all_linux: build/debug/linux/hello_triangle build/release/linux/hello_triangle | 
| 25 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
 | 
26 build_all: build_all_linux build_all_windows | 
| 469 | 27 | 
| 
474
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
28 # build maths (for testing) | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
29 build/debug/linux/maths: ${SOURCES} make_dirs | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
30 nim c ${COMPILE_OPTIONS} ${DEBUG_OPTIONS} -o:$@ examples/maths.nim | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
31 build/release/linux/maths: ${SOURCES} make_dirs | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
32 nim c ${COMPILE_OPTIONS} ${RELEASE_OPTIONS} -o:$@ examples/maths.nim | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
33 build/debug/windows/maths.exe: ${SOURCES} make_dirs | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
34 nim c ${COMPILE_OPTIONS} ${DEBUG_OPTIONS} ${WINDOWS_DEBUG_OPTIONS} -o:$@ examples/maths.nim | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
35 build/release/windows/maths.exe: ${SOURCES} make_dirs | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
36 nim c ${COMPILE_OPTIONS} ${RELEASE_OPTIONS} ${WINDOWS_RELEASE_OPTIONS} -o:$@ examples/maths.nim | 
| 
466
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
37 | 
| 473 | 38 clean: | 
| 39 rm -rf build | |
| 40 | |
| 
474
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
41 tests: | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
42 testament p tests/ | 
| 
 
d4750f2e0760
add: vector/matrix modules, tests, nim config script
 
Sam <sam@basx.dev> 
parents: 
473 
diff
changeset
 | 
43 | 
| 
466
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
44 # publish | 
| 473 | 45 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
 | 
46 scp $< basx.dev:/var/www/public.basx.dev/joni/linux/debug/ | 
| 473 | 47 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
 | 
48 scp $< basx.dev:/var/www/public.basx.dev/joni/linux/release/ | 
| 473 | 49 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
 | 
50 scp $< basx.dev:/var/www/public.basx.dev/joni/windows/debug/ | 
| 473 | 51 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
 | 
52 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
 | 
53 | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
54 publish_all: publish_linux_debug publish_linux_release publish_windows_debug publish_windows_release | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
55 | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
56 | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
57 # download thirdparty-libraries | 
| 
463
 
91544fc1afe5
did: hello world triangle, a bit of code organization
 
Sam <sam@basx.dev> 
parents: 
462 
diff
changeset
 | 
58 | 
| 
466
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
59 thirdparty/lib/glslang/linux_debug: | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
60 mkdir -p $@ | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
61 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Debug.zip | 
| 469 | 62 unzip glslang-master-linux-Debug.zip | 
| 
466
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
63 thirdparty/lib/glslang/linux_release: | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
64 mkdir -p $@ | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
65 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
66 unzip glslang-master-linux-Release.zip | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
67 thirdparty/lib/glslang/windows_debug: | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
68 mkdir -p $@ | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
69 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Debug.zip | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
70 unzip glslang-master-windows-x64-Debug.zip | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
71 thirdparty/lib/glslang/windows_release: | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
72 mkdir -p $@ | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
73 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Release.zip | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
74 unzip glslang-master-windows-x64-Release.zip | 
| 
464
 
7cae1900c9a7
add: skeleton to download thirdparty builds
 
Sam <sam@basx.dev> 
parents: 
463 
diff
changeset
 | 
75 | 
| 
466
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
76 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
 | 
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://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-gcc-debug/continuous/1899/20221216-081758/install.tgz | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
79 tar -xf $@/install.tgz | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
80 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
 | 
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://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-gcc-release/continuous/1889/20221216-081754/install.tgz | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
83 tar -xf $@/install.tgz | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
84 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
 | 
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://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/windows-msvc-2017-debug/continuous/1599/20221216-081803/install.zip | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
87 unzip $@/install.zip | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
88 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
 | 
89 mkdir -p $@ | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
90 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 | 
| 
 
1dd9e2393a9e
add: structure code for crossplatform, add some input handling + bugfixes
 
Sam <sam@basx.dev> 
parents: 
464 
diff
changeset
 | 
91 unzip $@/install.zip | 
