2016-04-04 10:36:04 +03:00
|
|
|
TARGET := spirv-cross
|
2016-04-11 15:30:17 +03:00
|
|
|
|
|
|
|
SOURCES := $(wildcard spirv_*.cpp)
|
|
|
|
CLI_SOURCES := main.cpp
|
|
|
|
|
2016-03-02 20:09:16 +03:00
|
|
|
OBJECTS := $(SOURCES:.cpp=.o)
|
2016-04-11 15:30:17 +03:00
|
|
|
CLI_OBJECTS := $(CLI_SOURCES:.cpp=.o)
|
|
|
|
|
|
|
|
STATIC_LIB := lib$(TARGET).a
|
|
|
|
|
|
|
|
DEPS := $(OBJECTS:.o=.d) $(CLI_OBJECTS:.o=.d)
|
2016-03-02 20:09:16 +03:00
|
|
|
|
2016-11-26 01:38:57 +03:00
|
|
|
CXXFLAGS += -std=c++11 -Wall -Wextra -Wshadow -D__STDC_LIMIT_MACROS
|
2016-03-02 20:09:16 +03:00
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
2016-05-11 00:39:41 +03:00
|
|
|
CXXFLAGS += -O0 -g
|
2016-03-02 20:09:16 +03:00
|
|
|
else
|
2016-12-13 00:33:22 +03:00
|
|
|
CXXFLAGS += -O2 -DNDEBUG
|
2016-03-02 20:09:16 +03:00
|
|
|
endif
|
|
|
|
|
2016-12-15 22:46:10 +03:00
|
|
|
ifeq ($(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS), 1)
|
|
|
|
CXXFLAGS += -DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS -fno-exceptions
|
|
|
|
endif
|
|
|
|
|
2016-03-02 20:09:16 +03:00
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
-include $(DEPS)
|
|
|
|
|
2016-04-11 15:30:17 +03:00
|
|
|
$(TARGET): $(CLI_OBJECTS) $(STATIC_LIB)
|
|
|
|
$(CXX) -o $@ $(CLI_OBJECTS) $(STATIC_LIB) $(LDFLAGS)
|
|
|
|
|
|
|
|
$(STATIC_LIB): $(OBJECTS)
|
|
|
|
$(AR) rcs $@ $(OBJECTS)
|
2016-03-02 20:09:16 +03:00
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS) -MMD
|
|
|
|
|
|
|
|
clean:
|
2016-04-11 15:30:17 +03:00
|
|
|
rm -f $(TARGET) $(OBJECTS) $(CLI_OBJECTS) $(STATIC_LIB) $(DEPS)
|
2016-03-02 20:09:16 +03:00
|
|
|
|
|
|
|
.PHONY: clean
|