2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 2025 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: MSI Makefile Madness |
From: | Bruce Hill <[email protected]> |
To: | <[email protected]> |
Date: | Tue, 6 Mar 2018 14:11:12 -0800 |
We ran into this issue as well. It happens when you have both foo.substitutions and foo.template in your Db directory and want msi to create and install foo.db. Note that you can't rename foo.template to foo.db as it will just get installed w/o any msi expansion. The problem in my view is that msi ignores all filenames specified in the substitutions file if a template filename is passed as an argument to msi. This is a deliberate choice in msi as we can see from the documentation. We fixed this by changing our RULES.Db after verifying that we had no use cases that relied on the above behavior. Another possible fix would be to modify msi to respect filenames specified in the substitutions file and only use a command line template argument for the pattern and regular formats which don't specify a filename. Here's the patch we use for RULES.Db: % git diff fb5f13f^! diff --git a/configure/RULES.Db b/configure/RULES.Db index 7836d28..2d59529 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -467,13 +467,13 @@ $(COMMON_DIR)/%.db: $(COMMON_DIR)/%.edf $(COMMON_DIR)/%.db: %$(SUBST_SUFFIX) $(ECHO) "Inflating database from $< $(TEMPLATE_FILENAME)" @$(RM) $(notdir $@) - $(MSI3_15) $(DBFLAGS) -o $(notdir $@) -S$< $(TEMPLATE_FILENAME) + $(MSI3_15) $(DBFLAGS) -o $(notdir $@) -S$< @$(MV) $(notdir $@) $@ $(COMMON_DIR)/%.db: ../%$(SUBST_SUFFIX) $(ECHO) "Inflating database from $< $(TEMPLATE_FILENAME)" @$(RM) $(notdir $@) - $(MSI3_15) $(DBFLAGS) -o $(notdir $@) -S$< $(TEMPLATE_FILENAME) + $(MSI3_15) $(DBFLAGS) -o $(notdir $@) -S$< @$(MV) $(notdir $@) $@ $(COMMON_DIR)/%.db: %$(TEMPL_SUFFIX) Cheers, - Bruce On 03/02/2018 06:18 AM, Konrad, Martin
wrote:
Hi Michael, You got to be careful with your file names. IIRC the EPICS build system contains rules that automatically expand templates and substitution files using MSI as follows: .substitutions -> .db .template -> .db The ".template" extension is only required if your file is using "substitute" and "include". If your files don't contain these keywords ".db" would probably be a better choice. If you use these keywords you probably want to refer to "foo.db" in your substitution file to include the already expanded file. That being said, the following works as expected: $ grep DB Makefile DB += file.db $ cat file.substitutions file "other1.db" { {X=1} } file "other2.db" { {X=2} } $ cat other1.db # from file.template $(X) $ cat other2.db # from other.template $(X) $ make -C ../../ distclean all $ cat ../../db/file.db # from file.template 1 # from other.template 2 HTH, Martin -- Bruce Hill Member Technical Staff SLAC National Accelerator Lab 2575 Sand Hill Road M/S 10 Menlo Park, CA 94025 |