Skip to content
Snippets Groups Projects
Makefile 1.9 KiB
Newer Older
  • Learn to ignore specific revisions
  • Chao's avatar
    Chao committed
    ################################################################################
    # 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
    
    A-Compton's avatar
    A-Compton committed
    SIMP_ROOT     = third_party/simple
    
    Chao's avatar
    Chao committed
    
    FFLAGS        = -fPIC -cpp -ffixed-line-length-none
    
    
    CXXFLAGS      = -O2 -g -pipe -Wall -fPIC
    CXXFLAGS     += $(shell root-config --cflags)
    
    A-Compton's avatar
    A-Compton committed
    
    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 \
    
    Chao's avatar
    Chao committed
                    -L$(ROOTSYS)/lib -lCore -lRint -lRIO -lNet -lHist \
    
    A-Compton's avatar
    A-Compton committed
                    -lGraf -lGraf3d -lGpad -lTree -lPostscript -lMatrix \
                    -lPhysics -lMathCore -lThread -lGui -lSpectrum
    
    Chao's avatar
    Chao committed
    
    ####### 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
    
    
    Chao's avatar
    Chao committed
    .PHONY: lib exe
    
    
    all: lib exe
    
    lib:
    	$(MAKE) -C $(HANA_ROOT) -f Makefile
    	$(MAKE) -C $(CONF_ROOT) -f Makefile
    
    A-Compton's avatar
    A-Compton committed
    	$(MAKE) -C $(SIMP_ROOT) -f Makefile
    
    Chao's avatar
    Chao committed
    
    $(BUILD_DIR)/%: $(SOURCE_DIR)/%.cpp
    	$(CXX) $(CXXFLAGS) -o $@ $< $(INCPATH) $(LIBS)
    
    ####### Clean
    clean:
    	$(DEL_FILE) $(TARGETS)
    
    
    cleanall: clean
    
    A-Compton's avatar
    A-Compton committed
    #	$(MAKE) -C $(HANA_ROOT) -f Makefile clean
    #	$(MAKE) -C $(CONF_ROOT) -f Makefile clean
    #	$(MAKE) -C $(SIMP_ROOT) -f Makefile clean
    
    Chao's avatar
    Chao committed
    ####### Install
    
    install:   FORCE
    
    uninstall:   FORCE
    
    FORCE: