CXX = clang++ CFLAGS = -Wall -Wextra -pedantic INC = -Ithird_party -Ithird_party/imgui ROOT = $(HOME)/root_build/debug ROOTFLAGS = -std=c++17 -m64 -I$(ROOT)/include ROOTLIBS = -L$(ROOT)/lib -lCore -lRIO -lROOTNTuple -lxxhash -Wl,-rpath,$(ROOT)/lib -pthread LIBS = -lglfw MOLD = mold -run ROOT_IFACE = build/libroot_iface.so ROOT_IFACE_DBG = build/libroot_iface_d.so .PHONY: all clean all: build/imgui.o $(ROOT_IFACE) noasan clean: rm build/*.o rntviewer $(ROOT_IFACE) build/imgui.o: src/imgui_inc.cpp third_party/imgui/imgui.h $(CXX) -O3 -fPIC -c -Ithird_party/imgui $< -o $@ # $(ROOT_IFACE): src/root/RMicroFileReader.cxx # $(CXX) -O3 -fPIC -c $(ROOTFLAGS) $< -o $@ $(ROOT_IFACE): src/root/RMicroFileReader.cxx src/root/RMicroFileReader.hxx $(CXX) -O3 -fPIC -shared $(ROOTFLAGS) $< -o $@ $(ROOTLIBS) $(ROOT_IFACE_DBG): src/root/RMicroFileReader.cxx src/root/RMicroFileReader.hxx $(CXX) -g -O0 -fPIC -shared $(ROOTFLAGS) $< -o $@ $(ROOTLIBS) d: $(ROOT_IFACE_DBG) build/imgui.o $(MOLD) $(CXX) -DDEBUG -g -O0 -DENABLE_ASAN $(CFLAGS) $(INC) -o rntviewer src/rntviewer.cpp build/imgui.o -lasan $(ROOT_IFACE_DBG) $(LIBS) noasan: $(ROOT_IFACE_DBG) build/imgui.o $(MOLD) $(CXX) -DDEBUG -g -O0 $(CFLAGS) -fsanitize=undefined $(INC) -o rntviewer src/rntviewer.cpp build/imgui.o $(ROOT_IFACE_DBG) $(LIBS) r: $(ROOT_IFACE) build/imgui.o $(MOLD) $(CXX) -O2 $(CFLAGS) $(INC) -o rntviewer src/rntviewer.cpp build/imgui.o $(ROOT_IFACE) $(LIBS)