rntviewer/Makefile
2024-07-11 16:49:18 +02:00

29 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
.PHONY: all clean
all: build/imgui.o build/root_stuff.o noasan
clean:
rm build/*.o rntviewer
build/imgui.o: src/imgui_inc.cpp third_party/imgui/imgui.h
$(CXX) -O3 -fPIC -c -Ithird_party/imgui $< -o $@
build/root_stuff.o: src/PseudoMiniFile.cxx
$(CXX) -O3 -fPIC -c $(ROOTFLAGS) $< -o $@
d: build/root_stuff.o build/imgui.o
$(MOLD) $(CXX) -DDEBUG -g -O0 -DENABLE_ASAN $(CFLAGS) -fsanitize=undefined $(INC) $(ROOTFLAGS) -o rntviewer src/rntviewer.cpp build/imgui.o build/root_stuff.o -lasan $(ROOTLIBS) $(LIBS)
noasan: build/root_stuff.o build/imgui.o
$(MOLD) $(CXX) -DDEBUG -g -O0 $(CFLAGS) -fsanitize=undefined $(INC) $(ROOTFLAGS) -o rntviewer src/rntviewer.cpp build/imgui.o build/root_stuff.o $(ROOTLIBS) $(LIBS)
r: build/root_stuff.o build/imgui.o
$(MOLD) $(CXX) -O2 $(CFLAGS) $(INC) $(ROOTFLAGS) -o rntviewer src/rntviewer.cpp build/imgui.o build/root_stuff.o $(ROOTLIBS) $(LIBS)