franta-hg@0: CXX ?= g++ franta-hg@0: CXXFLAGS ?= -O2 -g3 -ggdb -Wall -Wno-sign-compare franta-hg@0: CXXFLAGS += --std=c++20 franta-hg@0: CXXFLAGS += -fsanitize=undefined -fsanitize=address franta-hg@0: LDFLAGS ?= franta-hg@0: franta-hg@0: SRC = $(shell find -maxdepth 1 -name '*.cpp') franta-hg@0: BIN = $(shell find -maxdepth 1 -name '*.cpp' | xargs basename -s .cpp) franta-hg@0: franta-hg@0: all: $(BIN) franta-hg@0: franta-hg@0: .PHONY: all run clean franta-hg@0: franta-hg@0: clean: franta-hg@0: $(RM) $(BIN) franta-hg@0: franta-hg@0: run: $(BIN) franta-hg@0: @echo "\e[1;32mHappy path without exceptions:\e[0m" franta-hg@0: @for bin in $(BIN); do ./$$bin ; done franta-hg@0: @echo; echo franta-hg@0: @echo "\e[1;32mInterrupted by exceptions:\e[0m" franta-hg@0: @for bin in $(BIN); do ./$$bin fail; done franta-hg@0: franta-hg@0: $(BIN): $(SRC) franta-hg@0: $(CXX) $(CXXFLAGS) -o $(@) $(@).cpp $(LDFLAGS) franta-hg@0: franta-hg@0: # Blok finally při odchytávání výjimek: C++ vs. Java franta-hg@0: # https://blog.frantovo.cz/c/395/