Changes to automatically generate CONFIG_APP definitions.
This commit is contained in:
@@ -5,6 +5,9 @@ TEMPLATES_DIR = makeBaseApp
|
||||
TEMPLATES += top/Makefile
|
||||
TEMPLATES += top/config/CONFIG
|
||||
TEMPLATES += top/config/CONFIG_APP
|
||||
TEMPLATES += top/config/Makefile
|
||||
TEMPLATES += top/config/Makefile.Host
|
||||
TEMPLATES += top/config/Makefile.Vx
|
||||
TEMPLATES += top/config/RELEASE
|
||||
TEMPLATES += top/config/RULES.Db
|
||||
TEMPLATES += top/config/RULES.Host
|
||||
@@ -16,6 +19,7 @@ TEMPLATES += top/config/RULES_DIRS
|
||||
TEMPLATES += top/config/RULES_TOP
|
||||
TEMPLATES += top/config/makeDbDepends.pl
|
||||
TEMPLATES += top/config/makeIocCdCommands.pl
|
||||
TEMPLATES += top/config/makeConfigAppInclude.pl
|
||||
TEMPLATES += top/config/replaceVAR.pl
|
||||
|
||||
TEMPLATES += top/exampleApp/Makefile
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#Makefile at top of application tree
|
||||
TOP = .
|
||||
include $(TOP)/config/CONFIG_APP
|
||||
DIRS += config
|
||||
DIRS += $(wildcard *App)
|
||||
DIRS += $(wildcard *app)
|
||||
DIRS += $(wildcard iocBoot)
|
||||
|
||||
@@ -7,22 +7,10 @@ ifdef INSTALL_LOCATION_APP
|
||||
INSTALL_LOCATION = $(INSTALL_LOCATION_APP)
|
||||
endif
|
||||
|
||||
#Other share areas can be added similar to following
|
||||
#ifdef <share_top>
|
||||
#USR_INCLUDES += -I$(<share_top>)/include
|
||||
#<share_top>BIN = $(<share_top>)/bin/$(T_A)
|
||||
#endif
|
||||
USER_DBDFLAGS = -I. -I..
|
||||
|
||||
ifdef SHARE
|
||||
USR_INCLUDES += -I$(SHARE)/include
|
||||
SHARE_BIN = $(SHARE)/bin/$(T_A)
|
||||
USER_DBDFLAGS += -I .. -I $(SHARE)/dbd -I $(EPICS_BASE)/dbd
|
||||
endif
|
||||
|
||||
#Following only works if host provides soft links
|
||||
ifdef MASTER_IOCAPPS
|
||||
USR_INCLUDES += -I$(MASTER_IOCAPPS)/include
|
||||
MASTER_IOCAPPS_BIN = $(MASTER_IOCAPPS)/bin/$(T_A)
|
||||
ifdef T_A
|
||||
-include $(TOP)/config/O.$(T_A)/CONFIG_APP_INCLUDE
|
||||
endif
|
||||
|
||||
# Where to install databases
|
||||
|
||||
9
src/makeBaseApp/top/config/Makefile
Normal file
9
src/makeBaseApp/top/config/Makefile
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
TOP=..
|
||||
include $(TOP)/config/CONFIG_APP
|
||||
|
||||
include $(TOP)/config/RULES_ARCHS
|
||||
|
||||
19
src/makeBaseApp/top/config/Makefile.Host
Normal file
19
src/makeBaseApp/top/config/Makefile.Host
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
TOP=../..
|
||||
include $(TOP)/config/CONFIG_APP
|
||||
|
||||
TARGETS = CONFIG_APP_INCLUDE
|
||||
|
||||
include $(TOP)/config/RULES.Host
|
||||
|
||||
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)
|
||||
|
||||
19
src/makeBaseApp/top/config/Makefile.Vx
Normal file
19
src/makeBaseApp/top/config/Makefile.Vx
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
TOP=../..
|
||||
include $(TOP)/config/CONFIG_APP
|
||||
|
||||
TARGETS = CONFIG_APP_INCLUDE
|
||||
|
||||
include $(TOP)/config/RULES.Vx
|
||||
|
||||
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)
|
||||
|
||||
63
src/makeBaseApp/top/config/makeConfigAppInclude.pl
Normal file
63
src/makeBaseApp/top/config/makeConfigAppInclude.pl
Normal file
@@ -0,0 +1,63 @@
|
||||
# $Id$
|
||||
|
||||
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
|
||||
if $running_under_some_shell; # makeIocCdCommands.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 thie 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 "USR_INCLUDES += -I$post/include\n";
|
||||
}
|
||||
if ( -d "$post/dbd") { #check that directory exists
|
||||
print OUT "USER_DBDFLAGS += -I$post/dbd\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
close IN;
|
||||
}
|
||||
}
|
||||
close OUT;
|
||||
|
||||
@@ -4,7 +4,7 @@ include $(TOP)/config/CONFIG_APP
|
||||
#----------------------------------------
|
||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||
|
||||
USER_DBDFLAGS += -I .. -I $(EPICS_BASE)/dbd
|
||||
#USER_DBDFLAGS +=
|
||||
RECTYPES += xxxRecord.h
|
||||
DBDEXPAND = exampleInclude.dbd
|
||||
DBDNAME = exampleApp.dbd
|
||||
|
||||
Reference in New Issue
Block a user