rntviewer/Makefile

40 lines
1.6 KiB
Makefile
Raw Normal View History

2024-07-10 15:04:11 +00:00
CXX = clang++
2024-07-10 17:38:16 +00:00
CFLAGS = -Wall -Wextra -pedantic
INC = -Ithird_party -Ithird_party/imgui
2024-07-11 06:49:20 +00:00
ROOT = $(HOME)/root_build/debug
2024-07-10 19:52:48 +00:00
ROOTFLAGS = -std=c++17 -m64 -I$(ROOT)/include
2024-07-11 14:29:44 +00:00
ROOTLIBS = -L$(ROOT)/lib -lCore -lRIO -lROOTNTuple -lxxhash -Wl,-rpath,$(ROOT)/lib -pthread
2024-07-10 19:52:48 +00:00
LIBS = -lglfw
MOLD = mold -run
2024-07-12 09:58:55 +00:00
# ROOT_IFACE = build/libroot_iface.so
# ROOT_IFACE_DBG = build/libroot_iface_d.so
ROOT_IFACE = build/RMicroFileReader.o
ROOT_IFACE_DBG = $(ROOT_IFACE)
2024-07-10 15:04:11 +00:00
2024-07-11 14:49:18 +00:00
.PHONY: all clean
2024-07-12 07:53:01 +00:00
all: build/imgui.o $(ROOT_IFACE) noasan
2024-07-10 17:38:16 +00:00
2024-07-11 14:49:18 +00:00
clean:
2024-07-12 07:53:01 +00:00
rm build/*.o rntviewer $(ROOT_IFACE)
2024-07-11 14:49:18 +00:00
build/imgui.o: src/imgui_inc.cpp third_party/imgui/imgui.h
2024-07-10 17:38:16 +00:00
$(CXX) -O3 -fPIC -c -Ithird_party/imgui $< -o $@
2024-07-11 14:29:44 +00:00
2024-07-12 09:58:55 +00:00
$(ROOT_IFACE): src/root/RMicroFileReader.cxx
$(CXX) -O3 -fPIC -c $(ROOTFLAGS) $< -o $@
2024-07-12 07:53:01 +00:00
2024-07-12 09:58:55 +00:00
# $(ROOT_IFACE): src/root/RMicroFileReader.cxx src/root/RMicroFileReader.hxx
# $(CXX) -O3 -fPIC -shared $(ROOTFLAGS) $< -o $@ $(ROOTLIBS)
2024-07-11 12:00:43 +00:00
2024-07-12 09:58:55 +00:00
# $(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
2024-07-12 09:58:55 +00:00
$(MOLD) $(CXX) -DDEBUG -g -O0 -DENABLE_ASAN $(CFLAGS) $(INC) $(ROOTFLAGS) -o rntviewer src/rntviewer.cpp build/imgui.o -lasan $(ROOT_IFACE_DBG) $(LIBS) $(ROOTLIBS)
2024-07-12 07:53:01 +00:00
noasan: $(ROOT_IFACE_DBG) build/imgui.o
2024-07-12 09:58:55 +00:00
$(MOLD) $(CXX) -DDEBUG -g -O0 $(CFLAGS) -fsanitize=undefined $(INC) $(ROOTFLAGS) -o rntviewer src/rntviewer.cpp build/imgui.o $(ROOT_IFACE_DBG) $(LIBS) $(ROOTLIBS)
2024-07-10 15:04:11 +00:00
2024-07-12 07:53:01 +00:00
r: $(ROOT_IFACE) build/imgui.o
2024-07-12 09:58:55 +00:00
$(MOLD) $(CXX) -O2 $(CFLAGS) $(INC) $(ROOTFLAGS) -o rntviewer src/rntviewer.cpp build/imgui.o $(ROOT_IFACE) $(LIBS) $(ROOTLIBS)