forked from hyperk/GHOST-WCSim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
39 lines (31 loc) · 1.51 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
ToolFrameworkPath = /usr/local/hk/ToolFrameworkCore/src
DataModelPath = /usr/local/hk/hk-ToolApp/hk-DataModel/
Geant4Path = /usr/local/hk/Geant4/install-Linux_x86_64-gcc_8-python_3.8.13/
WCSimPath = /usr/local/hk/hk-ToolApp/UserTools/ImportedTools/GHOST-WCSim/OriginalWCSim_build/
RootPath = /usr/local/hk/ROOT/install-Linux_x86_64-gcc_8-python_3.8.13/
ROOT_INCLUDES = -I$(shell root-config --incdir)
ROOT_LIBS = $(shell root-config --libs)
GEANT4_INCLUDES = -I$(Geant4Path)/include/Geant4/
GEANT4_LIBS = $(shell geant4-config --libs)
WCSIM_INCLUDES = -I$(WCSimPath)/include/WCSim/ -DWCSIM_CHECK_GEOMETRY_OVERLAPS=0
WCSIM_LIBS = -L$(WCSimPath)/lib/ -lWCSimCore -lWCSimRoot
EXTERNALS := $(ROOT_INCLUDES) \
$(ROOT_LIBS) \
$(GEANT4_INCLUDES) \
$(GEANT4_LIBS) \
$(WCSIM_LIBS) \
$(WCSIM_INCLUDES)
CXXFLAGS = g++ -O3 -fPIC -Wpedantic -Wall #-std=c++17
ifeq ($(MAKECMDGOALS),debug)
CXXFLAGS+= -O0 -g -lSegFault -rdynamic -DDEBUG #-fsanitize=address
endif
objects:= $(patsubst %.cpp, %.o, $(filter-out template/%.cpp, $(wildcard */*.cpp)))
libs:= $(subst /,/lib, $(patsubst %.o, %.so, $(objects)))
all: $(libs)
lib%.so: %.o
$(CXXFLAGS) --shared $*.o -o $@ -I $(DataModelPath)/DataModel -L $(DataModelPath) -lDataModel -I $(ToolFrameworkPath)/include -L $(ToolFrameworkPath)/lib -lStore -LLogging $(EXTERNALS)
%.o: %.cpp
$(CXXFLAGS) -c $< -o $@ -I $(DataModelPath)/DataModel -L $(DataModelPath) -lDataModel -I $(ToolFrameworkPath)/include -L $(ToolFrameworkPath)/lib -lStore -LLogging $(EXTERNALS)
clean:
rm -f */*.o
rm -f */*.so