equal
deleted
inserted
replaced
11 # GNU General Public License for more details. |
11 # GNU General Public License for more details. |
12 # |
12 # |
13 # You should have received a copy of the GNU General Public License |
13 # You should have received a copy of the GNU General Public License |
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 |
15 |
|
16 CXX ?= g++ |
|
17 CXXFLAGS ?= -O2 -g3 -ggdb -Wall -Wno-sign-compare |
|
18 CXXFLAGS += --std=c++20 |
|
19 # CXXFLAGS += -Wextra |
|
20 LDFLAGS = $(shell pkg-config --cflags --libs epoxy x11 glu glm Magick++) |
|
21 |
|
22 ifeq ($(MODE), dev) |
|
23 CXXFLAGS += -fsanitize=undefined -fsanitize=address |
|
24 endif |
|
25 |
|
26 # TODO: provide debug symbols in separate files |
|
27 |
16 all: build/shader-shark |
28 all: build/shader-shark |
17 |
29 |
18 .PHONY: all clean run |
30 .PHONY: all clean run |
19 |
31 |
20 clean: |
32 clean: |
21 rm -rf build |
33 rm -rf build |
22 |
34 |
23 run: build/shader-shark |
35 run: build/shader-shark |
24 SHADER_SHARK_DATA_DIR=. $(<) |
36 SHADER_SHARK_DATA_DIR=. $(<) |
25 |
37 |
26 SRC= \ |
38 SRC = $(shell find -maxdepth 1 -name '*.cpp') |
27 Shark.cpp \ |
39 HEADERS = $(shell find -maxdepth 1 -name '*.h') |
28 shader-shark.cpp \ |
|
29 ImageLoader.cpp \ |
|
30 Texture.cpp \ |
|
31 Shader.cpp \ |
|
32 Program.cpp \ |
|
33 XAttrs.cpp \ |
|
34 FileMonitor.cpp |
|
35 |
40 |
36 build/shader-shark: $(SRC) *.h |
41 build/shader-shark: $(SRC) $(HEADERS) |
37 mkdir -p build |
42 mkdir -p build |
38 $(CXX) -std=c++20 -g -o $(@) $(SRC) $$(pkg-config --cflags --libs \ |
43 $(CXX) $(CXXFLAGS) -o $(@) $(SRC) $(LDFLAGS) |
39 epoxy x11 glu glm Magick++) |
|