diff --git a/src/makeBaseApp/Makefile.Host b/src/makeBaseApp/Makefile.Host index fc7580016..5b18415dd 100644 --- a/src/makeBaseApp/Makefile.Host +++ b/src/makeBaseApp/Makefile.Host @@ -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 diff --git a/src/makeBaseApp/top/Makefile b/src/makeBaseApp/top/Makefile index 9b46f54a6..5e554a16d 100644 --- a/src/makeBaseApp/top/Makefile +++ b/src/makeBaseApp/top/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) diff --git a/src/makeBaseApp/top/config/CONFIG_APP b/src/makeBaseApp/top/config/CONFIG_APP index 85ea7b582..97707443d 100644 --- a/src/makeBaseApp/top/config/CONFIG_APP +++ b/src/makeBaseApp/top/config/CONFIG_APP @@ -7,22 +7,10 @@ ifdef INSTALL_LOCATION_APP INSTALL_LOCATION = $(INSTALL_LOCATION_APP) endif -#Other share areas can be added similar to following -#ifdef -#USR_INCLUDES += -I$()/include -#BIN = $()/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 diff --git a/src/makeBaseApp/top/config/Makefile b/src/makeBaseApp/top/config/Makefile new file mode 100644 index 000000000..ec3a18069 --- /dev/null +++ b/src/makeBaseApp/top/config/Makefile @@ -0,0 +1,9 @@ +# +# $Id$ +# + +TOP=.. +include $(TOP)/config/CONFIG_APP + +include $(TOP)/config/RULES_ARCHS + diff --git a/src/makeBaseApp/top/config/Makefile.Host b/src/makeBaseApp/top/config/Makefile.Host new file mode 100644 index 000000000..262bf8c23 --- /dev/null +++ b/src/makeBaseApp/top/config/Makefile.Host @@ -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) + diff --git a/src/makeBaseApp/top/config/Makefile.Vx b/src/makeBaseApp/top/config/Makefile.Vx new file mode 100644 index 000000000..ff8442d47 --- /dev/null +++ b/src/makeBaseApp/top/config/Makefile.Vx @@ -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) + diff --git a/src/makeBaseApp/top/config/makeConfigAppInclude.pl b/src/makeBaseApp/top/config/makeConfigAppInclude.pl new file mode 100644 index 000000000..43bfc58df --- /dev/null +++ b/src/makeBaseApp/top/config/makeConfigAppInclude.pl @@ -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 = ) { + 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; + diff --git a/src/makeBaseApp/top/exampleApp/src/Makefile.Host b/src/makeBaseApp/top/exampleApp/src/Makefile.Host index b0d8a23b5..3842c64b1 100644 --- a/src/makeBaseApp/top/exampleApp/src/Makefile.Host +++ b/src/makeBaseApp/top/exampleApp/src/Makefile.Host @@ -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