Skip to content
Snippets Groups Projects
Commit d100d1d0 authored by Giovanna Lazzari Miotto's avatar Giovanna Lazzari Miotto :mushroom:
Browse files

[ci] Update rpm build script and remove deprecated Makefile

Rename source directory, change build location, ensure cmake present
parent 4c5517d9
No related branches found
No related tags found
1 merge request!76[meta,cmake] Restructure project and introduce CMake tooling
......@@ -10,7 +10,7 @@ if [ "$RHEL_MAJOR" = "7" ]; then
exit 1
fi
else
if ! rpm -q gcc redhat-rpm-config rpm-build zlib-devel; then
if ! rpm -q gcc redhat-rpm-config rpm-build zlib-devel cmake; then
echo ""
echo "Please install missing packages."
exit 1
......@@ -19,6 +19,8 @@ fi
echo "..Build dependencies OK"
echo ""
BUILDSYS=${BUILD_SYSTEM:-make}
cd $SCRIPTDIR/..
BASEDIR=$PWD
PARAMCACHE="paramcache"
......@@ -127,13 +129,17 @@ scouting daq
echo $RPM_SOURCE_DIR
echo $BASEDIR
cp -R $BASEDIR/src SOURCES/
mkdir -p src; cp -R $BASEDIR/src/* src/
mkdir -p cmake; cp -R $BASEDIR/cmake/* cmake/
mkdir -p objects;
%build
echo $RPM_SOURCE_DIR
cd SOURCES
pwd
make all
cp $BASEDIR/CMakeLists.txt .
cd objects; pwd
cmake ..
make scdaq
%install
echo $RPM_SOURCE_DIR
......@@ -159,7 +165,11 @@ echo "Copying files to their destination"
cp $BASEDIR/init.d/runSCdaq.service usr/lib/systemd/system/runSCdaq.service
cp -R $BASEDIR/* opt/scdaq
pwd
cp $TOPDIR/RPMBUILD/BUILD/SOURCES/scdaq opt/scdaq/bin/
if [ "$BUILDSYS" = "cmake" ]; then
cp $TOPDIR/RPMBUILD/BUILD/objects/scdaq opt/scdaq/bin/
else
cp $TOPDIR/RPMBUILD/BUILD/src/scdaq opt/scdaq/bin/
fi
cp -R $BASEDIR/etc/scdaq/scdaq.conf etc/scdaq/
#touch opt/scdaq/scratch/new-version
......@@ -188,5 +198,5 @@ if [ \$1 == 0 ]; then
fi
EOF
mkdir -p RPMBUILD/{RPMS/{noarch},SPECS,BUILD,SOURCES,SRPMS}
mkdir -p RPMBUILD/{RPMS/{noarch},SPECS,BUILD,src,SRPMS,cmake,objects}
rpmbuild --define "_topdir $(pwd)/RPMBUILD" -bb scoutdaq.spec
# example makefile
#
# Notes:
# - the indents must be tabs
# - if you need to specify a non-standard compiler, then set CXX
# (it defaults to g++)
# - if you need to pass flags to the linker, set LDFLAGS rather
# than alter the ${TARGET}: ${OBJECTS} rule
# - to see make's built-in rules use make -p
# target executable name
TARGET = scdaq
# source files
SOURCES = pipeline.cc config.cc DmaInputFilter.cc FileDmaInputFilter.cc InputFilter.cc MicronDmaInputFilter.cc OutputByOrbit.cc OutputBySize.cc OutputFileHandler.cc processor.cc scdaq.cc session.cc slice.cc TcpInputFilter.cc tools.cc WZDmaInputFilter.cc
C_SOURCES = wzdma/wz_dma.c
# work out names of object files from sources
OBJECTS = $(SOURCES:.cc=.o)
OBJECTS += $(C_SOURCES:.c=.o)
TEST_PROGRESS_DIR = test/in_progress
# compiler flags (do not include -c here as it's dealt with by the
# appropriate rules; CXXFLAGS gets passed as part of command
# invocation for both compilation (where -c is needed) and linking
# (where it's not.)
CXXFLAGS = -std=c++11 -Wall -Wextra -Og -g -rdynamic -Wconversion
CFLAGS = $(CXXFLAGS)
LDFLAGS = -Llibmicron -ltbb -ltbbmalloc -lboost_thread -lboost_chrono -lcurl -lpthread -lcrypto
CPPFLAGS = -I. -Iwzdma -Icmssw
# default target (to build all)
all: clean_progress ${TARGET}
clean_progress:
rm -rf ${TEST_PROGRESS_DIR}
TGT_CLEAN_PROG = cleanprogress
# clean target
clean:
rm ${OBJECTS} ${TARGET}
# rule to link object files to create target executable
# $@ is the target, here $(TARGET), and $^ is all the
# dependencies separated by spaces (duplicates removed),
# here ${OBJECTS}
${TARGET}: ${OBJECTS}
${LINK.cc} -o $@ $^ -lmicron
# no rule is needed here for compilation as make already
# knows how to do it
# header dependencies (in more complicated cases, you can
# look into generating these automatically.)
scdaq.o: processor.h OutputBySize.h OutputByOrbit.h format.h server.h controls.h config.h session.h log.h pipeline.h
config.o: config.h log.h
DmaInputFilter.o: DmaInputFilter.h slice.h
FileDmaInputFilter.o: FileDmaInputFilter.h InputFilter.h log.h
InputFilter.o: InputFilter.h log.h
OutputBySize.o: OutputBySize.h slice.h log.h
OutputByOrbit.o: OutputByOrbit.h OutputFileHandler.h slice.h log.h OutputFile.h
OutputFileHandler.o: OutputFileHandler.h log.h OutputFile.h cmssw/FRDFileHeader_v2.h
processor.o: processor.h slice.h format.h log.h bril_histo.h cmssw/FRDEventHeader_V6.h cmssw/FRDFileHeader_v2.h
session.o: session.h log.h
slice.o: slice.h
WZDmaInputFilter.o: WZDmaInputFilter.h InputFilter.h tools.h log.h
TcpInputFilter.o: TcpInputFilter.h InputFilter.h tools.h log.h
wz_dma.o: wzdma/wz_dma.h
MicronDmaInputFilter.o: MicronDmaInputFilter.h
tools.o: tools.h log.h
pipeline.o: pipeline.h
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment