comparison Makefile @ 33:94c38e4b5782

did: refactoring, move more from make to nimscript
author Sam <sam@basx.dev>
date Sun, 15 Jan 2023 23:23:54 +0700
parents da922b506570
children
comparison
equal deleted inserted replaced
32:9edca5dc4e93 33:94c38e4b5782
1 SOURCES := $(shell find src -name '*.nim')
2
3 # compilation requirements 1 # compilation requirements
4 examples/glslangValidator: thirdparty/bin/linux/glslangValidator 2 examples/glslangValidator: thirdparty/bin/linux/glslangValidator
5 cp $< examples 3 cp $< examples
6 examples/glslangValidator.exe: thirdparty/bin/windows/glslangValidator.exe 4 examples/glslangValidator.exe: thirdparty/bin/windows/glslangValidator.exe
7 cp $< examples 5 cp $< examples
8
9 # build hello_triangle
10 build/debug/linux/hello_triangle: ${SOURCES} examples/hello_triangle.nim examples/glslangValidator
11 nim build_linux_debug -o:$@ examples/hello_triangle.nim
12 build/release/linux/hello_triangle: ${SOURCES} examples/hello_triangle.nim examples/glslangValidator
13 nim build_linux_release -o:$@ examples/hello_triangle.nim
14 build/debug/windows/hello_triangle.exe: ${SOURCES} examples/hello_triangle.nim examples/glslangValidator.exe
15 nim build_windows_debug -o:$@ examples/hello_triangle.nim
16 build/release/windows/hello_triangle.exe: ${SOURCES} examples/hello_triangle.nim examples/glslangValidator.exe
17 nim build_windows_release -o:$@ examples/hello_triangle.nim
18
19 build_all_linux_hello_triangle: build/debug/linux/hello_triangle build/release/linux/hello_triangle
20 build_all_windows_hello_triangle: build/debug/windows/hello_triangle.exe build/release/windows/hello_triangle.exe
21 build_all_hello_triangle: build_all_linux_hello_triangle build_all_windows_hello_triangle
22
23 # build alotof_triangles
24 build/debug/linux/alotof_triangles: ${SOURCES} examples/alotof_triangles.nim examples/glslangValidator
25 nim build_linux_debug -o:$@ examples/alotof_triangles.nim
26 build/release/linux/alotof_triangles: ${SOURCES} examples/alotof_triangles.nim examples/glslangValidator
27 nim build_linux_release -o:$@ examples/alotof_triangles.nim
28 build/debug/windows/alotof_triangles.exe: ${SOURCES} examples/alotof_triangles.nim examples/glslangValidator.exe
29 nim build_windows_debug -o:$@ examples/alotof_triangles.nim
30 build/release/windows/alotof_triangles.exe: ${SOURCES} examples/alotof_triangles.nim examples/glslangValidator.exe
31 nim build_windows_release -o:$@ examples/alotof_triangles.nim
32
33 build_all_linux_alotof_triangles: build/debug/linux/alotof_triangles build/release/linux/alotof_triangles
34 build_all_windows_alotof_triangles: build/debug/windows/alotof_triangles.exe build/release/windows/alotof_triangles.exe
35 build_all_alotof_triangles: build_all_linux_alotof_triangles build_all_windows_alotof_triangles
36
37 # clean
38 clean:
39 rm -rf build
40 rm -rf thirdparty
41
42 # tests
43 .PHONY: tests
44 tests:
45 testament p tests/
46
47 # publish
48 publish:
49 rsync -rv build/ basx.dev:/var/www/public.basx.dev/zamikongine
50 6
51 # download thirdparty-libraries 7 # download thirdparty-libraries
52 8
53 thirdparty/bin/linux/glslangValidator: 9 thirdparty/bin/linux/glslangValidator:
54 mkdir -p $$( dirname $@ ) 10 mkdir -p $$( dirname $@ )