updated example makefiles

This commit is contained in:
gabime 2014-10-14 05:16:16 +03:00
parent 391bd396ef
commit beca913851
3 changed files with 32 additions and 15 deletions

View File

@ -9,7 +9,7 @@
#include "c11log/sinks/file_sinks.h" #include "c11log/sinks/file_sinks.h"
using namespace std; using namespace std;
int main2(int argc, char* argv[]) int main(int, char* [])
{ {
auto console = c11log::factory::stdout_logger(); auto console = c11log::factory::stdout_logger();

View File

@ -3,19 +3,27 @@ CXXFLAGS = -march=native -Wall -Wextra -Wshadow -pedantic -std=c++11 -pthread -I
CXX_RELEASE_FLAGS = -O3 -flto CXX_RELEASE_FLAGS = -O3 -flto
CXX_DEBUG_FLAGS= -g CXX_DEBUG_FLAGS= -g
OUTBIN = example
all: example.cpp all: example bench
$(CXX) example.cpp -o $(OUTBIN) $(CXXFLAGS) $(CXX_RELEASE_FLAGS) debug: example-debug bench-debug
example: example.cpp
$(CXX) example.cpp -o example $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
bench: bench.cpp
$(CXX) bench.cpp -o bench $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
debug: example.cpp example-debug: example.cpp
$(CXX) example.cpp -o $(OUTBIN)-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS) $(CXX) example.cpp -o example-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
bench-debug: bench.cpp
$(CXX) bench.cpp -o bench-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
clean: clean:
rm -f *.txt $(OUTBIN) $(OUTBIN)-debug rm -f *.o *.txt example example-debug bench bench-debug
rebuild: clean all rebuild: clean all

View File

@ -1,21 +1,30 @@
CXX = clang++ CXX = clang++
CXXFLAGS = -march=native -Wall -Wextra -Wshadow -pedantic -std=c++11 -pthread -I../include -B/usr/lib/gold-ld/ CXXFLAGS = -march=native -Wall -Wextra -Wshadow -pedantic -std=c++11 -pthread -I../include -B/usr/lib/gold-ld/
CXX_RELEASE_FLAGS = -O3 CXX_RELEASE_FLAGS = -O3 -flto
CXX_DEBUG_FLAGS= -g CXX_DEBUG_FLAGS= -g
OUTBIN = example-clang
all: example.cpp all: example bench
$(CXX) example.cpp -o $(OUTBIN) $(CXXFLAGS) $(CXX_RELEASE_FLAGS) debug: example-debug bench-debug
example: example.cpp
$(CXX) example.cpp -o example-clang $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
bench: bench.cpp
$(CXX) bench.cpp -o bench-clang $(CXXFLAGS) $(CXX_RELEASE_FLAGS)
debug: example.cpp example-debug: example.cpp
$(CXX) example.cpp -o $(OUTBIN)-debug $(CXXFLAGS) $(CXX_DEBUG_FLAFS) $(CXX) example.cpp -o example-clang-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
bench-debug: bench.cpp
$(CXX) bench.cpp -o bench-clang-debug $(CXXFLAGS) $(CXX_DEBUG_FLAGS)
clean: clean:
rm -f *.txt $(OUTBIN) $(OUTBIN)-debug rm -f *.o *.txt example-clang example-clang-debug bench-clang bench-clang-debug
rebuild: clean all rebuild: clean all
rebuild-debug: clean debug rebuild-debug: clean debug