improve build system
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
# If you are not using the PSI build environment, this file can be removed.
|
|
||||||
ifeq ($(wildcard /ioc/tools/driver.makefile),)
|
ifeq ($(wildcard /ioc/tools/driver.makefile),)
|
||||||
|
$(info If you are not using the PSI build environment, GNUmakefile can be removed.)
|
||||||
include Makefile
|
include Makefile
|
||||||
else
|
else
|
||||||
include /ioc/tools/driver.makefile
|
include /ioc/tools/driver.makefile
|
||||||
@ -31,6 +31,11 @@ HEADERS += StreamError.h
|
|||||||
|
|
||||||
StreamCore.o StreamCore.d: streamReferences
|
StreamCore.o StreamCore.d: streamReferences
|
||||||
|
|
||||||
|
# Update version string (contains __DATE__ and __TIME__)
|
||||||
|
# each time make runs.
|
||||||
|
StreamVersion.o: FORCE
|
||||||
|
FORCE:
|
||||||
|
|
||||||
streamReferences:
|
streamReferences:
|
||||||
$(PERL) ../src/makeref.pl Interface $(BUSSES) > $@
|
$(PERL) ../src/makeref.pl Interface $(BUSSES) > $@
|
||||||
$(PERL) ../src/makeref.pl Converter $(FORMATS) >> $@
|
$(PERL) ../src/makeref.pl Converter $(FORMATS) >> $@
|
||||||
|
19
Makefile
19
Makefile
@ -1,23 +1,20 @@
|
|||||||
TOP = ..
|
TOP = ..
|
||||||
|
ifneq ($(wildcard ../configure),)
|
||||||
# Look if we have EPICS R3.13 or R3.14
|
# We are in an EPICS R3.14+ <TOP> location
|
||||||
ifneq ($(wildcard $(TOP)/configure),)
|
|
||||||
# EPICS R3.14
|
|
||||||
DIRS = configure
|
|
||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
else ifneq ($(wildcard $(TOP)/config),)
|
else ifneq ($(wildcard ../config),)
|
||||||
# EPICS R3.13
|
# We are in an EPICS R3.13 <TOP> location
|
||||||
CONFIG = $(TOP)/config
|
CONFIG = $(TOP)/config
|
||||||
DIRS = config
|
|
||||||
include $(TOP)/config/CONFIG_APP
|
include $(TOP)/config/CONFIG_APP
|
||||||
else
|
else
|
||||||
|
# Using our own local configuration
|
||||||
TOP = .
|
TOP = .
|
||||||
DIRS = configure
|
DIRS = config configure
|
||||||
|
src_DEPEND_DIRS := $(DIRS)
|
||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DIRS += src
|
DIRS += src
|
||||||
src_DEPEND_DIRS = configure
|
|
||||||
DIRS += streamApp
|
DIRS += streamApp
|
||||||
streamApp_DEPEND_DIRS = src
|
streamApp_DEPEND_DIRS = src
|
||||||
|
|
||||||
@ -26,4 +23,4 @@ include $(CONFIG)/RULES_TOP
|
|||||||
documentation/stream.pdf: documentation/*.html documentation/*.css documentation/*.png
|
documentation/stream.pdf: documentation/*.html documentation/*.css documentation/*.png
|
||||||
cd documentation; makepdf
|
cd documentation; makepdf
|
||||||
|
|
||||||
install: documentation/stream.pdf
|
pdf: documentation/stream.pdf
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
#CONFIG
|
|
||||||
# Add any changes to make rules here
|
|
||||||
#CROSS_COMPILER_TARGET_ARCHS = mv167
|
|
@ -1,7 +1,7 @@
|
|||||||
#CONFIG_APP
|
#CONFIG_APP
|
||||||
include $(TOP)/config/RELEASE
|
include $(TOP)/configure/RELEASE
|
||||||
-include $(TOP)/config/RELEASE.$(HOST_ARCH)
|
-include $(TOP)/configure/RELEASE.$(HOST_ARCH)
|
||||||
include $(EPICS_BASE)/config/CONFIG
|
-include $(EPICS_BASE)/config/CONFIG
|
||||||
INSTALL_LOCATION = $(TOP)
|
INSTALL_LOCATION = $(TOP)
|
||||||
ifdef INSTALL_LOCATION_APP
|
ifdef INSTALL_LOCATION_APP
|
||||||
INSTALL_LOCATION = $(INSTALL_LOCATION_APP)
|
INSTALL_LOCATION = $(INSTALL_LOCATION_APP)
|
||||||
@ -10,11 +10,3 @@ endif
|
|||||||
ifdef T_A
|
ifdef T_A
|
||||||
-include $(TOP)/config/O.$(T_A)/CONFIG_APP_INCLUDE
|
-include $(TOP)/config/O.$(T_A)/CONFIG_APP_INCLUDE
|
||||||
endif
|
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
|
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
#
|
|
||||||
# Makefile,v 1.1.2.1 1999/07/15 19:55:30 jba Exp
|
|
||||||
#
|
|
||||||
|
|
||||||
TOP=..
|
TOP=..
|
||||||
include $(TOP)/config/CONFIG_APP
|
include $(TOP)/config/CONFIG_APP
|
||||||
|
ifneq ($(wildcard $(EPICS_BASE)/config),)
|
||||||
include $(TOP)/config/RULES_ARCHS
|
include $(EPICS_BASE)/config/RULES_ARCHS
|
||||||
|
else
|
||||||
|
build install clean realclean:
|
||||||
|
endif
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
#
|
#
|
||||||
# Makefile.Host,v 1.1.2.3 2001/09/14 19:39:14 anj Exp
|
# $Id: Makefile.Host,v 1.1.1.1 2000/04/05 07:33:44 janousch Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
TOP=../..
|
TOP=../..
|
||||||
include $(TOP)/config/CONFIG_APP
|
include $(TOP)/config/CONFIG_APP
|
||||||
|
|
||||||
TARGETS = checkRelease CONFIG_APP_INCLUDE
|
TARGETS = CONFIG_APP_INCLUDE
|
||||||
|
|
||||||
include $(TOP)/config/RULES.Host
|
include $(TOP)/config/RULES.Host
|
||||||
|
|
||||||
inc:: $(TARGETS)
|
inc:: $(TARGETS)
|
||||||
|
|
||||||
CONFIG_APP_INCLUDE: $(wildcard $(TOP)/config/RELEASE*) $(TOP)/config/CONFIG_APP
|
ifeq ($(wildcard $(TOP)/configure/RELEASE.$(HOST_ARCH)),$(TOP)/configure/RELEASE.$(HOST_ARCH))
|
||||||
$(PERL) $(TOP)/config/convertRelease.pl $@
|
CONFIG_APP_INCLUDE: $(TOP)/configure/RELEASE.$(HOST_ARCH)
|
||||||
|
endif
|
||||||
checkRelease:
|
|
||||||
$(PERL) $(TOP)/config/convertRelease.pl $@
|
|
||||||
|
|
||||||
.PHONY :: checkRelease
|
|
||||||
|
|
||||||
|
CONFIG_APP_INCLUDE: $(TOP)/configure/RELEASE $(TOP)/config/CONFIG_APP
|
||||||
|
$(RM) $@
|
||||||
|
@$(PERL) $(TOP)/config/makeConfigAppInclude.pl $(T_A) $@ $(TOP)
|
||||||
|
@ -7,7 +7,7 @@ include $(TOP)/config/CONFIG_APP
|
|||||||
|
|
||||||
TARGETS = CONFIG_APP_INCLUDE
|
TARGETS = CONFIG_APP_INCLUDE
|
||||||
|
|
||||||
include $(TOP)/config/RULES.Vx
|
include $(EPICS_BASE)/config/RULES.Vx
|
||||||
|
|
||||||
inc:: $(TARGETS)
|
inc:: $(TARGETS)
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
include $(TOP)/configure/RELEASE
|
|
203
config/RULES.Db
203
config/RULES.Db
@ -1,203 +0,0 @@
|
|||||||
# RULES.Db,v 1.9.6.6 2003/03/25 23:13:22 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 = $(PERL) $(TOP)/config/touch.pl
|
|
||||||
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) $< > dbExpand.tmp
|
|
||||||
$(MV) dbExpand.tmp $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
##################################################### Dependencies
|
|
||||||
|
|
||||||
DEPENDS: $(filter $(patsubst %.db, %.substitutions, $(DB)), $(wildcard *.substitutions))
|
|
||||||
@$(MAKEDBDEPENDS) $^
|
|
||||||
|
|
||||||
-include DEPENDS
|
|
@ -1,7 +0,0 @@
|
|||||||
#RULES.Vx
|
|
||||||
include $(EPICS_BASE)/config/RULES.Vx
|
|
||||||
inc:: $(INSTALL_INCREC)
|
|
||||||
|
|
||||||
# Library should be rebuilt because LIBOBJS may have changed.
|
|
||||||
$(LIBNAME): ../Makefile.Vx
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
#RULES.ioc
|
|
||||||
include $(EPICS_BASE)/config/RULES_DIRS
|
|
||||||
buildInstall:: cdCommands
|
|
||||||
|
|
||||||
cdCommands: Makefile $(wildcard $(TOP)/config/RELEASE*)
|
|
||||||
@$(PERL) $(TOP)/config/convertRelease.pl -a $(ARCH) -h $(HOST_ARCH) $@
|
|
||||||
|
|
||||||
clean::
|
|
||||||
@$(RM) cdCommands
|
|
@ -1,4 +0,0 @@
|
|||||||
#RULES.iocBoot
|
|
||||||
DIRS += $(wildcard ioc*)
|
|
||||||
DIRS += $(wildcard as*)
|
|
||||||
include $(EPICS_BASE)/config/RULES_DIRS
|
|
@ -1,12 +1,14 @@
|
|||||||
MUNCH = $(PERL) $(INSTALL_LOCATION)/bin/$(HOST_ARCH)/munch.pl
|
|
||||||
|
|
||||||
# The original 3.13.10 munching rule does not really work well
|
# The original 3.13.10 munching rule does not really work well
|
||||||
|
|
||||||
|
# This is the munch.pl taken from EPICS base 3.14.8.2
|
||||||
|
MUNCH = $(PERL) ../../config/munch.pl
|
||||||
|
|
||||||
build:: $(LIBNAME).munch
|
build:: $(LIBNAME).munch
|
||||||
|
|
||||||
buildInstall:: $(INSTALL_BIN)/$(LIBNAME).munch
|
buildInstall:: $(INSTALL_BIN)/$(LIBNAME).munch
|
||||||
|
|
||||||
%.munch: %
|
%.munch: %
|
||||||
|
@echo "Munching $<"
|
||||||
$(RM) $*_ctct.o $*_ctdt.c
|
$(RM) $*_ctct.o $*_ctdt.c
|
||||||
$(NM) $< | $(MUNCH) > $*_ctdt.c
|
$(NM) $< | $(MUNCH) > $*_ctdt.c
|
||||||
$(GCC) -traditional $(CFLAGS) -fdollars-in-identifiers -c $(SOURCE_FLAG) $*_ctdt.c
|
$(GCC) -traditional $(CFLAGS) -fdollars-in-identifiers -c $(SOURCE_FLAG) $*_ctdt.c
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
#RULES_TOP
|
|
||||||
include $(EPICS_BASE)/config/RULES_TOP
|
|
||||||
|
|
||||||
uninstall::
|
|
||||||
@$(RMDIR) $(INSTALL_DB)
|
|
@ -51,8 +51,8 @@ $outfile = $ARGV[0];
|
|||||||
@apps = (TOP); # Provides the order of apps in RELEASE file
|
@apps = (TOP); # Provides the order of apps in RELEASE file
|
||||||
|
|
||||||
# Read the RELEASE file(s)
|
# Read the RELEASE file(s)
|
||||||
$relfile = "$top/config/RELEASE";
|
$relfile = "$top/configure/RELEASE";
|
||||||
die "Can't find config/RELEASE file" unless (-r $relfile);
|
die "Can't find configure/RELEASE file" unless (-r $relfile);
|
||||||
&readRelease($relfile, \%macros, \@apps);
|
&readRelease($relfile, \%macros, \@apps);
|
||||||
|
|
||||||
if ($hostarch) {
|
if ($hostarch) {
|
||||||
|
62
config/makeConfigAppInclude.pl
Normal file
62
config/makeConfigAppInclude.pl
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
# $Id: makeConfigAppInclude.pl,v 1.1.1.1 2000/04/05 07:33:44 janousch 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];
|
||||||
|
|
||||||
|
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;
|
||||||
|
#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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$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;
|
@ -1,23 +0,0 @@
|
|||||||
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: $!";
|
|
@ -1,12 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
#
|
|
||||||
# unix touch in Perl
|
|
||||||
|
|
||||||
use File::Copy;
|
|
||||||
use File::Basename;
|
|
||||||
|
|
||||||
sub Usage
|
|
||||||
{
|
|
||||||
my ($txt) = @_;
|
|
||||||
|
|
||||||
print "Usage:\n";
|
|
||||||
print "\ttouch file [ file2 file3 ...]\n";
|
|
||||||
print "\nError: $txt\n" if $txt;
|
|
||||||
|
|
||||||
exit 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
# need at least one arg: ARGV[0]
|
|
||||||
Usage("need more args") if $#ARGV < 0;
|
|
||||||
|
|
||||||
@targets=@ARGV[0..$#ARGV];
|
|
||||||
|
|
||||||
foreach $file ( @targets )
|
|
||||||
{
|
|
||||||
open(OUT,">$file") or die "$! creating $file";
|
|
||||||
#print OUT "NUL\n";
|
|
||||||
close OUT;
|
|
||||||
}
|
|
||||||
|
|
||||||
# EOF touch.pl
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
TOP=..
|
TOP=..
|
||||||
|
|
||||||
include $(TOP)/configure/CONFIG
|
include $(TOP)/configure/CONFIG_APP
|
||||||
|
|
||||||
# Set the following to NO to disable consistency checking of
|
# Set the following to NO to disable consistency checking of
|
||||||
# the support applications defined in $(TOP)/configure/RELEASE
|
# the support applications defined in $(TOP)/configure/RELEASE
|
||||||
|
29
src/Makefile
29
src/Makefile
@ -18,18 +18,16 @@
|
|||||||
# #
|
# #
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
TOP:=../$(TOP)
|
TOP = ../..
|
||||||
|
ifneq ($(wildcard ../../configure),)
|
||||||
# Look if we have EPICS R3.13 or R3.14
|
include $(TOP)/configure/CONFIG
|
||||||
ifeq ($(wildcard $(TOP)/configure),)
|
else ifneq ($(wildcard ../../config),)
|
||||||
# EPICS R3.13
|
include $(TOP)/config/CONFIG_APP
|
||||||
include $(TOP)/config/CONFIG_APP
|
include $(TOP)/config/RULES_ARCHS
|
||||||
# The real work is in Makefile.Vx
|
|
||||||
include $(TOP)/config/RULES_ARCHS
|
|
||||||
else
|
else
|
||||||
|
TOP= ..
|
||||||
# EPICS R3.14
|
include $(TOP)/configure/CONFIG
|
||||||
include $(TOP)/configure/CONFIG
|
endif
|
||||||
|
|
||||||
-include CONFIG_STREAM
|
-include CONFIG_STREAM
|
||||||
-include ../CONFIG_STREAM
|
-include ../CONFIG_STREAM
|
||||||
@ -73,11 +71,10 @@ INC += devStream.h
|
|||||||
# switch off annoying rset warnings in 3.16+
|
# switch off annoying rset warnings in 3.16+
|
||||||
CPPFLAGS += -DUSE_TYPED_RSET
|
CPPFLAGS += -DUSE_TYPED_RSET
|
||||||
|
|
||||||
include $(TOP)/configure/RULES
|
-include $(TOP)/configure/RULES
|
||||||
|
|
||||||
# Update version string (contains __DATE__ and __TIME__)
|
# Update version string whenever something changes
|
||||||
# each time make runs.
|
StreamVersion$(OBJ): ../*.c ../*.h ../*.cc ../CONFIG_STREAM
|
||||||
StreamVersion$(OBJ): ../*.c ../*.h ../*.cc ../CONFIG_STREAM ../Makefile
|
|
||||||
|
|
||||||
# Add references to all registrars to main file to avoid
|
# Add references to all registrars to main file to avoid
|
||||||
# missing initialization.
|
# missing initialization.
|
||||||
@ -93,5 +90,3 @@ $(COMMON_DIR)/$(LIBRARY_DEFAULT).dbd: ../CONFIG_STREAM
|
|||||||
|
|
||||||
$(LIBRARY_DEFAULT).dbd$(DEP): ../CONFIG_STREAM
|
$(LIBRARY_DEFAULT).dbd$(DEP): ../CONFIG_STREAM
|
||||||
echo $(LIBRARY_DEFAULT).dbd: $< > $@
|
echo $(LIBRARY_DEFAULT).dbd: $< > $@
|
||||||
|
|
||||||
endif
|
|
||||||
|
@ -18,20 +18,17 @@
|
|||||||
# #
|
# #
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
TOP := ../../$(TOP)
|
TOP = ../..
|
||||||
|
ifneq ($(wildcard ../../../config),)
|
||||||
|
TOP = ../../..
|
||||||
|
endif
|
||||||
|
|
||||||
include $(TOP)/config/CONFIG_APP
|
include $(TOP)/config/CONFIG_APP
|
||||||
include ../CONFIG_STREAM
|
include ../CONFIG_STREAM
|
||||||
|
|
||||||
DBDNAME = stream.dbd
|
DBDNAME = stream.dbd
|
||||||
|
|
||||||
INC += devStream.h
|
INC += devStream.h
|
||||||
|
|
||||||
# This is the munch.pl taken from EPICS 3.14.8.2
|
|
||||||
# Install script and rule.
|
|
||||||
CONFIGS = RULES.munch
|
|
||||||
SCRIPTS = munch.pl
|
|
||||||
|
|
||||||
include $(EPICS_BASE)/config/RULES.Host
|
include $(EPICS_BASE)/config/RULES.Host
|
||||||
|
|
||||||
# create stream.dbd from all RECORDTYPES
|
# create stream.dbd from all RECORDTYPES
|
||||||
|
@ -18,32 +18,33 @@
|
|||||||
# #
|
# #
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
TOP := ../../$(TOP)
|
TOP = ../..
|
||||||
|
ifneq ($(wildcard ../../../config),)
|
||||||
|
TOP = ../../..
|
||||||
|
endif
|
||||||
|
|
||||||
include $(TOP)/config/CONFIG_APP
|
include $(TOP)/config/CONFIG_APP
|
||||||
include ../CONFIG_STREAM
|
include ../CONFIG_STREAM
|
||||||
|
|
||||||
LIBNAME = streamLib
|
LIBNAME = streamLib
|
||||||
|
|
||||||
SRCS.cc += $(patsubst %,../%,$(filter %.cc,$(STREAM_SRCS)))
|
|
||||||
SRCS.cc += $(BUSSES:%=../%Interface.cc)
|
SRCS.cc += $(BUSSES:%=../%Interface.cc)
|
||||||
SRCS.cc += $(FORMATS:%=../%Converter.cc)
|
SRCS.cc += $(FORMATS:%=../%Converter.cc)
|
||||||
SRCS.c += $(patsubst %,../%,$(filter %.c,$(STREAM_SRCS)))
|
SRCS.cc += $(filter %.cc,$(STREAM_SRCS:%=%../%))
|
||||||
SRCS.c += $(patsubst %,../dev%Stream.c,$(RECORDTYPES)))
|
SRCS.c += $(RECORDTYPES:%=../dev%Stream.c)
|
||||||
|
SRCS.c += $(filter %.c,$(STREAM_SRCS:%=%../%))
|
||||||
|
|
||||||
LIBOBJS = $(patsubst ../%,%.o,$(basename $(SRCS.cc) $(SRCS.c)))
|
LIBOBJS = $(patsubst ../%,%.o,$(basename $(SRCS.cc) $(SRCS.c)))
|
||||||
|
|
||||||
include $(EPICS_BASE)/config/RULES.Vx
|
include $(EPICS_BASE)/config/RULES.Vx
|
||||||
include $(TOP)/config/RULES.munch
|
include ../../config/RULES.munch
|
||||||
|
|
||||||
build:: depends
|
|
||||||
|
|
||||||
|
DEPENDS: depends
|
||||||
-include DEPENDS
|
-include DEPENDS
|
||||||
|
|
||||||
# Update version string (contains __DATE__ and __TIME__)
|
# Update version string whenever something changes
|
||||||
# each time make runs.
|
StreamVersion.o: ../*.c ../*.h ../*.cc ../CONFIG_STREAM
|
||||||
StreamVersion.o: FORCE
|
$(LIBNAME): StreamVersion.o
|
||||||
FORCE:
|
|
||||||
|
|
||||||
StreamCore.o: streamReferences
|
StreamCore.o: streamReferences
|
||||||
|
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
MUNCH = $(PERL) $(INSTALL_LOCATION)/bin/$(HOST_ARCH)/munch.pl
|
|
||||||
|
|
||||||
# The original 3.13.10 munching rule does not really work well
|
|
||||||
|
|
||||||
build:: $(LIBNAME).munch
|
|
||||||
|
|
||||||
buildInstall:: $(INSTALL_BIN)/$(LIBNAME).munch
|
|
||||||
|
|
||||||
%.munch: %
|
|
||||||
$(RM) $*_ctct.o $*_ctdt.c
|
|
||||||
$(NM) $< | $(MUNCH) > $*_ctdt.c
|
|
||||||
$(GCC) -traditional $(CFLAGS) -fdollars-in-identifiers -c $(SOURCE_FLAG) $*_ctdt.c
|
|
||||||
$(LINK.c) $@ $< $*_ctdt.o
|
|
||||||
|
|
@ -1,15 +1,13 @@
|
|||||||
TOP:=../$(TOP)
|
TOP = ../..
|
||||||
|
ifneq ($(wildcard ../../configure),)
|
||||||
# Look if we have EPICS R3.13 or R3.14+
|
include $(TOP)/configure/CONFIG
|
||||||
ifeq ($(wildcard $(TOP)/configure),)
|
else ifneq ($(wildcard ../../config),)
|
||||||
# EPICS R3.13
|
include $(TOP)/config/CONFIG_APP
|
||||||
include $(TOP)/config/CONFIG_APP
|
include $(TOP)/config/RULES_ARCHS
|
||||||
# The real work is in Makefile.Vx
|
|
||||||
include $(TOP)/config/RULES_ARCHS
|
|
||||||
else
|
else
|
||||||
|
TOP= ..
|
||||||
# EPICS R3.14+
|
include $(TOP)/configure/CONFIG
|
||||||
include $(TOP)/configure/CONFIG
|
endif
|
||||||
|
|
||||||
PROD = streamApp
|
PROD = streamApp
|
||||||
DBD = streamApp.dbd
|
DBD = streamApp.dbd
|
||||||
@ -63,13 +61,11 @@ PROD_LIBS += $(EPICS_BASE_IOC_LIBS)
|
|||||||
# switch off annoying rset warnings in 3.16+
|
# switch off annoying rset warnings in 3.16+
|
||||||
CPPFLAGS += -DUSE_TYPED_RSET
|
CPPFLAGS += -DUSE_TYPED_RSET
|
||||||
|
|
||||||
include $(TOP)/configure/RULES
|
-include $(TOP)/configure/RULES
|
||||||
|
|
||||||
ifdef BASE_3_15
|
ifdef BASE_3_15
|
||||||
clean:
|
clean:
|
||||||
else
|
else
|
||||||
clean::
|
clean::
|
||||||
endif
|
endif
|
||||||
$(RM) core* *.log
|
$(RM) core* *.log tests/test.* tests/*log
|
||||||
|
|
||||||
endif
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
TOP := ../../$(TOP)
|
TOP = ../..
|
||||||
|
ifneq ($(wildcard ../../../config),)
|
||||||
|
TOP = ../../..
|
||||||
|
endif
|
||||||
|
|
||||||
include $(TOP)/config/CONFIG_APP
|
include $(TOP)/config/CONFIG_APP
|
||||||
|
|
||||||
include $(EPICS_BASE)/config/RULES.Host
|
include $(EPICS_BASE)/config/RULES.Host
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
TOP := ../../$(TOP)
|
TOP = ../..
|
||||||
|
ifneq ($(wildcard ../../../config),)
|
||||||
|
TOP = ../../..
|
||||||
|
endif
|
||||||
|
|
||||||
include $(TOP)/config/CONFIG_APP
|
include $(TOP)/config/CONFIG_APP
|
||||||
|
|
||||||
@ -19,7 +22,7 @@ DBDEXPAND = streamAppInclude-3-13.dbd
|
|||||||
#CPPFLAGS += -DDEBUGFILE=StreamDebug.log
|
#CPPFLAGS += -DDEBUGFILE=StreamDebug.log
|
||||||
|
|
||||||
include $(EPICS_BASE)/config/RULES.Vx
|
include $(EPICS_BASE)/config/RULES.Vx
|
||||||
include $(TOP)/config/RULES.munch
|
include ../../config/RULES.munch
|
||||||
|
|
||||||
# Rebuild when LIBOBJS change
|
# Rebuild when LIBOBJS changes
|
||||||
$(LIBNAME): ../base-3-13LIBOBJS
|
$(LIBNAME): ../base-3-13LIBOBJS
|
||||||
|
Reference in New Issue
Block a user