franta-hg@0: # DJM-Fix franta-hg@14: # Copyright © 2025 František Kučera (Frantovo.cz, GlobalCode.info) franta-hg@0: # franta-hg@0: # This program is free software: you can redistribute it and/or modify franta-hg@0: # it under the terms of the GNU General Public License as published by franta-hg@0: # the Free Software Foundation, version 3 of the License. franta-hg@0: # franta-hg@0: # This program is distributed in the hope that it will be useful, franta-hg@0: # but WITHOUT ANY WARRANTY; without even the implied warranty of franta-hg@0: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the franta-hg@0: # GNU General Public License for more details. franta-hg@0: # franta-hg@0: # You should have received a copy of the GNU General Public License franta-hg@0: # along with this program. If not, see . franta-hg@0: franta-hg@14: CXX ?= g++ franta-hg@14: CXXFLAGS ?= -O2 -g3 -ggdb -Wall -Wno-sign-compare franta-hg@14: CXXFLAGS += --std=c++20 franta-hg@14: # CXXFLAGS += -Wextra franta-hg@14: LIBS = alsa franta-hg@14: CXXFLAGS += $(shell pkg-config --cflags $(LIBS)) franta-hg@14: LDFLAGS += $(shell pkg-config --libs $(LIBS)) franta-hg@14: LDFLAGS += -lpthread franta-hg@4: franta-hg@14: ifeq ($(MODE), dev) franta-hg@14: CXXFLAGS += -fsanitize=undefined -fsanitize=address franta-hg@14: endif franta-hg@14: # TODO: provide debug symbols in separate files franta-hg@0: franta-hg@14: BIN = build/djm-fix franta-hg@14: SRC = $(shell find -maxdepth 1 -name '*.cpp') franta-hg@14: HEADERS = $(shell find -maxdepth 1 -name '*.h') franta-hg@0: franta-hg@14: all: $(BIN) franta-hg@1: franta-hg@1: .PHONY: all clean run franta-hg@0: franta-hg@14: clean: franta-hg@14: $(RM) -r build franta-hg@14: franta-hg@14: run: $(BIN) franta-hg@14: $(<) franta-hg@14: franta-hg@14: $(BIN): $(SRC) $(HEADERS) franta-hg@0: mkdir -p build franta-hg@14: $(CXX) $(CXXFLAGS) -o $(@) $(SRC) $(LDFLAGS)