Repository navigation
Expand file tree
/
Copy pathmakefile
More file actions
78 lines (60 loc) · 3.49 KB
/
Copy pathmakefile
File metadata and controls
78 lines (60 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
MAKEFLAGS = -j$(nproc)
CC = g++
# ★ Audit-Performance 29.08.: stand auf -O (= -O1). Der gesamte Host-Aufbau -- Voxelierung,
# baue_facetten, Remesh -- laeuft einkernig; bei 4 mm sind das Minuten. -O2 aendert die
# FP-Semantik nicht (kein -ffast-math, kein -march=native, also auch keine FMA-Kontraktion
# auf der x86-64-Grundlinie). Gegenprobe ist der Bitanker: FELD-HASH muss gleich bleiben.
CFLAGS = -std=c++17 -pthread -O2 -Wno-comment
.PHONY: no-target
no-target:
@echo "\033[91mError\033[0m: Please select one of these targets: make Linux-X11, make Linux, make macOS, make Android"
Linux-X11 Linux macOS Android: LDFLAGS_OPENCL = -I./src/OpenCL/include
Linux-X11 Linux: LDLIBS_OPENCL = -L./src/OpenCL/lib -lOpenCL
macOS: LDLIBS_OPENCL = -framework OpenCL
Android: LDLIBS_OPENCL = -L/system/vendor/lib64 -lOpenCL
Linux-X11: LDFLAGS_X11 = -I./src/X11/include
macOS: LDFLAGS_X11 = -I/opt/X11/include
Linux Android: LDFLAGS_X11 =
Linux-X11: LDLIBS_X11 = -L./src/X11/lib -lX11 -lXrandr
macOS: LDLIBS_X11 = -L/opt/X11/lib -lX11 -lXrandr
Linux Android: LDLIBS_X11 =
Linux-X11 Linux macOS Android: bin/FluidX3D
bin/FluidX3D: temp/graphics.o temp/info.o temp/kernel.o temp/lbm.o temp/lodepng.o temp/main.o temp/setup.o temp/shapes.o temp/bau_id.o make.sh
@mkdir -p bin
$(CC) temp/*.o -o bin/FluidX3D $(CFLAGS) $(LDFLAGS_OPENCL) $(LDLIBS_OPENCL) $(LDFLAGS_X11) $(LDLIBS_X11)
# ★ 05.10.2026 BAU-FINGERABDRUCK (Pruefbefund FLAGS4 M1): Commit + dirty-Flag + Diff-sha1 ins Binary, Ausgabe in Lauflog und
# code/LAUF.txt (setup.cpp sichere_lauf). Das Skript laeuft bei JEDEM make, schreibt temp/bau_id.cpp aber nur bei geaendertem
# Inhalt neu -- unveraenderter Stand linkt nicht neu.
.PHONY: bau_id_pruefen
temp/bau_id.cpp: bau_id_pruefen
@mkdir -p temp
@bash werkzeuge/bau_id.sh temp/bau_id.cpp
temp/bau_id.o: temp/bau_id.cpp
$(CC) -c temp/bau_id.cpp -o temp/bau_id.o $(CFLAGS)
temp/graphics.o: src/graphics.cpp src/defines.hpp src/graphics.hpp src/lodepng.hpp src/utilities.hpp make.sh
@mkdir -p temp
$(CC) -c src/graphics.cpp -o temp/graphics.o $(CFLAGS) $(LDFLAGS_X11)
temp/info.o: src/info.cpp src/defines.hpp src/graphics.hpp src/info.hpp src/lbm.hpp src/lodepng.hpp src/opencl.hpp src/units.hpp src/utilities.hpp make.sh
@mkdir -p temp
$(CC) -c src/info.cpp -o temp/info.o $(CFLAGS) $(LDFLAGS_OPENCL)
temp/kernel.o: src/kernel.cpp src/kernel.hpp src/lodepng.hpp src/utilities.hpp
@mkdir -p temp
$(CC) -c src/kernel.cpp -o temp/kernel.o $(CFLAGS)
temp/lbm.o: src/lbm.cpp src/defines.hpp src/graphics.hpp src/info.hpp src/lbm.hpp src/lodepng.hpp src/opencl.hpp src/units.hpp src/utilities.hpp make.sh
@mkdir -p temp
$(CC) -c src/lbm.cpp -o temp/lbm.o $(CFLAGS) $(LDFLAGS_OPENCL)
temp/lodepng.o: src/lodepng.cpp src/lodepng.hpp
@mkdir -p temp
$(CC) -c src/lodepng.cpp -o temp/lodepng.o $(CFLAGS)
temp/main.o: src/main.cpp src/defines.hpp src/graphics.hpp src/info.hpp src/lbm.hpp src/lodepng.hpp src/opencl.hpp src/setup.hpp src/shapes.hpp src/units.hpp src/utilities.hpp make.sh
@mkdir -p temp
$(CC) -c src/main.cpp -o temp/main.o $(CFLAGS) $(LDFLAGS_OPENCL)
temp/setup.o: src/setup.cpp src/defines.hpp src/graphics.hpp src/info.hpp src/lbm.hpp src/lodepng.hpp src/opencl.hpp src/setup.hpp src/shapes.hpp src/units.hpp src/utilities.hpp make.sh
@mkdir -p temp
$(CC) -c src/setup.cpp -o temp/setup.o $(CFLAGS) $(LDFLAGS_OPENCL)
temp/shapes.o: src/shapes.cpp src/shapes.hpp src/utilities.hpp make.sh
@mkdir -p temp
$(CC) -c src/shapes.cpp -o temp/shapes.o $(CFLAGS) $(LDFLAGS_OPENCL)
.PHONY: clean
clean:
@rm -rf temp bin/FluidX3D