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 libBDebug libTms
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")
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

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}"

buildPacakages:
	yum install da8150 fftw-devel pciutils-devel
	
################################################################################
#	RPM package builds
################################################################################
#

#rpms:	clean tms.spec
rpms:	tms.spec
	tar -czC .. -f ${RPM_DIR}/SOURCES/tms.tar.gz --exclude .svn tms
	rpmbuild -ba -D "version $(VERSION)" -D "release $(RELEASE)" tms.spec 

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

rpms-rh7:	clean tms-client.spec
	tar -czC .. -f ${RPM_DIR}/SOURCES/tms.tar.gz --exclude .svn tms
	rpmbuild -ba tms-client.spec 

################################################################################
#	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 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;