File:  [EPICS Repository] / base / configure / RULES_FILE_TYPE
Revision 1.5: download - view: text, annotated - select for diffs
Tue May 5 22:02:04 2009 UTC (8 years, 7 months ago) by anj
Branches: MAIN
CVS tags: HEAD
Sync to R3.14. branch.

#*************************************************************************
# Copyright (c) 2006 UChicago Argonne LLC, as Operator of Argonne
#     National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
#     Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in the file LICENSE that is included with this distribution. 
#*************************************************************************
# $Id: RULES_FILE_TYPE,v 1.5 2009/05/05 22:02:04 anj Exp $
#

#---------------------------------------------------------------
# Include <top>/configure/RULES_BUILD definitions from tops defined in RELEASE* files
#
RELEASE_RULES_BUILDS = $(foreach top, $(RELEASE_TOPS), $(wildcard $($(top))/configure/RULES_BUILD))
ifneq ($(RELEASE_RULES_BUILDS),)
  include $(RELEASE_RULES_BUILDS)
endif

#---------------------------------------------------------------
# Include <top>/cfg/RULES* definitions from tops defined in RELEASE* files
#
RELEASE_CFG_RULES = $(foreach top, $(RELEASE_TOPS), $(wildcard $($(top))/cfg/RULES*))
ifneq ($(RELEASE_CFG_RULES),)
  include $(RELEASE_CFG_RULES)
endif

#---------------------------------------------------------------
# If this is not BASE then include TOP/configure/RULES_BUILD definitions
#
ifeq ($(wildcard $(TOP)/configure/CONFIG_BASE_VERSION),)
TOP_RULES_BUILDS = $(wildcard $(TOP)/configure/RULES_BUILD)
ifneq ($(TOP_RULES_BUILDS),)
  include $(TOP_RULES_BUILDS)
endif
endif

#---------------------------------------------
# Include existing and new $(INSTALL_CFG)/* definitions
#
TOP_CFG_FILES = $(sort $(wildcard $(INSTALL_CFG)/RULES*) \
                       $(wildcard $(INSTALL_CFG)/CONFIG*) \
                       $(addprefix $(INSTALL_CFG)/,$(CFG)))
ifneq ($(TOP_CFG_FILES),)
  include $(TOP_CFG_FILES)
endif

#---------------------------------------------------------------

define FILE_TYPE_template

$(1) += $$(if $$(strip $$($(1)_$$(OS_CLASS))),$$(subst -nil-,,$$($(1)_$$(OS_CLASS))), $$($(1)_DEFAULT))

INSTALLS_$(1) = $$($(1):%=$$(INSTALL_$(1))/%)

$$(INSTALL_$(1))/%: ../%
	$(ECHO) "Installing $(1) file $$@"
	@$$(INSTALL) -d -m  $$(INSTALL_PERMISSIONS) $$< $$(dir $$@)

$$(INSTALL_$(1))/%: %
	$(ECHO) "Installing $(1) file $$@"
	@$$(INSTALL) -d -m  $$(INSTALL_PERMISSIONS) $$< $$(dir $$@)

buildInstall : $$(INSTALLS_$(1))

endef

$(foreach type, $(FILE_TYPE),$(eval $(call FILE_TYPE_template,$(strip $(type)))))
#---------------------------------------------

clean::
	@$(RM) $(foreach type, $(FILE_TYPE), $($(type)))


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>