################################################################################
# Master Makefile for tms-mcsys source
# T.Barnaby, BEAM Ltd, 2024-08-16
################################################################################
#
# This currently only creates the rootfs image for the TMS module controllers from an old RPM.
# It was originally used to build this system and could be modified to do this now although
# the source would need to be updated for the latest compiler tools etc.
# Note that some of Cern's TMS systems have only i686 capable CPU's so needs to be built for the i686.
#
#
# Normal build is (as root):
# make rpms
#
TOP = ${shell pwd}
srcDir = ${shell pwd}
include Makefile.config
SVNROOT = file:///src/cern/SVN/tms-mcsys
DESTDIR = ${srcDir}/rootfs
DISTDIR = /dist/tms
all: rootfsAll kernelAll admxrcAll
image-from-rpm:
# Create tar image of original RPM
mkdir -p image-tmp
(cd image-tmp; rpm2cpio /dist/tms/i686/packages/tms-mcsys-2.1.0-2.beam.i686.rpm | cpio -idm)
tar -C image-tmp -czf images/tms-mcsys-2.1.0-2.beam.tar.gz .
rm -fr image-tmp
init:
mkdir -p rootfs-build rootfs kernel
config: init rootfsConfig kernelConfig admxrcConfig
install: rootfsInstall kernelInstall kernelModulesInstall admxrcInstall nfsBootInstall
clean: admxrcClean
rm -fr rootfs-build rootfs var kernel
rm -f networkBoot/initrd.img
rpms: tms-mcsys.spec
tar -czC .. -f ${rpmDir}/SOURCES/tms-mcsys.tar.gz tms-mcsys
rpmbuild --target=${arch} -bb -D "version ${version}" -D "release ${release}" tms-mcsys.spec
rpmsInstall:
cp ${rpmDir}/RPMS/${arch}/tms-mcsys-${version}-${release}*.${arch}.rpm ${DISTDIR}/packages
createrepo ${DISTDIR}
svnRelease:
svn copy -m "Release - ${version}-${release}" $(SVNROOT)/trunk $(SVNROOT)/tags/release-${version}-${release}
# Debug bits
sysBootInstall:
cp -a var/lib/tftpboot/tms-mcsys /var/lib/tftpboot
sysRootInstall:
cp -a rootfs /usr/tms
include Makefile.sys