rntviewer/Makefile
2024-07-12 09:53:01 +02:00

33 lines
1.2 KiB
Makefile

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
.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
$(CXX) -O3 -fPIC -shared $(ROOTFLAGS) $< -o $@ $(ROOTLIBS)
d: $(ROOT_IFACE) build/imgui.o
$(MOLD) $(CXX) -DDEBUG -g -O0 -DENABLE_ASAN $(CFLAGS) -fsanitize=undefined $(INC) -o rntviewer src/rntviewer.cpp build/imgui.o $(ROOT_IFACE) -lasan $(LIBS)
noasan: $(ROOT_IFACE) build/imgui.o
$(MOLD) $(CXX) -DDEBUG -g -O0 $(CFLAGS) -fsanitize=undefined $(INC) -o rntviewer src/rntviewer.cpp build/imgui.o $(ROOT_IFACE) $(LIBS)
r: $(ROOT_IFACE) build/imgui.o
$(MOLD) $(CXX) -O2 $(CFLAGS) $(INC) -o rntviewer src/rntviewer.cpp build/imgui.o $(ROOT_IFACE) $(LIBS)