mirror of https://github.com/gabime/spdlog.git
clang
parent
3feba27f8b
commit
2f6a5eabe0
@ -1,56 +1,23 @@
|
|||||||
SRC_DIR=../../src
|
|
||||||
|
|
||||||
_SOURCES = factory.cpp formatters.cpp os.cpp
|
|
||||||
|
|
||||||
SOURCES = $(patsubst %,$(SRC_DIR)/%,$(_SOURCES))
|
|
||||||
OBJS_RELEASE = $(patsubst %.cpp,release/%.o,$(_SOURCES))
|
|
||||||
OBJS_DEBUG = $(patsubst %.cpp,debug/%.o,$(_SOURCES))
|
|
||||||
|
|
||||||
|
|
||||||
CXX = clang++
|
CXX = clang++
|
||||||
CXXFLAGS = -march=native -Wall -Wextra -Wshadow -pedantic -std=c++11 -pthread -I../../include
|
CXXFLAGS = -march=native -Wall -Wextra -Wshadow -pedantic -std=c++11 -pthread -I../include -B/usr/lib/gold-ld/
|
||||||
CXX_RELEASE_FLAGS = -O3 -flto
|
CXX_RELEASE_FLAGS = -O3 -flto
|
||||||
CXX_DEBUG_FLAGS= -g
|
CXX_DEBUG_FLAGS= -g
|
||||||
|
|
||||||
OUTLIB_RELEASE = libc11log.a
|
OUTBIN = example-clang
|
||||||
OUTLIB_DEBUG = libc11log-debug.a
|
|
||||||
|
|
||||||
TEST_RELEASE = testme-clang
|
|
||||||
TEST_DEBUG = testme-debug-clang
|
|
||||||
|
|
||||||
.PHONY: all mkdirs release debug build clean rebuild
|
|
||||||
|
|
||||||
all: release
|
|
||||||
|
|
||||||
release: CXXFLAGS += $(CXX_RELEASE_FLAGS)
|
all: example.cpp
|
||||||
release: mkdirs build-release
|
$(CXX) example.cpp -o $(OUTBIN) $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
debug: CXXFLAGS += $(CXX_DEBUG_FLAGS)
|
debug: example.cpp
|
||||||
debug: mkdirs build-debug
|
$(CXX) example.cpp -o $(OUTBIN)-debug $(CXXFLAGS) $(CXX_DEBUG_FLAFS)
|
||||||
|
|
||||||
mkdirs:
|
|
||||||
@mkdir -p release debug
|
|
||||||
|
|
||||||
build-release: $(OBJS_RELEASE)
|
|
||||||
ar rs $(OUTLIB_RELEASE) $^
|
|
||||||
$(CXX) $(SRC_DIR)/test.cpp $(OBJS_RELEASE) -o $(TEST_RELEASE) $(CXXFLAGS) -B/usr/lib/gold-ld/
|
|
||||||
|
|
||||||
build-debug: $(OBJS_DEBUG)
|
|
||||||
ar --plugin /usr/local/lib/LLVMgold.so rs $(OUTLIB_DEBUG) $^
|
|
||||||
$(CXX) $(SRC_DIR)/test.cpp $(OBJS_RELEASE) -o $(TEST_DEBUG) $(CXXFLAGS) -B/usr/lib/gold-ld/
|
|
||||||
|
|
||||||
|
|
||||||
release/%.o: $(SRC_DIR)/%.cpp
|
|
||||||
$(CXX) -c $< -o $@ $(CXXFLAGS)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
debug/%.o: $(SRC_DIR)/%.cpp
|
|
||||||
$(CXX) -c $< -o $@ $(CXXFLAGS)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf release debug daily.* $(TEST_RELEASE) $(TEST_DEBUG) $(OUTLIB_RELEASE) $(OUTLIB_DEBUG)
|
rm -f *.txt $(OUTBIN) $(OUTBIN)-debug
|
||||||
|
|
||||||
rebuild: clean all
|
rebuild: clean all
|
||||||
|
rebuild-debug: clean debug
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue