COMM       @(#)$RCSfile: Imakefile,v $ $Revision: 1.8 $ $Date: 2009/10/23 15:34:28 $ CERN IT-PDP/DM   Jean-Philippe Baud
COMM
COMM  Copyright (C) 1990-2008 by CERN/IT/PDP/DM
COMM  All rights reserved
COMM
 
COMM 		Makefile for LFC/DPM includes             GENERIC
 
include FileName(..,VERSION)

TOPINCLUDE=InstallIncludeDir
#if BuildNameServerAsLFC
DESTDIR=FileName($(TOPINCLUDE),lfc)
#else
#if BuildNameServerAsDPNS
DESTDIR=FileName($(TOPINCLUDE),dpm)
#else
DESTDIR=FileName($(TOPINCLUDE),lcgdm)
#endif
#endif
MANPAGES = $(FILMANDIR)/Castor_limits.$(FILMANSUFFIX) \
	   $(LIBMANDIR)/serrno.$(LIBMANSUFFIX)
EXPORTMANPAGES =
ICOMMON_H = \
	 FileName($(DESTDIR),Castor_limits.h) \
	 FileName($(DESTDIR),Cnetdb.h) \
	 FileName($(DESTDIR),osdep.h) \
	 FileName($(DESTDIR),serrno.h) \
	 FileName($(DESTDIR),u64subr.h) \
	 FileName($(DESTDIR),Cgetopt.h) \
	 FileName($(DESTDIR),Cglobals.h) \
	 FileName($(DESTDIR),Cgrp.h) \
	 FileName($(DESTDIR),Cinit.h) \
	 FileName($(DESTDIR),Cmutex.h) \
	 FileName($(DESTDIR),Cpool_api.h) \
	 FileName($(DESTDIR),Cpwd.h) \
	 FileName($(DESTDIR),Cregexp.h) \
	 FileName($(DESTDIR),Cregexp_magic.h) \
	 FileName($(DESTDIR),Csched_api.h) \
	 FileName($(DESTDIR),Csched_flags.h) \
	 FileName($(DESTDIR),Csec_api.h) \
	 FileName($(DESTDIR),Csec_common.h) \
	 FileName($(DESTDIR),Csec_constants.h) \
	 FileName($(DESTDIR),Csnprintf.h) \
	 FileName($(DESTDIR),Cthread_api.h) \
	 FileName($(DESTDIR),Cthread_flags.h) \
	 FileName($(DESTDIR),Cthread_typedef.h) \
	 FileName($(DESTDIR),log.h) \
	 FileName($(DESTDIR),marshall.h) \
	 FileName($(DESTDIR),net.h) \
	 FileName($(DESTDIR),socket_timeout.h) \
	 FileName($(DESTDIR),trace.h)

ECOMMON_H = \
	 $(EXPORTH)/Castor_limits.h \
	 $(EXPORTH)/Cnetdb.h \
	 $(EXPORTH)/osdep.h \
	 $(EXPORTH)/serrno.h \
	 $(EXPORTH)/u64subr.h \
	 $(EXPORTH)/Cgetopt.h \
	 $(EXPORTH)/Cglobals.h \
	 $(EXPORTH)/Cgrp.h \
	 $(EXPORTH)/Cinit.h \
	 $(EXPORTH)/Cmutex.h \
	 $(EXPORTH)/Cpool_api.h \
	 $(EXPORTH)/Cpwd.h \
	 $(EXPORTH)/Cregexp.h \
	 $(EXPORTH)/Cregexp_magic.h \
	 $(EXPORTH)/Csched_api.h \
	 $(EXPORTH)/Csched_flags.h \
	 $(EXPORTH)/Csec_api.h \
	 $(EXPORTH)/Csec_common.h \
	 $(EXPORTH)/Csec_constants.h \
	 $(EXPORTH)/Csnprintf.h \
	 $(EXPORTH)/Cthread_api.h \
	 $(EXPORTH)/Cthread_flags.h \
	 $(EXPORTH)/Cthread_typedef.h \
	 $(EXPORTH)/log.h \
	 $(EXPORTH)/marshall.h \
	 $(EXPORTH)/net.h \
	 $(EXPORTH)/socket_timeout.h \
	 $(EXPORTH)/trace.h

#if BuildNameServerClient || BuildNameServerLibrary
INS_H = \
	 FileName($(DESTDIR),Cns_api.h) FileName($(DESTDIR),Cns_constants.h) \
	 FileName($(DESTDIR),Cns_struct.h)
ENS_H = \
	 $(EXPORTH)/Cns_api.h $(EXPORTH)/Cns_constants.h \
	 $(EXPORTH)/Cns_struct.h
#if BuildNameServerAsLFC
ILFC_H = FileName($(DESTDIR),lfc_api.h)
ELFC_H = $(EXPORTH)/lfc_api.h
#else
#if BuildNameServerAsDPNS
IDPNS_H = FileName($(DESTDIR),dpns_api.h)
EDPNS_H = $(EXPORTH)/dpns_api.h
#endif
#endif
#endif
#if BuildRfioClient
IRFIO_H = \
	  FileName($(DESTDIR),rfcntl.h) FileName($(DESTDIR),rfio.h) \
	  FileName($(DESTDIR),rfio_api.h) FileName($(DESTDIR),rfio_constants.h) \
	  FileName($(DESTDIR),rfio_errno.h)
ERFIO_H = \
	  $(EXPORTH)/rfcntl.h $(EXPORTH)/rfio.h \
	  $(EXPORTH)/rfio_api.h $(EXPORTH)/rfio_constants.h \
	  $(EXPORTH)/rfio_errno.h
#endif
#if BuildDPMClient
IDPM_H = \
	 FileName($(DESTDIR),dpm_api.h) FileName($(DESTDIR),dpm_constants.h) \
	 FileName($(DESTDIR),dpm_struct.h)
EDPM_H = \
	 $(EXPORTH)/dpm_api.h $(EXPORTH)/dpm_constants.h \
	 $(EXPORTH)/dpm_struct.h
#endif

all: patchlevel.h

#if defined(_WIN32)
patchlevel.h: FORCE
	set TIMESTAMP=%DATE%
	sed -e "s/__BASEVERSION__/\"$(VERSION)\"/" -e "s/__PATCHLEVEL__/$(RELEASE)/" -e "s?__TIMESTAMP__?\"$(TIMESTAMP)\"?" patchlevel.in > patchlevel.h
#else
patchlevel.h: FORCE
	sed -e "s/__BASEVERSION__/\"$(VERSION)\"/" -e "s/__PATCHLEVEL__/$(RELEASE)/" -e "s/__TIMESTAMP__/\"`date +%s`\"/" patchlevel.in > patchlevel.h
#endif

install: $(DESTDIR) $(ICOMMON_H) $(IDPM_H) $(IDPNS_H) $(ILFC_H) $(INS_H) $(IRFIO_H)

export:

exportman: $(EXPORTMANPAGES)

exportshr: $(ECOMMON_H) $(EDPM_H) $(EDPNS_H) $(ELFC_H) $(ENS_H) $(ERFIO_H)

InstallNonExecFile(Castor_limits.h,$(DESTDIR),root,bin,644)
IEXPORT(Castor_limits.h,$(EXPORTH),644)

InstallNonExecFile(Cnetdb.h,$(DESTDIR),root,bin,644)
IEXPORT(Cnetdb.h,$(EXPORTH),644)

InstallNonExecFile(Cgetopt.h,$(DESTDIR),root,bin,644)
IEXPORT(Cgetopt.h,$(EXPORTH),644)

InstallNonExecFile(Cglobals.h,$(DESTDIR),root,bin,644)
IEXPORT(Cglobals.h,$(EXPORTH),644)

InstallNonExecFile(Cgrp.h,$(DESTDIR),root,bin,644)
IEXPORT(Cgrp.h,$(EXPORTH),644)

InstallNonExecFile(Cinit.h,$(DESTDIR),root,bin,644)
IEXPORT(Cinit.h,$(EXPORTH),644)

InstallNonExecFile(Cmutex.h,$(DESTDIR),root,bin,644)
IEXPORT(Cmutex.h,$(EXPORTH),644)

InstallNonExecFile(Cpool_api.h,$(DESTDIR),root,bin,644)
IEXPORT(Cpool_api.h,$(EXPORTH),644)

InstallNonExecFile(Cpwd.h,$(DESTDIR),root,bin,644)
IEXPORT(Cpwd.h,$(EXPORTH),644)

InstallNonExecFile(Cregexp.h,$(DESTDIR),root,bin,644)
IEXPORT(Cregexp.h,$(EXPORTH),644)

InstallNonExecFile(Cregexp_magic.h,$(DESTDIR),root,bin,644)
IEXPORT(Cregexp_magic.h,$(EXPORTH),644)

InstallNonExecFile(Csched_api.h,$(DESTDIR),root,bin,644)
IEXPORT(Csched_api.h,$(EXPORTH),644)

InstallNonExecFile(Csched_flags.h,$(DESTDIR),root,bin,644)
IEXPORT(Csched_flags.h,$(EXPORTH),644)

InstallNonExecFile(Csec_api.h,$(DESTDIR),root,bin,644)
IEXPORT(Csec_api.h,$(EXPORTH),644)

InstallNonExecFile(Csec_common.h,$(DESTDIR),root,bin,644)
IEXPORT(Csec_common.h,$(EXPORTH),644)

InstallNonExecFile(Csec_constants.h,$(DESTDIR),root,bin,644)
IEXPORT(Csec_constants.h,$(EXPORTH),644)

InstallNonExecFile(Csnprintf.h,$(DESTDIR),root,bin,644)
IEXPORT(Csnprintf.h,$(EXPORTH),644)

InstallNonExecFile(Cthread_api.h,$(DESTDIR),root,bin,644)
IEXPORT(Cthread_api.h,$(EXPORTH),644)

InstallNonExecFile(Cthread_flags.h,$(DESTDIR),root,bin,644)
IEXPORT(Cthread_flags.h,$(EXPORTH),644)

InstallNonExecFile(Cthread_typedef.h,$(DESTDIR),root,bin,644)
IEXPORT(Cthread_typedef.h,$(EXPORTH),644)

InstallNonExecFile(log.h,$(DESTDIR),root,bin,644)
IEXPORT(log.h,$(EXPORTH),644)

InstallNonExecFile(marshall.h,$(DESTDIR),root,bin,644)
IEXPORT(marshall.h,$(EXPORTH),644)

InstallNonExecFile(net.h,$(DESTDIR),root,bin,644)
IEXPORT(net.h,$(EXPORTH),644)

InstallNonExecFile(socket_timeout.h,$(DESTDIR),root,bin,644)
IEXPORT(socket_timeout.h,$(EXPORTH),644)

InstallNonExecFile(trace.h,$(DESTDIR),root,bin,644)
IEXPORT(trace.h,$(EXPORTH),644)

InstallNonExecFile(Cns_api.h,$(DESTDIR),root,bin,644)
IEXPORT(Cns_api.h,$(EXPORTH),644)

InstallNonExecFile(Cns_constants.h,$(DESTDIR),root,bin,644)
IEXPORT(Cns_constants.h,$(EXPORTH),644)

InstallNonExecFile(Cns_struct.h,$(DESTDIR),root,bin,644)
IEXPORT(Cns_struct.h,$(EXPORTH),644)

InstallNonExecFile(dpm_api.h,$(DESTDIR),root,bin,644)
IEXPORT(dpm_api.h,$(EXPORTH),644)

InstallNonExecFile(dpm_constants.h,$(DESTDIR),root,bin,644)
IEXPORT(dpm_constants.h,$(EXPORTH),644)

InstallNonExecFile(dpm_struct.h,$(DESTDIR),root,bin,644)
IEXPORT(dpm_struct.h,$(EXPORTH),644)

InstallNonExecFile(dpns_api.h,$(DESTDIR),root,bin,644)
IEXPORT(dpns_api.h,$(EXPORTH),644)

InstallNonExecFile(lfc_api.h,$(DESTDIR),root,bin,644)
IEXPORT(lfc_api.h,$(EXPORTH),644)

InstallNonExecFile(osdep.h,$(DESTDIR),root,bin,644)
IEXPORT(osdep.h,$(EXPORTH),644)

InstallNonExecFile(rfcntl.h,$(DESTDIR),root,bin,644)
IEXPORT(rfcntl.h,$(EXPORTH),644)

InstallNonExecFile(rfio.h,$(DESTDIR),root,bin,644)
IEXPORT(rfio.h,$(EXPORTH),644)

InstallNonExecFile(rfio_api.h,$(DESTDIR),root,bin,644)
IEXPORT(rfio_api.h,$(EXPORTH),644)

InstallNonExecFile(rfio_constants.h,$(DESTDIR),root,bin,644)
IEXPORT(rfio_constants.h,$(EXPORTH),644)

InstallNonExecFile(rfio_errno.h,$(DESTDIR),root,bin,644)
IEXPORT(rfio_errno.h,$(EXPORTH),644)

InstallNonExecFile(serrno.h,$(DESTDIR),root,bin,644)
IEXPORT(serrno.h,$(EXPORTH),644)

InstallNonExecFile(u64subr.h,$(DESTDIR),root,bin,644)
IEXPORT(u64subr.h,$(EXPORTH),644)

MakeDir($(DESTDIR),root,bin,0755)

install.man: $(FILMANDIR) $(LIBMANDIR) $(MANPAGES)

MakeDir($(FILMANDIR),root,bin,0755)
MakeDir($(LIBMANDIR),root,bin,0755)

FILTERMANPAGE(Castor_limits,Castor_limits,$(FILMANDIR),$(FILMANSUFFIX))
FILTERMANPAGE(serrno,serrno,$(LIBMANDIR),$(LIBMANSUFFIX))
EMANPAGE(Castor_limits,$(EXPORTMAN)/man4,$(FILMANSUFFIX))
EMANPAGE(serrno,$(EXPORTMAN)/man3,$(LIBMANSUFFIX))

clean:
	@echo cleaning in CurDir
	-@RemoveFiles(FilesToClean)

clobber:        clean
	@echo clobbering in CurDir

Makefiles:

FORCE:
