annotate Makefile @ 13:a571db114152

add: vector/matrix modules, tests, nim config script
author Sam <sam@basx.dev>
date Wed, 28 Dec 2022 11:42:21 +0700
parents 9e5fe647ff91
children dde536a70483
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5daf3f236d87 add: initial version
Sam <sam@basx.dev>
parents:
diff changeset
1 SOURCES := $(shell find src -name '*.nim')
10
0660ba9d1930 did: make it work on windows
sam <sam@basx.dev>
parents: 8
diff changeset
2 COMPILE_OPTIONS := --path:src --mm:orc --experimental:strictEffects --threads:on --app:gui
2
213fdf8d31dd did: hello world triangle, a bit of code organization
Sam <sam@basx.dev>
parents: 1
diff changeset
3 DEBUG_OPTIONS := --debugger:native --checks:on --assertions:on
213fdf8d31dd did: hello world triangle, a bit of code organization
Sam <sam@basx.dev>
parents: 1
diff changeset
4 RELEASE_OPTIONS := -d:release --checks:off --assertions:off
10
0660ba9d1930 did: make it work on windows
sam <sam@basx.dev>
parents: 8
diff changeset
5 WINDOWS_DEBUG_OPTIONS := --cc:vcc --passC:'/MDd' --passL:'ucrtd.lib'
0660ba9d1930 did: make it work on windows
sam <sam@basx.dev>
parents: 8
diff changeset
6 WINDOWS_RELEASE_OPTIONS := --cc:vcc --passC:'/MD' --passL:'ucrt.lib'
0
5daf3f236d87 add: initial version
Sam <sam@basx.dev>
parents:
diff changeset
7
13
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
8 make_dirs:
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
9 mkdir -p build/debug/linux
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
10 mkdir -p build/release/linux
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
11 mkdir -p build/debug/windows
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
12 mkdir -p build/release/windows
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
13
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
14 # build hello_triangle
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
15 build/debug/linux/hello_triangle: ${SOURCES} make_dirs
12
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
16 nim c ${COMPILE_OPTIONS} ${DEBUG_OPTIONS} -o:$@ examples/hello_triangle.nim
13
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
17 build/release/linux/hello_triangle: ${SOURCES} make_dirs
12
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
18 nim c ${COMPILE_OPTIONS} ${RELEASE_OPTIONS} -o:$@ examples/hello_triangle.nim
13
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
19 build/debug/windows/hello_triangle.exe: ${SOURCES} make_dirs
12
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
20 nim c ${COMPILE_OPTIONS} ${DEBUG_OPTIONS} ${WINDOWS_DEBUG_OPTIONS} -o:$@ examples/hello_triangle.nim
13
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
21 build/release/windows/hello_triangle.exe: ${SOURCES} make_dirs
12
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
22 nim c ${COMPILE_OPTIONS} ${RELEASE_OPTIONS} ${WINDOWS_RELEASE_OPTIONS} -o:$@ examples/hello_triangle.nim
2
213fdf8d31dd did: hello world triangle, a bit of code organization
Sam <sam@basx.dev>
parents: 1
diff changeset
23
12
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
24 build_all_linux: build/debug/linux/hello_triangle build/release/linux/hello_triangle
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
25 build_all_windows: build/debug/windows/hello_triangle.exe build/release/windows/hello_triangle.exe
13
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
26 build_all: build_all_linux build_all_windows
8
1134f41a49e9 add: a few missing changes
Sam <sam@basx.dev>
parents: 5
diff changeset
27
13
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
28 # build maths (for testing)
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
29 build/debug/linux/maths: ${SOURCES} make_dirs
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
30 nim c ${COMPILE_OPTIONS} ${DEBUG_OPTIONS} -o:$@ examples/maths.nim
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
31 build/release/linux/maths: ${SOURCES} make_dirs
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
32 nim c ${COMPILE_OPTIONS} ${RELEASE_OPTIONS} -o:$@ examples/maths.nim
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
33 build/debug/windows/maths.exe: ${SOURCES} make_dirs
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
34 nim c ${COMPILE_OPTIONS} ${DEBUG_OPTIONS} ${WINDOWS_DEBUG_OPTIONS} -o:$@ examples/maths.nim
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
35 build/release/windows/maths.exe: ${SOURCES} make_dirs
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
36 nim c ${COMPILE_OPTIONS} ${RELEASE_OPTIONS} ${WINDOWS_RELEASE_OPTIONS} -o:$@ examples/maths.nim
5
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
37
12
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
38 clean:
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
39 rm -rf build
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
40
13
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
41 tests:
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
42 testament p tests/
a571db114152 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents: 12
diff changeset
43
5
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
44 # publish
12
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
45 publish_linux_debug: build/debug/linux/hello_triangle
5
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
46 scp $< basx.dev:/var/www/public.basx.dev/joni/linux/debug/
12
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
47 publish_linux_release: build/release/linux/hello_triangle
5
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
48 scp $< basx.dev:/var/www/public.basx.dev/joni/linux/release/
12
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
49 publish_windows_debug: build/debug/linux/hello_triangle
5
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
50 scp $< basx.dev:/var/www/public.basx.dev/joni/windows/debug/
12
9e5fe647ff91 did: cleanup up a bit
Sam <sam@basx.dev>
parents: 10
diff changeset
51 publish_windows_release: build/release/linux/hello_triangle
5
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
52 scp $< basx.dev:/var/www/public.basx.dev/joni/windows/release/
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
53
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
54 publish_all: publish_linux_debug publish_linux_release publish_windows_debug publish_windows_release
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
55
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
56
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
57 # download thirdparty-libraries
2
213fdf8d31dd did: hello world triangle, a bit of code organization
Sam <sam@basx.dev>
parents: 1
diff changeset
58
5
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
59 thirdparty/lib/glslang/linux_debug:
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
60 mkdir -p $@
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
61 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Debug.zip
8
1134f41a49e9 add: a few missing changes
Sam <sam@basx.dev>
parents: 5
diff changeset
62 unzip glslang-master-linux-Debug.zip
5
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
63 thirdparty/lib/glslang/linux_release:
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
64 mkdir -p $@
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
65 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
66 unzip glslang-master-linux-Release.zip
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
67 thirdparty/lib/glslang/windows_debug:
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
68 mkdir -p $@
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
69 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Debug.zip
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
70 unzip glslang-master-windows-x64-Debug.zip
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
71 thirdparty/lib/glslang/windows_release:
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
72 mkdir -p $@
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
73 wget --directory-prefix=$@ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Release.zip
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
74 unzip glslang-master-windows-x64-Release.zip
3
5d54ef652619 add: skeleton to download thirdparty builds
Sam <sam@basx.dev>
parents: 2
diff changeset
75
5
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
76 thirdparty/lib/spirv-tools/linux_debug:
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
77 mkdir -p $@
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
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
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
79 tar -xf $@/install.tgz
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
80 thirdparty/lib/spirv-tools/linux_release:
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
81 mkdir -p $@
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
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
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
83 tar -xf $@/install.tgz
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
84 thirdparty/lib/spirv-tools/windows_debug:
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
85 mkdir -p $@
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
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
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
87 unzip $@/install.zip
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
88 thirdparty/lib/spirv-tools/windows_release:
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
89 mkdir -p $@
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
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
4ed9cb098315 add: structure code for crossplatform, add some input handling + bugfixes
Sam <sam@basx.dev>
parents: 3
diff changeset
91 unzip $@/install.zip