Skip to content
Snippets Groups Projects
Commit ff780fa5 authored by mooney's avatar mooney
Browse files

*** empty log message ***

parent 81cf6f10
No related branches found
No related tags found
No related merge requests found
#CONFIG
# Add any changes to make rules here
#CROSS_COMPILER_TARGET_ARCHS = mv167
#CONFIG_APP
include $(TOP)/config/RELEASE
-include $(TOP)/config/RELEASE.$(HOST_ARCH)
include $(EPICS_BASE)/config/CONFIG
INSTALL_LOCATION = $(TOP)
ifdef INSTALL_LOCATION_APP
INSTALL_LOCATION = $(INSTALL_LOCATION_APP)
endif
ifdef T_A
-include $(TOP)/config/O.$(T_A)/CONFIG_APP_INCLUDE
endif
# Where to install databases
INSTALL_DB = $(INSTALL_LOCATION)/db
# dbst based database optimization (default: NO)
DB_OPT = NO
# May be overridden if not all databases should be installed
INSTALLDB = $(DB)
include $(TOP)/config/CONFIG
#
# Makefile,v 1.1.2.1 1999/07/15 19:55:30 jba Exp
#
TOP=..
include $(TOP)/config/CONFIG_APP
include $(TOP)/config/RULES_ARCHS
#
# Makefile.Host,v 1.1.2.2 1999/07/30 21:16:06 lange Exp
#
TOP=../..
include $(TOP)/config/CONFIG_APP
TARGETS = CONFIG_APP_INCLUDE
include $(TOP)/config/RULES.Host
inc:: $(TARGETS)
ifeq ($(wildcard $(TOP)/config/RELEASE.$(HOST_ARCH)),$(TOP)/config/RELEASE.$(HOST_ARCH))
CONFIG_APP_INCLUDE: $(TOP)/config/RELEASE.$(HOST_ARCH)
endif
CONFIG_APP_INCLUDE: $(TOP)/config/RELEASE $(TOP)/config/CONFIG_APP
$(RM) $@
@$(PERL) $(TOP)/config/makeConfigAppInclude.pl $(T_A) $@ $(TOP)
#
# Makefile.Vx,v 1.1.2.2 1999/07/30 21:16:06 lange Exp
#
TOP=../..
include $(TOP)/config/CONFIG_APP
TARGETS = CONFIG_APP_INCLUDE
include $(TOP)/config/RULES.Vx
inc:: $(TARGETS)
ifeq ($(wildcard $(TOP)/config/RELEASE.$(HOST_ARCH)),$(TOP)/config/RELEASE.$(HOST_ARCH))
CONFIG_APP_INCLUDE: $(TOP)/config/RELEASE.$(HOST_ARCH)
endif
CONFIG_APP_INCLUDE: $(TOP)/config/RELEASE $(TOP)/config/CONFIG_APP
$(RM) $@
@$(PERL) $(TOP)/config/makeConfigAppInclude.pl $(T_A) $@ $(TOP)
# RELEASE - Location of external products
#
# (Architecture dependent declarations should go into RELEASE.<arch>)
#
# Note: This file will be scanned to automatically generate
# include path definitions etc.
# The order of the following declarations will be retained
# within those definitions.
#
# Add your declarations here
SUPPORT=!!Set to <supporttop> complete pathname!!
include $(SUPPORT)/config/IP_RELEASE
include $(SUPPORT)/config/IP330_RELEASE
include $(SUPPORT)/config/CAMAC_RELEASE
include $(SUPPORT)/config/MCA_RELEASE
include $(SUPPORT)/config/LOVE_RELEASE
include $(SUPPORT)/config/IPUNIDIG_RELEASE
include $(SUPPORT)/config/DAC128V_RELEASE
include $(SUPPORT)/config/MOTOR_RELEASE
include $(SUPPORT)/config/STD_RELEASE
include $(SUPPORT)/config/BITBUS_RELEASE
include $(SUPPORT)/config/MPFGPIB_RELEASE
include $(SUPPORT)/config/MPFSERIAL_RELEASE
include $(SUPPORT)/config/MPF_RELEASE
include $(SUPPORT)/config/RELEASE
TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top
# RULES.Db,v 1.9.6.4 2001/08/20 16:36:50 jba Exp
#
# Rules for making things related to databases
#
MAKEBPT = $(EPICS_BASE_HOST_BIN)/makeBpt$(EXE)
DBLOADTEMPLATE = $(EPICS_BASE_HOST_BIN)/dbLoadTemplate$(EXE)
DBEXPAND = $(EPICS_BASE_HOST_BIN)/dbExpand$(EXE)
DBST = dbst
MAKEDBDEPENDS = $(PERL) $(TOP)/config/makeDbDepends.pl
REPLACEVAR = $(PERL) $(TOP)/config/replaceVAR.pl
ifndef WIN32
TOUCH = touch
else
TOUCH = type NUL >>
endif
#-----------------------------------------------------------------
# if we are not building base add base dbd dirs
ifneq ($(EPICS_BASE),$(TOP))
ifneq ($(EPICS_BASE),$(INSTALL_LOCATION))
EPICS_DBDFLAGS += -I $(EPICS_BASE)/dbd
endif
endif
#---------------------------------------------------------------
# ----------------------------------------------------
# create names (lists) for installed things
# ----------------------------------------------------
INSTALL_BPTS = $(BPTS:%= $(INSTALL_DBD)/%)
INSTALL_DBDS = $(DBDINSTALL:%= $(INSTALL_DBD)/%)
INSTALL_DBDNAME = $(DBDNAME:%= $(INSTALL_DBD)/%)
INSTALL_DATA = $(INSTALLDB:%=$(INSTALL_DB)/%)
INSTALL_TEMPLATES = $(filter %.template,$(INSTALL_DATA))
#---------------------------------------------------------------
# Main targets
all:: install
inc:: $(INSTALL_DBDS) $(INSTALL_BPTS) $(INSTALL_TEMPLATES)
rebuild:: clean install
install:: inc buildInstall
buildInstall:: build $(INSTALL_DATA)
depends::
clean::
@echo "Cleaning"
@$(RM) $(DB) $(DBDNAME) *.template *.substitutions *.db.raw \
*.db-stamp *.edf esiread.cnf
##################################################### "Foreign" templates
TEMPLATE_LINKS = $(filter-out $(notdir $(USES_TEMPLATE)), $(USES_TEMPLATE))
TEMPLATE_FILES = $(filter $(notdir $(USES_TEMPLATE)), $(USES_TEMPLATE))
DB_STAMP = $(patsubst %.db, %.db-stamp, $(DB))
DB_REALTARGET = $(patsubst %.db-stamp, %.db, $@)
ifneq '$(TEMPLATE_LINKS)' ''
build:: $(notdir $(TEMPLATE_LINKS))
endif
build:: $(INSTALL_DBDNAME) $(TEMPLATE_FILES) $(DB_STAMP)
$(notdir $(TEMPLATE_LINKS)): %.template:
ifndef WIN32
@$(RM) $(notdir $(TEMPLATE_LINKS))
ln -s $(TEMPLATE_LINKS) .
# Workaround for dbLoadTemplate bug: terminate here if link target doesn't exist
@cat $(TEMPLATE_LINKS) > /dev/null
else
@$(RM) $(notdir $(TEMPLATE_LINKS))
$(CP) $(TEMPLATE_LINKS) .
endif
##################################################### Inflated or plain databases
$(INSTALL_DB)/%.db: %.db-stamp
@echo "Installing database $@"
@$(INSTALL) -d -m 644 $(patsubst %.db-stamp, %.db, $<) $(@D)
# Must have DBDNAME defined to use dbst optimization
ifndef DBDNAME
DB_OPT = NO
endif
# dbst based database optimization
ifeq '$(DB_OPT)' 'YES'
.PRECIOUS: %.db.raw
%.db-stamp: %.db.raw $(INSTALL_DBD)/$(DBDNAME)
@echo "Optimizing database $@"
$(DBST) $(INSTALL_DBD)/$(DBDNAME) $< -d > $(DB_REALTARGET)
@$(TOUCH) $@
%.db-stamp: %.t.db.raw $(INSTALL_DBD)/$(DBDNAME)
@echo "Optimizing database $@"
$(DBST) $(INSTALL_DBD)/$(DBDNAME) $< -d > $(DB_REALTARGET)
@$(TOUCH) $@
else
# NO optimization => move it and keep a stamp
%.db-stamp: %.db.raw
@$(MV) $< $(DB_REALTARGET)
@$(TOUCH) $@
@$(TOUCH) $<
%.db-stamp: %.t.db.raw
@$(MV) $< $(DB_REALTARGET)
@$(TOUCH) $@
@$(TOUCH) $<
endif
%.t.db.raw: %.substitutions
@echo "Inflating database from $<"
@$(RM) $@
@$(DBLOADTEMPLATE) $< > $@
##################################################### CapFast filter
%.edf:: ../%.sch $(DEPSCHS)
@if [ ! -f cad.rc -a -r ../cad.rc ] ; then ln -s ../cad.rc ; fi
$(SCH2EDIF) $(SCH2EDIF_SYSFLAGS) $(SCH2EDIF_FLAGS) $<
##################################################### Substitution files
$(INSTALL_DB)/%.substitutions: %.substitutions
@echo "Installing $@"
@$(INSTALL) -d -m 644 $(@F) $(@D)
%.substitutions:: ../%.substitutions
@$(CP) $< $@
ifdef CREATESUBSTITUTIONS
%.substitutions:: $(word $(words $(CREATESUBSTITUTIONS)),$(CREATESUBSTITUTIONS))
@$(CREATESUBSTITUTIONS) $*
endif
# Better make it PRECIOUS (to get around make bug)
.PRECIOUS: %.substitutions
##################################################### Template databases
# Installed template files (dbLoadTemplate() on IOC side)
$(INSTALL_DB)/%.template: %.template
@echo "Installing $@"
@$(INSTALL) -d -m 644 $(@F) $(@D)
%.template:: ../%.template
@$(CP) $< $@
%.template: %.edf
$(E2DB) $(E2DB_SYSFLAGS) $(E2DB_FLAGS) -n $@.VAR $<
@$(REPLACEVAR) < $@.VAR > $@
@$(RM) $@.VAR
##################################################### Flat databases
%.db.raw:: ../%.db
$(CP) $< $@
%.db.raw: %.edf
$(E2DB) $(E2DB_SYSFLAGS) $(E2DB_FLAGS) -n $@.VAR $<
@$(REPLACEVAR) < $@.VAR > $@
@$(RM) $@.VAR
##################################################### DBD stuff
$(INSTALL_DBD)/%: %
@echo "Installing $@"
@$(INSTALL) -d -m 644 $< $(@D)
$(INSTALL_DBD)/%:: ../%
@echo "Installing $@"
@$(INSTALL) -d -m 644 $< $(@D)
bpt%.dbd: bpt%.data
$(RM) $@
$(MAKEBPT) $<
bpt%.dbd:: ../bpt%.data
$(RM) $@
$(MAKEBPT) $<
# Patch for old applications
ifdef USER_DBDFLAGS
DBDFLAGS = $(USER_DBDFLAGS)
endif
ifdef DBDEXPAND
$(DBDNAME): ../$(DBDEXPAND)
@echo "Expanding dbd"
@$(RM) $@
$(DBEXPAND) $(DBDFLAGS) $< > $@
endif
##################################################### Dependencies
DEPENDS: $(filter $(patsubst %.db, %.substitutions, $(DB)), $(wildcard *.substitutions))
@$(MAKEDBDEPENDS) $^
-include DEPENDS
#RULES.Host
include $(EPICS_BASE)/config/RULES.Host
#RULES.Vx
include $(EPICS_BASE)/config/RULES.Vx
inc:: $(INSTALL_INCREC)
#
# turn off implicit rules search for all binaries in base
#
#Jeff says this turned off all dependency checking
#????? What to do????
#$(EPICS_BASE_BIN)/* : ;
# Library should be rebuilt because LIBOBJS may have changed.
$(LIBNAME): ../Makefile.Vx
#RULES.ioc
include $(EPICS_BASE)/config/RULES_DIRS
buildInstall:: cdCommands
cdCommands: Makefile
$(PERL) $(TOP)/config/makeIocCdCommands.pl $(ARCH)
clean::
@$(RM) cdCommands
#RULES.iocBoot
DIRS += $(wildcard ioc*)
DIRS += $(wildcard as*)
include $(EPICS_BASE)/config/RULES_DIRS
#RULES_ARCHS
include $(EPICS_BASE)/config/RULES_ARCHS
#RULES_DIRS
include $(EPICS_BASE)/config/RULES_DIRS
#RULES_TOP
include $(EPICS_BASE)/config/RULES_TOP
uninstall::
@$(RMDIR) $(INSTALL_DB)
# makeConfigAppInclude.pl,v 1.1.2.3 1999/07/30 21:14:18 lange Exp
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # makeConfigAppInclude.pl
use Cwd;
$arch = $ARGV[0];
$outfile = $ARGV[1];
$top = $ARGV[2];
# Get the absolute path name of $(TOP)
$savedir = Cwd::getcwd();
Cwd::chdir($top);
$top_abs = Cwd::getcwd();
Cwd::chdir($savedir);
# Add TOP to macro list.
$applications{TOP} = $top_abs;
unlink("${outfile}");
open(OUT,">${outfile}") or die "$! opening ${outfile}";
print OUT "#Do not modify this file.\n";
print OUT "#This file is created during the build.\n";
@files =();
push(@files,"$top/config/RELEASE");
push(@files,"$top/config/RELEASE.${arch}");
foreach $file (@files) {
if (-r "$file") {
open(IN, "$file") or die "Cannot open $file\n";
while ($line = <IN>) {
next if ( $line =~ /\s*#/ );
chomp($line);
$_ = $line;
($prefix,$macro,$post) = /(.*)\s* \s*\$\((.*)\)(.*)/;
#test for "include" command
if ($prefix eq "include") {
if ($macro eq "") {
# true if no macro is present
#the following looks for
#prefix = post
($prefix,$post) = /(.*)\s* \s*(.*)/;
}
else
{
$base = $applications{$macro};
if ($base eq "")
{
#print "error: $macro was not previously defined\n";
}
else
{
$post = $base . $post;
}
}
push(@files,"$post")
}
else {
#the following looks for
# prefix = $(macro)post
($prefix,$macro,$post) = /(.*)\s*=\s*\$\((.*)\)(.*)/;
if ($macro eq "") { # true if no macro is present
# the following looks for
# prefix = post
($prefix,$post) = /(.*)\s*=\s*(.*)/;
} else {
$base = $applications{$macro};
if ($base eq "") {
#print "error: $macro was not previously defined\n";
} else {
$post = $base . $post;
}
}
$prefix =~ s/^\s+|\s+$//g; # strip leading and trailing whitespace.
$applications{$prefix} = $post;
if ( -d "$post") { #check that directory exists
print OUT "\n";
if ( -d "$post/bin/$arch") { #check that directory exists
print OUT "${prefix}_BIN = $post/bin/${arch}\n";
}
if ( -d "$post/lib/$arch") { #check that directory exists
print OUT "${prefix}_LIB = $post/lib/${arch}\n";
}
if ( -d "$post/include") { #check that directory exists
print OUT "EPICS_INCLUDES += -I$post/include\n";
}
if ( -d "$post/dbd") { #check that directory exists
print OUT "EPICS_DBDFLAGS += -I $post/dbd\n";
}
}
}
}
close IN;
}
}
close OUT;
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # makeDbDepends.pl
# Called from within the object directory.
# Searches the .substitutions files (from the command line) for
# "file xxx {" entries to create a .DEPENDS file
open(OUT, ">.DEPENDS") or die "Cannot open .DEPENDS: $!";
foreach $file (@ARGV) {
open(IN, "<$file") or die "Cannot open $file: $!";
@substfile = <IN>;
close IN or die "Cannot close $file: $!";
@depends = grep { s/^\s*file\s*(.*)\s*\{.*$/\1/ } @substfile;
chomp @depends;
if (@depends) {
$file =~ s/\.substitutions/\.t.db.raw/;
print OUT "${file}:: @depends\n";
}
}
close OUT or die "Cannot close $file: $!";
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # makeIocCdCommands.pl
use Cwd;
$cwd = cwd();
#hack for sun4
$cwd =~ s|/tmp_mnt||;
$arch = $ARGV[0];
unlink("cdCommands");
open(OUT,">cdCommands") or die "$! opening cdCommands";
print OUT "startup = \"$cwd\"\n";
#appbin is kept for compatibility with 3.13.1
$appbin = $cwd;
$appbin =~ s/iocBoot.*//;
$appbin = $appbin . "/bin/${arch}";
print OUT "appbin = \"$appbin\"\n";
$top = $cwd;
$top =~ s/\/iocBoot.*//;
print OUT "top = \"$top\"\n";
$topbin = "${top}/bin/${arch}";
#skip check that top/bin/${arch} exists; src may not have been builT
print OUT "topbin = \"$topbin\"\n";
# Add TOP to macro list.
$applications{TOP} = $top;
@files =();
push(@files,"$top/config/RELEASE");
foreach $file (@files) {
if (-r "$file") {
open(IN, "$file") or die "Cannot open $file\n";
while ($line = <IN>) {
next if ( $line =~ /\s*#/ );
chomp($line);
$_ = $line;
($prefix,$macro,$post) = /(.*)\s* \s*\$\((.*)\)(.*)/;
#test for "include" command
if ($prefix eq "include") {
if ($macro eq "") {
# true if no macro is present
#the following looks for
#prefix = post
($prefix,$post) = /(.*)\s* \s*(.*)/;
}
else {
$base = $applications{$macro};
if ($base eq "") {
#print "error: $macro was not previously defined\n";
}
else {
$post = $base . $post;
}
}
push(@files,"$post")
}
else {
#the following looks for
# prefix = $(macro)post
($prefix,$macro,$post) = /(.*)\s*=\s*\$\((.*)\)(.*)/;
if ($macro eq "") { # true if no macro is present
# the following looks for
# prefix = post
($prefix,$post) = /(.*)\s*=\s*(.*)/;
} else {
$base = $applications{$macro};
if ($base eq "") {
#print "error: $macro was not previously defined\n";
} else {
$post = $base . $post;
}
}
$prefix =~ s/^\s+|\s+$//g; # strip leading and trailing whitespace.
$applications{$prefix} = $post;
$app = lc($prefix);
if ( -d "$post") { #check that directory exists
print OUT "$app = \"$post\"\n";
}
if ( -d "$post/bin/$arch") { #check that directory exists
print OUT "${app}bin = \"$post/bin/$arch\"\n";
}
}
}
close IN;
}
}
close OUT;
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # replaceVAR.pl
# Called from within the object directory
# Replaces VAR(xxx) with $(xxx)
# and VAR_xxx_ with $(xxx)
while (<STDIN>) {
s/VAR\(/\$\(/g;
s/VAR_([^_]*)_/\$\($1\)/g;
print;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment