Commit d79d80b7 authored by Valentina Fioretti's avatar Valentina Fioretti
Browse files

BoGEMMS-HPC first release

parent 6dfd2543
Loading
Loading
Loading
Loading

AUTHORS

0 → 100644
+6 −0
Original line number Diff line number Diff line
Project managers:
- Valentina Fioretti <valentina.fioretti@inaf.it>
- Andrea Bulgarelli <andrea.bulgarelli@inaf.it>

Developers:
- Alex Ciabattoni <alex.ciabattoni@inaf.it>

CMakeLists.txt

0 → 100644
+107 −0
Original line number Diff line number Diff line
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.8...3.18)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
  cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()
project(bogemms)

#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
  find_package(Geant4 REQUIRED ui_all vis_all)
else()
  find_package(Geant4 REQUIRED)
endif()

find_package(G4mpi REQUIRED)

# Override default values with command-line definitions
if(DEFINED GEANT4_VERSION)
    set(GEANT4_VERSION "${GEANT4_VERSION}" CACHE STRING "Set Geant4 version" FORCE)
else()
    set(GEANT4_VERSION "-D GEANT4_11_1" CACHE STRING "Set Geant4 version")
endif()
add_definitions(${GEANT4_VERSION})

option(NOROOTBUILD "Build without ROOT" ON)
option(SQLBUILD "Build with SQLite" OFF)

if(NOROOTBUILD)
    set(NOROOT "-D WITHOUTROOT" CACHE STRING "Build without ROOT" FORCE)
    add_definitions(${NOROOT})
endif()

if(SQLBUILD)
    set(WITHSQL "-D SQLITE3" CACHE STRING "Build with SQLite" FORCE)
    add_definitions(${WITHSQL})
endif()

# Print the values of options
message(STATUS "GEANT4 VERSION: ${GEANT4_VERSION}")
message(STATUS "NO ROOT BUILDING OPTIONS: ${NOROOTBUILD}")
message(STATUS "SQLite BUILDING OPTIONS: ${SQLBUILD}")


#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})

#----------------------------------------------------------------------------
# Locate sources and headers for this project
#

####### 3) Directories for the compiler

