CXX=g++ CXXFLAGS=-Wall -Wextra -std=c++17 -fno-elide-constructors .PHONY: all all: bin/ecci.a bin/concat bin/median bin/words bin/word_count # bin/test .PHONY: asan asan: CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer asan: all # Link Concat app bin/concat: build/concat/main.o bin/ecci.a | bin/. $(CXX) -g $(CXXFLAGS) $^ -o $@ # Compile Concat app source build/concat/main.o: src/concat/main.cpp | build/concat/. $(CXX) -c -g $(CXXFLAGS) -Isrc/ecci $< -o $@ # Link Median app bin/median: build/median/median.o bin/ecci.a | bin/. $(CXX) -g $(CXXFLAGS) $^ -o $@ # Compile Median app source build/median/median.o: src/median/median.cpp | build/median/. $(CXX) -c -g $(CXXFLAGS) -Isrc/ecci $< -o $@ # Link Words app bin/words: build/words/main.o bin/ecci.a | bin/. $(CXX) -g $(CXXFLAGS) $^ -o $@ # Compile Words app source build/words/main.o: src/words/main.cpp | build/words/. $(CXX) -c -g $(CXXFLAGS) -Isrc/ecci $< -o $@ # Link Word count app bin/word_count: build/word_count/main.o bin/ecci.a | bin/. $(CXX) -g $(CXXFLAGS) $^ -o $@ # Compile word_count app source build/word_count/main.o: src/word_count/main.cpp | build/word_count/. $(CXX) -c -g $(CXXFLAGS) -Isrc/ecci $< -o $@ # Link Word count app bin/test: build/test/test_array.o build/test/test_map.o build/test/main.o bin/ecci.a | bin/. $(CXX) -g $(CXXFLAGS) $^ -o $@ # Compile test app source build/test/%.o: src/test/%.cpp src/test/catch.hpp | build/test/. $(CXX) -c -g $(CXXFLAGS) -Isrc/ecci $< -o $@ # Download the catch.hpp v2 header file src/test/catch.hpp: wget -q https://github.com/catchorg/Catch2/releases/download/v2.13.9/catch.hpp -O $@ # Link ECCI static library bin/ecci.a: build/ecci/String.o | bin/. ar rs $@ $^ # Compile ECCI static library source build/ecci/%.o: src/ecci/%.cpp src/ecci/%.hpp | build/ecci/. $(CXX) -c -g $(CXXFLAGS) $< -o $@ # Link ECCI dynamic library bin/ecci.so: build/ecci_dyn/String.o | bin/. $(CXX) -shared $^ -o $@ # Compile ECCI dynamic library source build/ecci_dyn/%.o: src/ecci/%.cpp src/ecci/%.hpp | build/ecci_dyn/. $(CXX) -c -fPIC -g $(CXXFLAGS) $< -o $@ .PRECIOUS: %/. %/.: mkdir -p $@ .PHONY: clean clean: rm -rf bin/ build/ doc/ .PHONY: lint lint: cpplint --filter=-build/header_guard,-build/include_subdir,-build/c++11,-runtime/references src/concat/*.?pp src/ecci/*.?pp