SPIRV-Cross/Makefile

38 строки
658 B
Makefile
Исходник Обычный вид История

TARGET := spirv-cross
SOURCES := $(wildcard spirv_*.cpp)
CLI_SOURCES := main.cpp
2016-03-02 20:09:16 +03:00
OBJECTS := $(SOURCES:.cpp=.o)
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
CXXFLAGS += -std=c++11 -Wall -Wextra -Wshadow
2016-03-02 20:09:16 +03:00
ifeq ($(DEBUG), 1)
CXXFLAGS += -O0
2016-03-02 20:09:16 +03:00
else
CXXFLAGS += -O2
2016-03-02 20:09:16 +03:00
endif
all: $(TARGET)
-include $(DEPS)
$(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:
rm -f $(TARGET) $(OBJECTS) $(CLI_OBJECTS) $(STATIC_LIB) $(DEPS)
2016-03-02 20:09:16 +03:00
.PHONY: clean