Skip to content
Snippets Groups Projects
Commit 186bd8dd authored by adrien-matta's avatar adrien-matta
Browse files

* Modified the Compilation logic

parent 3101f592
No related branches found
No related tags found
No related merge requests found
......@@ -9,10 +9,9 @@ FILLINC = FillIncludeDir
FILLLIB = FillLibraryDir
LIBLIST = liblistfile
#Silence the process
all: .SILENT
.SILENT: $(SHARELIB) $(FILLLIB) $(LIBLIST)
.SILENT: $(SHARELIB) $(LIBLIST)
#------------------------------------------------------------------------------
############### fillinclib ##############
......@@ -20,7 +19,6 @@ FillIncludeDir:
./scripts/fillincdir.sh
FillLibraryDir: $(SHARELIB) $(FILLINC)
./scripts/filllibdir.sh
ifeq ($(findstring macosx, $(ARCH)), macosx)
./scripts/filllibmacdir.sh
endif
......@@ -34,23 +32,24 @@ liblistfile: $(FILLLIB) $(SHARELIB) $(FILLIB)
# where the wanted detector are defined
include $(NPTOOL)/NPLib/Makefile.detector
############# Clean and More ##########
clean: cleandetector cleancore
cleancore:
$(NPTOOL)/NPLib/scripts/makefile.sh clean core
clean:
rm -f ./*/*.o
cleandetector:
$(NPTOOL)/NPLib/scripts/makefile.sh clean detector
distclean:
@echo " + Deleting libraries in lib directory....."
@echo " + Deleting libraries in lib directory"
rm -f ./lib/*
@echo " + Deleting header files in include directory....."
@echo " + Deleting header files in include directory"
rm -f ./include/*
@echo " + Deleting liblist file....."
@echo " + Deleting liblist file"
rm -f liblist
@echo " + Emptying Makefile.detector"
rm -f Makefile.detector
touch Makefile.detector
@echo " + Deleting NPToolLogon"
rm -f ./scripts/NPToolLogon_C*
./scripts/makefile.sh distclean detector
./scripts/makefile.sh distclean core
@echo " + Deleting intermediate compilation files"
rm -f ./*/*Dict*
rm -f ./*/*.o
@echo " + Deleting shared libraries files in detector directory"
rm -f ./*/*.s
# *****************************************************************************
# * Copyright (C) 2009 this file is part of the NPTool Project *
# * *
# * For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
# * For the list of contributors see $NPTOOL/Licence/Contributors *
# *****************************************************************************/
# *****************************************************************************
# * Original Author: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
# * *
# * Creation Date : 16/11/10 *
# * Last update : *
# *---------------------------------------------------------------------------*
# * Decription: This script moves all the libraries (*.so) in all directories *
# * to the lib/ directory. *
# *---------------------------------------------------------------------------*
# * Comment: *
# * *
# * *
# *****************************************************************************
#! /bin/bash
echo " + Copying libraries to the lib directory....."
# previously, clean lib/ directory
rm -f lib/*.so
# loop recursively on header files in all directories
for file in */*.so
do
# copy header files to the include directory
cp -f $file lib/
done
rm -f lib/NPToolLogon_C.so
# *****************************************************************************
# * Copyright (C) 2009 this file is part of the NPTool Project *
# * *
# * For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
# * For the list of contributors see $NPTOOL/Licence/Contributors *
# *****************************************************************************/
# *****************************************************************************
# * Original Author: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
# * *
# * Creation Date : 16/11/10 *
# * Last update : *
# *---------------------------------------------------------------------------*
# * Decription: This script loops on all subdirectories containing a Makefile *
# * and call it with the argument passed to the script. *
# * Supported arguments are: *
# * + no arguments: compile everything *
# * + clean: remove temporary files but not shared library *
# * + distclean: remove temporary files and shared library *
# * *
# *---------------------------------------------------------------------------*
# * Comment: *
# * *
# * *
# *****************************************************************************
#! /bin/bash
if [ $# = 0 ] ; then
printf " + Building detector libraries.....\n"
else
printf " + Cleaning $2 libraries.....\n"
fi ;
# read .detector_libs or .core_libs file created by the configure script
file=".""$2_libs"
if [ $# = 0 ] ; then
file=".detector_libs"
fi ;
read -r detectorlibs < "$file"
# loop recursively on Makefile files in sub-directories
for file in */Makefile
do
# remove "Makefile" string from file name
name=${file%\/*}
# file name in lower case
lname=$(echo "$name" | tr '[A-Z]' '[a-z]')
# only build defined detector libraries
if printf "$detectorlibs" | grep -q "$lname" ; then
# print informations
printf "\tEntering $name directory...\n"
# add "-C ./" pattern at the beginning of the name
cmd="-C ./$name"
# execute make command with target specified on command line
make -j --silent $1 $cmd
fi ;
done
......@@ -35,5 +35,6 @@ printf "FillIncludeDir \n" >> $2
printf "\t@echo \"Entering $1 directory...\"\n" >> $2
# execute make command with target specified on command line
printf "\tmake --silent -C ./$1\n" >> $2
printf "\tcp ./$1/*.so lib/\n" >> $2
printf "\n" >> $2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment