config.mk (1444B)
1 PROJECT = guck 2 3 OBJDIR = obj 4 SRCDIR = src 5 6 MOC_H_FILES := $(shell ag -l Q_OBJECT src | tr "\n" " ") 7 MOC_BASENAMES := $(shell echo ${MOC_H_FILES} | xargs -n 1 basename) 8 MOC_SRC_FILES := $(MOC_BASENAMES:.hh=.moc.cc) 9 MOC_OBJ_FILES := $(patsubst %.moc.cc,obj/%.moc.o,${MOC_SRC_FILES}) 10 11 BROWSER_SRC_FILES := $(wildcard src/ui/*.cc) 12 BROWSER_OBJ_FILES := $(patsubst src/ui/%.cc,obj/%.o,${BROWSER_SRC_FILES}) 13 14 STATUSBAR_SRC_FILES := $(shell find src/ui/statusbar -name "*.cc") 15 STATUSBAR_OBJ_FILES := $(patsubst src/ui/statusbar/%.cc,obj/%.o,${STATUSBAR_SRC_FILES}) 16 17 TABBAR_SRC_FILES := $(shell find src/ui/tabbar -name "*.cc") 18 TABBAR_OBJ_FILES := $(patsubst src/ui/tabbar/%.cc,obj/%.o,${TABBAR_SRC_FILES}) 19 20 BASE_SRC_FILES := $(wildcard src/*.cc) 21 BASE_OBJ_FILES := $(patsubst src/%.cc,obj/%.o,${BASE_SRC_FILES}) 22 23 H_FILES := $(shell find $(SRCDIR) -name '*.hh') 24 SRC_FILES := $(shell find $(SRCDIR) -name '*.cc') 25 OBJ_FILES := ${STATUSBAR_OBJ_FILES} ${TABBAR_OBJ_FILES} ${BROWSER_OBJ_FILES} ${BASE_OBJ_FILES} ${MOC_OBJ_FILES} 26 DEPS = $(OBJ_FILES:%.o=%.d) 27 28 BIN = bin/$(PROJECT) 29 INSTALL = /usr/local/bin/ 30 TARGET ?= $(BIN) 31 32 PKGDEPS = Qt5{Widgets,WebEngineWidgets,Core,WebEngine} 33 SANFLAGS ?= -fsanitize=undefined -fsanitize=address -fsanitize-address-use-after-scope 34 35 CXXFLAGS ?= -std=c++17 -fPIC ${SANFLAGS} 36 CXXFLAGS += `pkg-config --cflags ${PKGDEPS}` 37 38 LDFLAGS ?= ${SANFLAGS} 39 LDFLAGS += `pkg-config --libs ${PKGDEPS}` 40 41 DEBUG_FLAGS = -Wall -DDEBUG 42 43 CC = g++