-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (26 loc) · 1.63 KB
/
Makefile
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
all:
CXX = clang++
CXXFLAGS = -MMD -MP -Wall -Wexceptions -std=c++11 -g `sdl2-config --cflags` -Ibgfx/include -Ibx/include -Ibimg/include -Iassimp/include
# LDFLAGS = `sdl2-config --libs` bgfx/.build/osx64_clang/bin/libbgfx-shared-libRelease.dylib
LDFLAGS = `sdl2-config --libs` bgfx/.build/osx64_clang/bin/libbgfxDebug.a bgfx/.build/osx64_clang/bin/libbxDebug.a bgfx/.build/osx64_clang/bin/libbimgDebug.a -Wl,-rpath,assimp/lib/ -Lassimp/lib/ -lassimp -framework Metal -framework Cocoa -lc++ -framework Carbon -framework QuartzCore -framework OpenGL -framework IOKit
SHADERS_PLATFORM = --platform osx -p metal
TARGET = main
SOURCES = $(wildcard src/*.cpp)
SHADERS = $(wildcard src/shaders/f_*.c) $(wildcard src/shaders/v_*.c) $(wildcard src/shaders/post/f_*.c) $(wildcard src/shaders/post/v_*.c)
all: $(TARGET) shaders
$(TARGET): $(SOURCES:src/%.cpp=bin/%.o)
$(CXX) $(LDFLAGS) $^ -o $(TARGET)
bin/%.o: src/%.cpp
$(CXX) -c $(CXXFLAGS) $< -o $@
-include bin/*.d
clean:
@rm -f $(TARGET) bin/*.o bin/*.d bin/*.bin
shaders: $(SHADERS:src/shaders/%.c=bin/%.bin) $(SHADERS:src/shaders/post/%.c=bin/post/%.bin)
bin/f_%.bin: src/shaders/f_%.c
bgfx/.build/osx64_clang/bin/shadercDebug -f $< -o $@ -i bgfx/src $(SHADERS_PLATFORM) --type fragment
bin/post/f_%.bin: src/shaders/post/f_%.c
bgfx/.build/osx64_clang/bin/shadercDebug -f $< -o $@ -i bgfx/src $(SHADERS_PLATFORM) --type fragment
bin/v_%.bin: src/shaders/v_%.c
bgfx/.build/osx64_clang/bin/shadercDebug -f $< -o $@ -i bgfx/src $(SHADERS_PLATFORM) --type vertex
bin/post/v_%.bin: src/shaders/post/v_%.c
bgfx/.build/osx64_clang/bin/shadercDebug -f $< -o $@ -i bgfx/src $(SHADERS_PLATFORM) --type vertex