RSS Git Download  Clone
Raw Blame History
################################################################################
#	Master Makefile for TMS Sources
#				T.Barnaby,	BEAM Ltd,	2006-12-07
#				updated by	D.Korchagin,	CERN AB-BI-SW,	2007-08-31
################################################################################
#

TOP	= .

include ${TOP}/Makefile.config

LDIRS	= beam libTms
#LDIRS	+= libBDebug
SDIRS	= tmsExamples tmsControl
DDIRS	= 
ADIRS	= $(LDIRS) $(SDIRS) $(DDIRS)

# Build System Settings
ifeq ("$(BUILD)", "CLIENT")
SDIRS	+= config tmsSigGen tmsStateGen tmsControlGui tmsDevTest tmsTestData
DDIRS	+= datasrc
endif
ifeq ("$(BUILD)", "FULL")
LDIRS	+= admxrc
SDIRS	+= config tmsSigGen tmsStateGen tmsControlGui tmsDevTest tmsTestData
SDIRS	+= tmsPuServer tmsServer tmsWeb
SDIRS	+= tmsWatchdog
DDIRS	+= datasrc
endif

SRC_LIB 	= tms/Readme tms/Makefile tms/Makefile.config tms/include tms/lib/$(CPU)
SRC_LIB 	+= tms/beam tms/libTms
SRC_LIB 	+= tms/tmsExamples tms/tmsControl
SRC_CLIENT	= $(SRC_LIB) tms/config tms/tmsSigGen tms/tmsStateGen
SRC_CLIENT	+= tms/tmsControlGui tms/tmsDevTest tms/datasrc tms/tmsTestData
SRC_MAIN	= $(SRC_CLIENT) tms/tmsPuServer tms/tmsServer tms/tmsWeb

SVNDIRS	= build $(LDIRS) $(SDIRS) $(DDIRS)
SVNROOT	= file:///src/cern/SVN/tms

.PHONY: all install clean includes #depend
.PHONY: fresh checkout commit svnrelease svntag svnimport

all:	info
	@(for f in $(ADIRS); do if !(make -C $$f all); then break; fi; done)

install:
	@for f in $(ADIRS); do if ! (make -C $$f install); then break; fi; done
	cp Makefile Makefile.config $(DEST_DIR)/$(PREFIX)
	cp $(CPFLAGS) tmsExamples $(DEST_DIR)/$(PREFIX)
	 
clean:
	@(for f in $(ADIRS); do (make -C $$f clean); done)
	rm -f tms-*.tar.gz

cleanAll: clean
	rm -fr include/* lib/* lib64/*

includes:
	@(for f in $(ADIRS); do (make -C $$f includes); done)

depend:
	@(for f in $(ADIRS); do (make -C $$f depend); done)

fresh:
	make clean includes all #depend all

buildFiles:
	cp $(CPFLAGS) Makefile Makefile.config tms.spec tms-client.spec Readme build

info:
	echo "Build: ${BUILD}"
	echo "Target: ${TARGET}"

buildPackages:
	yum install glibc-devel.${ARCH} libgcc.${ARCH} libstdc++-devel.${ARCH} fftw-devel.${ARCH} pciutils-devel.${ARCH} qt3-devel.${ARCH}
	#yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 pciutils-devel.i686
	#yum install da8150
	
################################################################################
#	RPM package builds
################################################################################
#

rpms:	tms.spec
	tar -czC .. -f ${RPM_DIR}/SOURCES/tms.tar.gz --exclude .svn tms
	rpmbuild --target=${ARCH} -ba -D "version $(VERSION)" -D "release $(RELEASE_RPM)" tms.spec 

rpmsInstall:
	cp ${RPM_DIR}/RPMS/${ARCH}/tms-*$(VERSION)-$(RELEASE_RPM).${ARCH}.rpm ${DIST_DIR}/${ARCH}/packages
	cp tms.repo ${DIST_DIR}
	cp tms.repo ${DIST_DIR}/${ARCH}/packages
	createrepo ${DIST_DIR}/${ARCH}
	

################################################################################
#	Source package builds
################################################################################
#
tms-main-src:
	tar -czf tms-main-src-$(VERSION).tar.gz --exclude .svn  -C .. ${SRC_MAIN}

tms-client-src:
	tar -czf tms-client-$(VERSION).tar.gz --exclude .svn -C .. ${SRC_CLIENT}

tms-lib-src:
	tar -czf tms-lib-src-$(VERSION).tar.gz --exclude .svn -C .. ${SRC_LIB}

svnSetup:
#	svnadmin create --fs-type fsfs /src/cern/SVN
#	svn mkdir -m "First import." $(SVNROOT) $(SVNROOT)/design $(SVNROOT)/releases

svnImportAll:
#	for f in $(SVNDIRS); do\
#		(echo Dir: $$f;\
#		svn mkdir -m "First import." $(SVNROOT)/$$f $(SVNROOT)/$$f/trunk $(SVNROOT)/$$f/tags $(SVNROOT)/$$f/branches;\
#		svn import -m "First import." $$f $(SVNROOT)/$$f/trunk); done;

svnImport:
	(dir="tmsWatchdog";\
		echo Dir: $$dir;\
		svn mkdir -m "First import." $(SVNROOT)/$$dir $(SVNROOT)/$$dir/trunk $(SVNROOT)/$$dir/tags $(SVNROOT)/$$dir/branches;\
		svn import -m "First import." $$dir $(SVNROOT)/$$dir/trunk );
		
svnCheckoutAll:
	for f in $(SVNDIRS); do (svn checkout $(SVNROOT)/$$f/trunk $$f); done;

svnList:
	svn list $(SVNROOT)

svnListReleases:
	svn list $(SVNROOT)/releases

svnCommit:
	for f in $(SVNDIRS); do (echo Dir: $$f; cd $$f; svn commit); done;

svnRelease:
	svn copy  -m "Release - $(VERSION)" $(SVNROOT)/trunk $(SVNROOT)/releases/release-${VERSION}

svnReleaseOld:
#	svn mkdir $(SVNROOT)/releases/release-$(VERSION) -m "Release"
#	for f in $(SVNDIRS); do (svn copy  -m "Release" $(SVNROOT)/$$f $(SVNROOT)/releases/release-${VERSION}); done;

svnDiff:
	for f in $(SVNDIRS); do (echo Dir: $$f; cd $$f; svn diff); done;

svnUpdate:
	for f in $(SVNDIRS); do (echo Dir: $$f; cd $$f; svn update); done;