Blame | Last modification | View Log | RSS feed
# Makefile tutorial: https://www.gnu.org/software/make/manual/html_node/index.html#SEC_Contents# Make variables ----------------------------------------------------# ROOT include and librariesROOTINC=$(shell root-config --incdir)ROOTLIB=$(shell root-config --libs)GRROOTLIB=$(shell root-config --cflags --glibs)# Source and debug directoriesSRC=./srcDBG=./dbgIDIR=./includeBIN=./binDICT=./dictLDIR=./lib# Includes and librariesINC=-I. -I$(ROOTINC)LIBS=$(ROOTLIB) -L. -lm# Specific variables for the main programTARGET=root_appFILES=$(SRC)/root_app.CHEADER=$(IDIR)/root_app.h $(IDIR)/root_include.h# -------------------------------------------------------------------# Base rules --------------------------------------------------------# Make the main program and libraries#all: libtest.so $(TARGET)all: $(TARGET)# Rules for making the main program$(TARGET): $(FILES)@echo "\n# Generating dictionary GuiDict.C ---------------------------"rootcint -f $(DICT)/GuiDict.C -c -p $(INC) $(CPPFLAGS) $(IDIR)/root_app.h $(DICT)/GuiLinkDef.h@echo "\n# Checking to see if bin directory already exists -----------"if [ ! -d "$(BIN)" ];then mkdir $(BIN); fi@echo "\n# Compiling main program ------------------------------------"$(CXX) $(INC) -fPIC -g -Wall $(FILES) $(DICT)/GuiDict.C $(CPPFLAGS) -o ./bin/$(TARGET) $(GRROOTLIB) -lstdc++cp -f ./input/start.sh ./@echo "\n# Compilation successful ------------------------------------"@echo "# Use ./start.sh to run the program -------------------------"# -------------------------------------------------------------------# Cleaning rules ----------------------------------------------------# Rules for cleaning the installationclean:@echo "# Cleaning the installation directory -------------------------"rm -fr $(DICT)/*Dict.C $(DICT)/*Dict.h ./bin ./lib start.sh $(SRC)/$(TARGET)_C.d $(SRC)/$(TARGET)_C.so *.o# -------------------------------------------------------------------