Newer
Older
################################################################################
# Makefile for building the core library for PRad analysis #
################################################################################
# passed by command line
#LIB_OPTION = PRIMEX_METHOD, MULTI_THREAD
include ./general.mk
HANA_ROOT = third_party/analyzer-1.6.0
CONF_ROOT = third_party/prconf
CXXFLAGS = -O2 -g -pipe -Wall -fPIC
CXXFLAGS += $(shell root-config --cflags)
INCPATH = -I. -Iinclude \
-I$(ROOTSYS)/include \
-I$(CONF_ROOT)/include \
-I$(HANA_ROOT)/src -I$(HANA_ROOT)/evio -I$(HANA_ROOT)/hana_decode \
-I$(SIMP_ROOT)
LIBS = -lpthread \
-L$(CONF_ROOT) -lprconf \
-L$(HANA_ROOT) -ldc -lHallA -levio \
-L$(SIMP_ROOT) -lsimple \
-lGraf -lGraf3d -lGpad -lTree -lPostscript -lMatrix \
-lPhysics -lMathCore -lThread -lGui -lSpectrum
####### Targets, add new objects here
SOURCE_DIR = src
BUILD_DIR = bin
SOURCES := $(shell find $(SOURCE_DIR) -name '*.cpp')
TARGETS := $(addprefix $(BUILD_DIR)/, $(SOURCES:$(SOURCE_DIR)/%.cpp=%))
####### Build rules
first: all
all: lib exe
lib:
$(MAKE) -C $(HANA_ROOT) -f Makefile
$(MAKE) -C $(CONF_ROOT) -f Makefile
$(BUILD_DIR)/%: $(SOURCE_DIR)/%.cpp
$(CXX) $(CXXFLAGS) -o $@ $< $(INCPATH) $(LIBS)
####### Clean
clean:
$(DEL_FILE) $(TARGETS)
# $(MAKE) -C $(HANA_ROOT) -f Makefile clean
# $(MAKE) -C $(CONF_ROOT) -f Makefile clean
# $(MAKE) -C $(SIMP_ROOT) -f Makefile clean