include_directories(${PROJECT_SOURCE_DIR}/code ${PROJECT_SOURCE_DIR}/phys ${PROJECT_SOURCE_DIR}/geom ${Geant4_INCLUDE_DIR} ${G4mpi_INCLUDE_DIR})
file(GLOB sources_code ${PROJECT_SOURCE_DIR}/code/*.cc)
file(GLOB sources_phys ${PROJECT_SOURCE_DIR}/phys/*.cc)
file(GLOB sources_geom ${PROJECT_SOURCE_DIR}/geom/*.cc)
file(GLOB headers_code ${PROJECT_SOURCE_DIR}/code/*.hh)
file(GLOB headers_phys ${PROJECT_SOURCE_DIR}/phys/*.hh)
file(GLOB headers_geom ${PROJECT_SOURCE_DIR}/geom/*.hh)


# Add definitions
#----------------------------------------------------------------------------
add_definitions(-DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")

#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#

if(SQLBUILD)
  SET(EXTRALIBS "-lcfitsio -lsqlite3")
else()
  SET(EXTRALIBS "-lcfitsio")
endif()

add_executable(bogemms ${PROJECT_SOURCE_DIR}/code/bogemms.cc ${sources_code} ${sources_phys} ${sources_geom} ${headers_code} ${headers_phys} ${headers_geom})
target_link_libraries(bogemms ${G4mpi_LIBRARIES}  ${Geant4_LIBRARIES} ${EXTRALIBS})

#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
# build bogemms. This is so that we can run the executable directly because it
# relies on these scripts being in the current working directory.
#
set(bogemms_SCRIPTS
  )

foreach(_script ${bogemms_SCRIPTS})
  configure_file(
    ${PROJECT_SOURCE_DIR}/${_script}
    ${PROJECT_BINARY_DIR}/${_script}
    COPYONLY
    )
endforeach()

#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS bogemms DESTINATION bin)

Doxyfile

0 → 100644
+185 −0
Original line number Diff line number Diff line
# Doxyfile 1.2.13-20020210

#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME           = BaseProject 
PROJECT_NUMBER         = 1.0.0
OUTPUT_DIRECTORY       = ref
OUTPUT_LANGUAGE        = English
EXTRACT_ALL            = YES
EXTRACT_PRIVATE        = YES
EXTRACT_STATIC         = YES
EXTRACT_LOCAL_CLASSES  = YES
HIDE_UNDOC_MEMBERS     = NO
HIDE_UNDOC_CLASSES     = NO
BRIEF_MEMBER_DESC      = YES
REPEAT_BRIEF           = YES
ALWAYS_DETAILED_SEC    = YES
INLINE_INHERITED_MEMB  = NO
FULL_PATH_NAMES        = NO
STRIP_FROM_PATH        = 
INTERNAL_DOCS          = YES
STRIP_CODE_COMMENTS    = YES
CASE_SENSE_NAMES       = YES
SHORT_NAMES            = NO
HIDE_SCOPE_NAMES       = NO
VERBATIM_HEADERS       = YES
SHOW_INCLUDE_FILES     = YES
JAVADOC_AUTOBRIEF      = NO
INHERIT_DOCS           = YES
INLINE_INFO            = YES
SORT_MEMBER_DOCS       = YES
DISTRIBUTE_GROUP_DOC   = NO
TAB_SIZE               = 4
GENERATE_TODOLIST      = YES
GENERATE_TESTLIST      = YES
GENERATE_BUGLIST       = YES
ALIASES                = 
ENABLED_SECTIONS       = 
MAX_INITIALIZER_LINES  = 30
OPTIMIZE_OUTPUT_FOR_C  = NO
SHOW_USED_FILES        = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET                  = NO
WARNINGS               = YES
WARN_IF_UNDOCUMENTED   = NO
WARN_FORMAT            = "$file:$line: $text"
WARN_LOGFILE           = 
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT                  = code_filtered/
FILE_PATTERNS          = *.h \
                         *.hh \
                         *.H \
                         *.cpp \
						 *.cxx
RECURSIVE              = YES
EXCLUDE                = 
EXCLUDE_SYMLINKS       = NO
EXCLUDE_PATTERNS       = 
EXAMPLE_PATH           = 
EXAMPLE_PATTERNS       = 
EXAMPLE_RECURSIVE      = NO
IMAGE_PATH             = 
INPUT_FILTER           = 
FILTER_SOURCE_FILES    = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER         = NO
INLINE_SOURCES         = NO
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION    = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX     = YES
COLS_IN_ALPHA_INDEX    = 5
IGNORE_PREFIX          = 
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML          = YES
HTML_OUTPUT            = html
HTML_FILE_EXTENSION    = .html
HTML_HEADER            = 
HTML_FOOTER            = 
HTML_STYLESHEET        = 
HTML_ALIGN_MEMBERS     = YES
GENERATE_HTMLHELP      = YES
GENERATE_CHI           = YES
BINARY_TOC             = YES
TOC_EXPAND             = YES
DISABLE_INDEX          = NO
ENUM_VALUES_PER_LINE   = 4
GENERATE_TREEVIEW      = NO
TREEVIEW_WIDTH         = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX         = YES
LATEX_OUTPUT           = latex
COMPACT_LATEX          = NO
PAPER_TYPE             = a4
EXTRA_PACKAGES         = 
LATEX_HEADER           = 
PDF_HYPERLINKS         = NO
USE_PDFLATEX           = NO
LATEX_BATCHMODE        = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF           = YES
RTF_OUTPUT             = rtf
COMPACT_RTF            = NO
RTF_HYPERLINKS         = NO
RTF_STYLESHEET_FILE    = 
RTF_EXTENSIONS_FILE    = 
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN           = NO
MAN_OUTPUT             = man
MAN_EXTENSION          = .3
MAN_LINKS              = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML           = NO
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF   = YES
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor   
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING   = YES
MACRO_EXPANSION        = NO
EXPAND_ONLY_PREDEF     = NO
SEARCH_INCLUDES        = YES
INCLUDE_PATH           = 
INCLUDE_FILE_PATTERNS  = 
PREDEFINED             = 
EXPAND_AS_DEFINED      = 
SKIP_FUNCTION_MACROS   = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references   
#---------------------------------------------------------------------------
TAGFILES               = 
GENERATE_TAGFILE       = 
ALLEXTERNALS           = NO
EXTERNAL_GROUPS        = YES
PERL_PATH              = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool   
#---------------------------------------------------------------------------
CLASS_DIAGRAMS         = YES
HAVE_DOT               = YES
CLASS_GRAPH            = YES
COLLABORATION_GRAPH    = YES
TEMPLATE_RELATIONS     = YES
HIDE_UNDOC_RELATIONS   = YES
INCLUDE_GRAPH          = YES
INCLUDED_BY_GRAPH      = YES
GRAPHICAL_HIERARCHY    = YES
DOT_IMAGE_FORMAT       = gif
DOT_PATH               = 
DOTFILE_DIRS           = 
MAX_DOT_GRAPH_WIDTH    = 1024
MAX_DOT_GRAPH_HEIGHT   = 1024
GENERATE_LEGEND        = YES
DOT_CLEANUP            = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine   
#---------------------------------------------------------------------------
SEARCHENGINE           = NO
CGI_NAME               = search.cgi
CGI_URL                = 
DOC_URL                = 
DOC_ABSPATH            = 
BIN_ABSPATH            = /usr/local/bin/
EXT_DOC_PATHS          =

Makefile

0 → 100644
+350 −0
Original line number Diff line number Diff line
#############################################################################
# Template: exe lib version 2013-10-08
# Use make variable_name=' options ' to override the variables or make -e to
# override the file variables with the environment variables
# 		make CFLAGS='-g'
#		make prefix='/usr'
#		make CC=gcc-4.8
#		make COMPILEVARS="-D GEANT4_9_6 -D GEANT4_10_1 -D GEANT4_10_2 -D GEANT4_10_3 -D GEANT4_10_4 -D WITHOUTROOT -D SQLITE3"
#               e.g. make COMPILEVARS="-D GEANT4_10_4"
# NOTE: If you want to compile without root remove "root" keyword to LINKERENV and
# compile with COMPILEVARS="-D WITHOUTROOT -D GEANT4_X_Y"
#
# External environment variable. 
#	Build: CPLUS_INCLUDE_PATH LIBRARY_PATH
#	Execution: LD_LIBRARY_PATH DYLD_LIBRARY_PATH LOCAL  
# Instructions:
# - modify the section 1)
# - in section 10), modify the following action:
#		* all: and or remove exe and lib prerequisite
#		* lib: and or remove staticlib and dynamiclib prerequisite
#		* clean: add or remove the files and directories that should be cleaned
#		* install: add or remove the files and directories that should be installed
#		* uninstall: add or remove the files and directories that should be uninstalled
#############################################################################

PROJECT= thelsim 
SHELL = /bin/sh

####### 1) Project names and system

SYSTEM= $(shell gcc -dumpmachine)
#ice, ctarta, mpi, cfitsio, geant4
LINKERENV= geant4, cfitsio, xercesc, sqlite3, root
EXE_NAME1 = thelsim
EXE_NAME2 =
LIB_NAME = 
VER_FILE_NAME = version.h
#the name of the directory where the conf file are copied (into $(datadir))
CONF_DEST_DIR = thelsim
#the name of the icon for the installation
ICON_NAME=

####### 2) Directories for the installation

# Prefix for each installed program. Only ABSOLUTE PATH
prefix=$(LOCAL)
exec_prefix=$(prefix)
# The directory to install the binary files in.
bindir=$(exec_prefix)/bin
# The directory to install the local configuration file.
datadir=$(exec_prefix)/share
# The directory to install the libraries in.
libdir=$(exec_prefix)/lib
# The directory to install the info files in.
infodir=$(exec_prefix)/info
# The directory to install the include files in.
includedir=$(exec_prefix)/include
# The directory to install the icon
icondir=$(HOME)/.local/share/applications/

####### 3) Directories for the compiler

OBJECTS_DIR = obj
SOURCE_DIR = code
SOURCE_DIR_PHYS = phys
SOURCE_DIR_GEOM = geom
INCLUDE_DIR = code
INCLUDE_DIR_PHYS = phys
INCLUDE_DIR_GEOM = geom
DOC_DIR = ref
DOXY_SOURCE_DIR = code_filtered
EXE_DESTDIR  = .
LIB_DESTDIR = lib
CONF_DIR= conf
ICON_DIR = ui

####### 4) Compiler, tools and options

ifneq (, $(findstring mpi, $(LINKERENV)))
CXX       = mpic++
else
CXX = clang
#CXX      = g++
endif
#CC = clang

#Set INCPATH to add the inclusion paths
INCPATH = -I $(INCLUDE_DIR) -I $(SOURCE_DIR_PHYS) -I $(SOURCE_DIR_GEOM) -I ./phys -I ./geom
LIBS = -lstdc++
#Insert the optional parameter to the compiler. The CFLAGS could be changed externally by the user
CFLAGS   ?= -g
CXXFLAGS ?=  
COMPILEVARS?= -D GEANT4_9_6
#Insert the implicit parameter to the compiler:
ALL_CFLAGS = -g -m64 -fexceptions -Wall  $(INCPATH) $(COMPILEVARS) -Wno-deprecated-register -Wno-unused-variable

ifneq (, $(findstring cfitsio, $(LINKERENV)))
	LIBS += -lcfitsio
endif
ifneq (, $(findstring sqlite3, $(LINKERENV)))
        LIBS += -lsqlite3
endif
ifneq (, $(findstring xercesc, $(LINKERENV)))
        LIBS += -lxerces-c
endif
ifneq (, $(findstring ctarta, $(LINKERENV)))
	LIBS += -lpacket
endif
ifneq (, $(findstring root, $(LINKERENV)))
	ROOTCFLAGS   := $(shell root-config --cflags)
	ROOTLIBS     := $(shell root-config --libs)
	ROOTGLIBS    := $(shell root-config --glibs)
	ROOTCONF= -pipe -W -fPIC -D_REENTRANT $(ROOTCFLAGS)
LIBS += $(ROOTGLIBS) -lMinuit -lTreePlayer -lG4Tree #-lNetx
	ALL_CFLAGS += $(ROOTCONF)
endif
ifneq (, $(findstring geant4, $(LINKERENV)))
	GEANT4CFLAGS   := $(shell geant4-config --cflags)
	GEANT4LIBS     := $(shell geant4-config --libs)
	LIBS += $(GEANT4LIBS) 
	ALL_CFLAGS += $(GEANT4CFLAGS)
endif


#Set addition parameters that depends by operating system

ifneq (, $(findstring linux, $(SYSTEM)))
 	#Do linux things
	ifneq (, $(findstring ice, $(LINKERENV)))
		LIBS += -lIce -lIceUtil -lFreeze
	endif
endif
ifneq (, $(findstring qnx, $(SYSTEM)))
    # Do qnx things
	ALL_CFLAGS += -Vgcc_ntox86_gpp -lang-c++
	LIBS += -lsocket
endif
ifneq (, $(findstring apple, $(SYSTEM)))
 	# Do apple things
	ifneq (, $(findstring ice, $(LINKERENV)))
                LIBS += -lZerocIce -lZerocIceUtil -lFreeze
	endif
endif 

LINK     ?= $CXX
#for link
LFLAGS ?= -shared -Wl,-soname,$(TARGET1) -Wl,$(DESTDIR)
AR       = ar cqs
TAR      = tar -cf
GZIP     = gzip -9f
COPY     = cp -f -r
COPY_FILE= $(COPY) -p
COPY_DIR = $(COPY) -pR
DEL_FILE = rm -f
SYMLINK  = ln -sf
DEL_DIR  = rm -rf
MOVE     = mv -f
CHK_DIR_EXISTS= test -d
MKDIR    = mkdir -p

####### 5) VPATH

VPATH=$(SOURCE_DIR):$(SOURCE_DIR_PHYS):$(SOURCE_DIR_GEOM):$(INCLUDE_DIR):
vpath %.o $(OBJECTS_DIR)

####### 6) Files of the project
	
INCLUDE=$(foreach dir,$(INCLUDE_DIR), $(wildcard $(dir)/*.h))
INCLUDE+=$(foreach dir,$(INCLUDE_DIR), $(wildcard $(dir)/*.hh))
INCLUDE+=$(foreach dir,$(INCLUDE_DIR_PHYS), $(wildcard $(dir)/*.h))
INCLUDE+=$(foreach dir,$(INCLUDE_DIR_PHYS), $(wildcard $(dir)/*.hh))
INCLUDE+=$(foreach dir,$(INCLUDE_DIR_GEOM), $(wildcard $(dir)/*.h))
INCLUDE+=$(foreach dir,$(INCLUDE_DIR_GEOM), $(wildcard $(dir)/*.hh))
SOURCE=$(foreach dir,$(SOURCE_DIR), $(wildcard $(dir)/*.cpp))
SOURCE+=$(foreach dir,$(SOURCE_DIR), $(wildcard $(dir)/*.cc))
SOURCE+=$(foreach dir,$(SOURCE_DIR), $(wildcard $(dir)/*.c))
SOURCE+=$(foreach dir,$(SOURCE_DIR_PHYS), $(wildcard $(dir)/*.cpp))
SOURCE+=$(foreach dir,$(SOURCE_DIR_PHYS), $(wildcard $(dir)/*.cc))
SOURCE+=$(foreach dir,$(SOURCE_DIR_PHYS), $(wildcard $(dir)/*.c))
SOURCE+=$(foreach dir,$(SOURCE_DIR_GEOM), $(wildcard $(dir)/*.cpp))
SOURCE+=$(foreach dir,$(SOURCE_DIR_GEOM), $(wildcard $(dir)/*.cc))
SOURCE+=$(foreach dir,$(SOURCE_DIR_GEOM), $(wildcard $(dir)/*.c))
#Objects to build
OBJECTS=$(addsuffix .o, $(basename $(notdir $(SOURCE))))
#only for documentation generation
DOC_INCLUDE= $(addprefix $(DOXY_SOURCE_DIR)/, $(notdir $(INCLUDE)))
DOC_SOURCE= $(addprefix $(DOXY_SOURCE_DIR)/, $(notdir $(SOURCE)))

####### 7) Only for library generation

TARGET  = $(LIB_NAME).so.$(shell cat version)
TARGETA	= $(LIB_NAME).a
TARGETD	= $(LIB_NAME).so.$(shell cat version)
TARGET0	= $(LIB_NAME).so
TARGET1	= $(LIB_NAME).so.$(shell cut version -f 1 -d '.')
TARGET2	= $(LIB_NAME).so.$(shell cut version -f 1 -d '.').$(shell cut version -f 2 -d '.')

####### 8) Preliminar operations

$(shell  cut $(INCLUDE_DIR)/$(VER_FILE_NAME) -f 3 > version)
#WARNING: use -d ' ' if in the version.h the separator is a space

####### 9) Pattern rules

%.o : %.cpp | makeobjdir
	$(CXX) $(CXXFLAGS) $(ALL_CFLAGS) -c $< -o $(OBJECTS_DIR)/$@

%.o : %.cc | makeobjdir
	$(CXX) $(CXXFLAGS) $(ALL_CFLAGS) -c $< -o $(OBJECTS_DIR)/$@

%.o : %.c | makeobjdir
	$(CC) $(CFLAGS) $(ALL_CFLAGS) -c $< -o $(OBJECTS_DIR)/$@

#only for documentation generation
$(DOXY_SOURCE_DIR)/%.h : %.h
	cp  $<  $@

$(DOXY_SOURCE_DIR)/%.hh : %.hh
	cp  $<  $@

$(DOXY_SOURCE_DIR)/%.cpp : %.cpp
	cp  $<  $@

$(DOXY_SOURCE_DIR)/%.cc : %.cc
	cp  $<  $@
	
####### 10) Build rules

#all: compile the entire program.
all: exe
		#only if conf directory is present:
		#$(SYMLINK) $(CONF_DIR) $(CONF_DEST_DIR)

lib: staticlib 
	
exe: $(OBJECTS)
		test -d $(EXE_DESTDIR) || mkdir -p $(EXE_DESTDIR)
		$(CXX) $(CXXFLAGS) $(ALL_CFLAGS) -o $(EXE_DESTDIR)/$(EXE_NAME1) $(OBJECTS_DIR)/*.o $(LIBS)
	
staticlib: $(OBJECTS)
		test -d $(LIB_DESTDIR) || mkdir -p $(LIB_DESTDIR)	
		$(DEL_FILE) $(LIB_DESTDIR)/$(TARGETA) 	
		$(AR) $(LIB_DESTDIR)/$(TARGETA) $(OBJECTS_DIR)/*.o
	
dynamiclib: $(OBJECTS)
		test -d $(LIB_DESTDIR) || mkdir -p $(LIB_DESTDIR)
		$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
		$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS_DIR)/*.o $(LIBS)
		$(SYMLINK) $(TARGET) $(TARGET0)
		$(SYMLINK) $(TARGET) $(TARGET1)
		$(SYMLINK) $(TARGET) $(TARGET2)
		test $(LIB_DESTDIR) = . || $(DEL_FILE) $(LIB_DESTDIR)/$(TARGET)
		test $(LIB_DESTDIR) = . || $(DEL_FILE) $(LIB_DESTDIR)/$(TARGET0)
		test $(LIB_DESTDIR) = . || $(DEL_FILE) $(LIB_DESTDIR)/$(TARGET1)
		test $(LIB_DESTDIR) = . || $(DEL_FILE) $(LIB_DESTDIR)/$(TARGET2)
		test $(LIB_DESTDIR) = . || $(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) $(LIB_DESTDIR)
	
makeobjdir:
	test -d $(OBJECTS_DIR) || mkdir -p $(OBJECTS_DIR)

#clean: delete all files from the current directory that are normally created by building the program. 
clean:
	$(DEL_FILE) $(OBJECTS_DIR)/*.o
	$(DEL_FILE) *~ core *.core
#	$(DEL_FILE) $(LIB_DESTDIR)/*.a
#	$(DEL_FILE) $(LIB_DESTDIR)/*.so*
	$(DEL_FILE) $(EXE_DESTDIR)/$(EXE_NAME1)	
#$(DEL_FILE) $(EXE_DESTDIR)/$(EXE_NAME2)
	$(DEL_FILE) version
	$(DEL_FILE) prefix
	$(DEL_FILE) $(PROJECT).dvi
	$(DEL_FILE) $(PROJECT).pdf
	$(DEL_FILE) $(PROJECT).ps
	test $(OBJECTS_DIR) = . || $(DEL_DIR) $(OBJECTS_DIR)
	test $(EXE_DESTDIR) = . || $(DEL_DIR) $(EXE_DESTDIR)
	test $(LIB_DESTDIR) = . || $(DEL_DIR) $(LIB_DESTDIR)
	test $(DOXY_SOURCE_DIR) = . || $(DEL_DIR) $(DOXY_SOURCE_DIR)
	test $(DOC_DIR) = . || $(DEL_DIR) $(DOC_DIR)
	
	
#Delete all files from the current directory that are created by configuring or building the program. 
distclean: clean

#install: compile the program and copy the executables, libraries, 
#and so on to the file names where they should reside for actual use. 
install: all
	$(shell echo $(prefix) > prefix)
	#test -d $(infodir) || mkdir -p $(infodir)	

	# For library installation
	#test -d $(libdir) || mkdir -p $(libdir)
	#test -d $(includedir) || mkdir -p $(includedir)	
	#$(COPY_FILE) $(LIB_DESTDIR)/$(TARGETA) $(libdir)
	#$(COPY_FILE) $(LIB_DESTDIR)/$(TARGET0) $(libdir)
	#$(COPY_FILE) $(LIB_DESTDIR)/$(TARGET1) $(libdir)
	#$(COPY_FILE) $(LIB_DESTDIR)/$(TARGET2) $(libdir)
	#$(COPY_FILE) $(LIB_DESTDIR)/$(TARGETD) $(libdir)
	#$(COPY_FILE) $(INCLUDE) $(includedir)
	
	# For exe installation
	test -d $(bindir) || mkdir -p $(bindir)	
	$(COPY_FILE) $(EXE_DESTDIR)/$(EXE_NAME1) $(bindir)
	$(COPY_FILE) $(EXE_DESTDIR)/$(EXE_NAME2) $(bindir)
	
	#copy icon
	#test -d $(icondir) || mkdir -p $(icondir)
	#$(COPY_FILE) $(ICON_DIR)/$(ICON_NAME) $(icondir)

	# For conf files installation
	test -d $(datadir)/$(CONF_DEST_DIR) || mkdir -p $(datadir)/$(CONF_DEST_DIR)
	$(COPY_FILE) $(CONF_DIR)/* $(datadir)/$(CONF_DEST_DIR)


#uninstall: delete all the installed files--the copies that the `install' target creates. 
uninstall:
	#For library uninstall
	$(DEL_FILE) $(libdir)/$(TARGETA)	
	$(DEL_FILE) $(libdir)/$(TARGETD)
	$(DEL_FILE) $(libdir)/$(TARGET0)
	$(DEL_FILE) $(libdir)/$(TARGET1)
	$(DEL_FILE) $(libdir)/$(TARGET2)
	$(DEL_FILE) $(addprefix $(includedir)/, $(notdir $(INCLUDE)))
	
	# For exe uninstall
	$(DEL_FILE) $(bindir)/$(EXE_NAME)
	#$(DEL_FILE) $(icondir)/$(ICON_NAME)
	
#dist: create a distribution tar file for this program
dist: all

# dvi, pdf, ps, for documentation generation	
dvi: info
	cd $(DOC_DIR)/latex && $(MAKE)
	$(SYMLINK) $(DOC_DIR)/latex/refman.dvi $(PROJECT).dvi
	
pdf: info
	cd $(DOC_DIR)/latex && $(MAKE) pdf
	$(SYMLINK) $(DOC_DIR)/latex/refman.pdf $(PROJECT).pdf

ps: info
	cd $(DOC_DIR)/latex && $(MAKE) ps
	$(SYMLINK) $(DOC_DIR)/latex/refman.ps $(PROJECT).ps
	
#info: generate any Info files needed.
info:	makedoxdir $(DOC_INCLUDE) $(DOC_SOURCE)
	test -d $(DOC_DIR) || mkdir -p $(DOC_DIR)
	doxygen Doxyfile
	
makedoxdir:
	test -d $(DOXY_SOURCE_DIR) || mkdir -p $(DOXY_SOURCE_DIR)
+1346 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading