From 18fdef33f4ad0f8cfc5de0e3bd9a10b5a7a3ec0c Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Fri, 30 Jul 1999 19:41:46 +0000 Subject: [PATCH] += 'real' DBDFLAGS --- config/RULES.Host | 17 +++--- config/RULES.Unix | 8 +-- config/RULES.Vx | 33 +++++++---- src/makeBaseApp/top/config/RULES.Db | 56 ++++++++++++++----- .../top/config/makeConfigAppInclude.pl | 7 +-- 5 files changed, 78 insertions(+), 43 deletions(-) diff --git a/config/RULES.Host b/config/RULES.Host index 02a6ba8e0..b3f3ce3e3 100644 --- a/config/RULES.Host +++ b/config/RULES.Host @@ -223,12 +223,13 @@ ifdef PROD PROD := $(addsuffix $(EXE), $(PROD)) endif -#--------------------------------------------------------------- -# if we are not building base add base includes and ld dirs +#----------------------------------------------------------------- +# if we are not building base add base includes and dbd dirs # (convenience for extensions and applications) ifneq ($(EPICS_BASE),$(TOP)) ifneq ($(EPICS_BASE),$(INSTALL_LOCATION)) EPICS_INCLUDES += -I$(EPICS_BASE_INCLUDE) -I$(EPICS_BASE_INCLUDE)/os/$(OS_CLASS) +EPICS_DBDFLAGS += -I $(EPICS_BASE)/dbd endif endif @@ -237,10 +238,6 @@ endif # create names (lists) for installed things # ---------------------------------------------------- -# each list starts with the destination directory name(s) -# to make sure it's there - - INCREC +=$(RECTYPES) $(MENUS) INSTALL_PROD= $(PROD:%= $(INSTALL_BIN)/%) @@ -288,7 +285,7 @@ endif #--------------------------------------------------------------- # always use c++ linker -LINK.c = $(LINK.cc) +#LINK.c = $(LINK.cc) #--------------------------------------------------------------- # Version number for base shared libraries (and win32 products) @@ -612,12 +609,12 @@ $(INSTALL_DBD)/%: ../% %Record.h: %Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH$(EXE) \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< %Record.h: ../%Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH$(EXE) \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< menu%.h: menu%.dbd $(RM) $@ @@ -639,7 +636,7 @@ ifdef DBDEXPAND $(DBDNAME): ../$(DBDEXPAND) @echo Expanding dbd @$(RM) $@ - $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand$(EXE) $(USER_DBDFLAGS) $< > $@ + $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand$(EXE) $(DBDFLAGS) $< > $@ endif $(DLL_LINK_LIBNAME) $(SHRLIBNAME): $(LIBOBJS) diff --git a/config/RULES.Unix b/config/RULES.Unix index 3e171b6f3..57531e542 100644 --- a/config/RULES.Unix +++ b/config/RULES.Unix @@ -57,7 +57,7 @@ buildInstall :: build \ $(INSTALL_MAN) $(INSTALL_MANS) $(INSTALL_HTMLS) \ $(INSTALL_DOC) $(INSTALL_DOCS) $(INSTALL_TEMPLATES) \ $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) $(INSTALL_TEMPLATE) \ - $(INSTALL_CONFIG) $(INSTALL_CONFIGS) \ + $(INSTALL_CONFIG) $(INSTALL_CONFIGS) \ $(INSTALL_DBD) $(INSTALL_DBS) $(INSTALL_BPTS) \ $(INSTALL_DBDNAME) $(INSTALL_INCREC) \ $(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) @@ -180,12 +180,12 @@ $(INSTALL_DBD)/%: ../% %Record.h: %Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< %Record.h: ../%Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< menu%.h: menu%.dbd $(RM) $@ @@ -206,7 +206,7 @@ bpt%.dbd: ../bpt%.data $(DBDNAME): ../$(DBDEXPAND) @echo expanding dbd @$(RM) $@ - $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand $(USER_DBDFLAGS) $< > $@ + $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand $(DBDFLAGS) $< > $@ $(LIBNAME): $(LIBOBJS) @echo Building library $@ diff --git a/config/RULES.Vx b/config/RULES.Vx index a8019a0a0..24cd3ba81 100644 --- a/config/RULES.Vx +++ b/config/RULES.Vx @@ -7,7 +7,7 @@ ifdef LIBOBJS_DEFAULT LIBOBJS+=$(LIBOBJS_DEFAULT) endif endif - + INCREC +=$(RECTYPES) $(MENUS) INSTALL_PROD = $(PROD:%= $(INSTALL_BIN)/%) INSTALL_LIBS = $(LIBNAME:%= $(INSTALL_BIN)/%) @@ -33,11 +33,13 @@ INSTALL_DBDNAME = $(DBDNAME:%= $(INSTALL_DBD)/%) MAN_DIRECTORY_TARGETS = $(foreach n, $(MANLIST),$(INSTALL_MAN)/man$(n)) -# if we are not building base add base includes -# +#----------------------------------------------------------------- +# if we are not building base add base includes and dbd dirs +# (convenience for extensions and applications) ifneq ($(EPICS_BASE),$(TOP)) ifneq ($(EPICS_BASE),$(INSTALL_LOCATION)) EPICS_INCLUDES += -I$(EPICS_BASE_INCLUDE) -I$(EPICS_BASE_INCLUDE)/os/$(OS_CLASS) +EPICS_DBDFLAGS += -I $(EPICS_BASE)/dbd endif endif @@ -48,10 +50,13 @@ rebuild:: clean install pre_build:: build:: pre_build $(MENUS) $(RECTYPES) $(BPTS)\ - $(LIBNAME) $(LIBNAME_CXX) $(TARGETS) $(PROD) $(DBDNAME) + $(LIBNAME) $(LIBNAME_CXX) $(TARGETS) $(PROD) +ifdef DBDEXPAND +build:: $(DBDNAME) +endif inc:: $(INSTALL_INC) $(INSTALL_OSINC) - + install:: inc buildInstall buildInstall :: build $(INSTALL_INCREC)\ @@ -186,12 +191,12 @@ $(INSTALL_DBD)/%: ../% %Record.h: %Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH$(EXE) \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< %Record.h: ../%Record.dbd $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH$(EXE) \ - $(USER_DBDFLAGS) $< + $(DBDFLAGS) $< menu%.h: menu%.dbd $(RM) $@ @@ -209,10 +214,12 @@ bpt%.dbd: ../bpt%.data $(RM) $@ $(EPICS_BASE)/bin/$(HOST_ARCH)/makeBpt$(EXE) $< +ifdef DBDEXPAND $(DBDNAME): ../$(DBDEXPAND) - @echo expanding dbd + @echo Expanding dbd @$(RM) $@ - $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand$(EXE) $(USER_DBDFLAGS) $< > $@ + $(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand$(EXE) $(DBDFLAGS) $< > $@ +endif $(LIBNAME): $(LIBOBJS) @echo Building library $@ @@ -283,7 +290,13 @@ $(INSTALL_HTML)/$(HTMLS_DIR)/%: ../% ifneq (,$(wildcard ../baseLIBOBJS)) $(LIBNAME): ../baseLIBOBJS endif + +ifneq (,$(wildcard ../base.dbd)) +$(DBDNAME): ../base.dbd $(RECTYPES:%.h=../%.dbd) +else +$(DBDNAME): $(RECTYPES:%.h=../%.dbd) +endif + #=====> ???? the following line causes a rebuild every time #=====> $(LIBNAME): ../Makefile.Vx -$(DBDNAME): ../base.dbd $(RECTYPES:%.h=../%.dbd) diff --git a/src/makeBaseApp/top/config/RULES.Db b/src/makeBaseApp/top/config/RULES.Db index 1e680bf48..3016ec2ba 100644 --- a/src/makeBaseApp/top/config/RULES.Db +++ b/src/makeBaseApp/top/config/RULES.Db @@ -1,4 +1,7 @@ -#RULES.Db +# $Id$ +# +# 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) @@ -11,20 +14,38 @@ 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_DBS = $(DBDINSTALL:%= $(INSTALL_DBD)/%) +INSTALL_DBDS = $(DBDINSTALL:%= $(INSTALL_DBD)/%) INSTALL_DBDNAME = $(DBDNAME:%= $(INSTALL_DBD)/%) -INSTALL_DATA=$(INSTALLDB:%=$(INSTALL_DB)/%) +INSTALL_DATA = $(INSTALLDB:%=$(INSTALL_DB)/%) +INSTALL_TEMPLATES = $(filter %.template,$(INSTALL_DATA)) + +#--------------------------------------------------------------- +# Main targets all:: install -inc:: $(INSTALL_DBS) +inc:: $(INSTALL_DBDS) $(INSTALL_BPTS) $(INSTALL_TEMPLATES) rebuild:: clean install install:: inc buildInstall -buildInstall:: build $(INSTALL_BPTS) $(INSTALL_DATA) +buildInstall:: build $(INSTALL_DATA) clean:: @echo "Cleaning" @@ -47,6 +68,8 @@ $(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) . @@ -93,7 +116,7 @@ endif ##################################################### CapFast filter -%.edf: ../%.sch $(DEPSCHS) +%.edf:: ../%.sch $(DEPSCHS) @if [ ! -f cad.rc -a -r ../cad.rc ] ; then ln -s ../cad.rc ; fi $(SCH2EDIF) $(SCH2EDIF_SYSFLAGS) $(SCH2EDIF_FLAGS) $< @@ -103,11 +126,11 @@ $(INSTALL_DB)/%.substitutions: %.substitutions @echo "Installing $@" @$(INSTALL) -d -m 644 $(@F) $(@D) -%.substitutions: ../%.substitutions +%.substitutions:: ../%.substitutions @$(CP) $< $@ ifdef CREATESUBSTITUTIONS -%.substitutions: +%.substitutions:: $(word $(words $(CREATESUBSTITUTIONS)),$(CREATESUBSTITUTIONS)) @$(CREATESUBSTITUTIONS) $* endif @@ -121,7 +144,7 @@ $(INSTALL_DB)/%.template: %.template @echo "Installing $@" @$(INSTALL) -d -m 644 $(@F) $(@D) -%.template: ../%.template +%.template:: ../%.template @$(CP) $< $@ %.template: %.edf @@ -131,7 +154,7 @@ $(INSTALL_DB)/%.template: %.template ##################################################### Flat databases -%.db.raw: ../%.db +%.db.raw:: ../%.db $(CP) $< $@ %.db.raw: %.edf @@ -145,25 +168,28 @@ $(INSTALL_DBD)/%: % @echo "Installing $@" @$(INSTALL) -d -m 644 $< $(@D) -$(INSTALL_DBD)/%: ../% +$(INSTALL_DBD)/%:: ../% @echo "Installing $@" @$(INSTALL) -d -m 644 $< $(@D) -bpt%.dbd: ../bpt%.data +bpt%.dbd: bpt%.data + $(RM) $@ + $(MAKEBPT) $< + +bpt%.dbd:: ../bpt%.data $(RM) $@ $(MAKEBPT) $< ifdef DBDEXPAND -$(DBDNAME): ../$(DBDEXPAND) +$(DBDNAME):: ../$(DBDEXPAND) @echo "Expanding dbd" @$(RM) $@ - $(DBEXPAND) $(USER_DBDFLAGS) $< > $@ + $(DBEXPAND) $(DBDFLAGS) $< > $@ endif ##################################################### Dependencies DEPENDS: $(filter $(patsubst %.db, %.substitutions, $(DB)), $(wildcard *.substitutions)) - @echo "Making template database dependencies" @$(MAKEDBDEPENDS) $^ -include DEPENDS diff --git a/src/makeBaseApp/top/config/makeConfigAppInclude.pl b/src/makeBaseApp/top/config/makeConfigAppInclude.pl index 43bfc58df..ce18a67cc 100644 --- a/src/makeBaseApp/top/config/makeConfigAppInclude.pl +++ b/src/makeBaseApp/top/config/makeConfigAppInclude.pl @@ -1,7 +1,7 @@ # $Id$ eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*- - if $running_under_some_shell; # makeIocCdCommands.pl + if $running_under_some_shell; # makeConfigAppInclude.pl use Cwd; @@ -49,10 +49,10 @@ foreach $file (@files) { print OUT "${prefix}_LIB = $post/lib/${arch}\n"; } if ( -d "$post/include") { #check that directory exists - print OUT "USR_INCLUDES += -I$post/include\n"; + print OUT "EPICS_INCLUDES += -I$post/include\n"; } if ( -d "$post/dbd") { #check that directory exists - print OUT "USER_DBDFLAGS += -I$post/dbd\n"; + print OUT "EPICS_DBDFLAGS += -I$post/dbd\n"; } } } @@ -60,4 +60,3 @@ foreach $file (@files) { } } close OUT; -