|
|
Experimental Physics and
| ||||||||||||||
|
|
Hi Alex,
I have a couple of suggestions for you. The first is to not use the TEST* variables at all, and instead have your Makefiles set the INSTALL_LOCATION variable which controls the parent directory of the db, dbd, include, bin and lib install directories for files
installed by that Makefile. You can point that to an absolute path, or set it to a path relative to the O.$(T_A) directory below that Makefile, e.g.
INSTALL_LOCATION=../../install
INSTALL_LOCATION=$(TOP)/iocBoot/iocTest1
I recommend not pointing it to the App directory itself (../..) since it’s very easy to confuse the install directories there with your Db, src and other subdirectories (and on Windows the Db and db paths would refer to the same directory on a case-independent
file system, possibly resulting in chaos and lost data). There is no make target that will automatically delete the installed files or directories if you use this approach, and it isn’t trivial to reuse components built in one App directory within an IOC built
in another App directory.
Alternatively, you don’t need to add your .dbd and .db files to the DBD and DB variables for them to be created by a Makefile. Those variables are used to request that the named files be installed after creation, and since you don’t want the installation part
you can add any files that need creating to the TARGETS variable instead. However the rules in configure/RULES.Db which build them do create them in the O.Common directory instead of O.<target> so you need to prefix the filenames in the TARGETS variable with
$(COMMON_DIR) for that to work. More details below...
If you set a TESTDBD variable in an App/src/Makefile (which doesn’t currently do anything) adding this line to it will cause the files in it to be created as they would by setting the DBD variable, without installing them:
TARGETS += $(TESTDBD:%=$(COMMON_DIR)/%)
If a .dbd file already exists in the source directory you should not add it to TESTDBD though; only set the variable for files that need to be created.
If you’re building a record type in your App/src directory, you would add this line to make it generate the header file from your *Record.dbd file:
TARGETS += $(TESTDBDINC:%=$(COMMON_DIR)/%.h)
Similarly for .db files, your App/Db/Makefile should add files that need to be created to the TESTDB variable and add this line:
TARGETS += $(TESTDB:%=$(COMMON_DIR)/%)
I haven’t tested that last one, but I’m pretty sure it will work.
In all cases the lines above should appear somewhere between the two “include” statements in the Makefile.
If this works and you think it sufficiently useful we could consider adding the above to the EPICS build rules — file an issue against EPICS Base in that case to request it.
HTH,
- Andrew
-- Complexity comes for free, Simplicity you have to work for.
| ||||||||||||||
| ANJ, 19 Mar 2026 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
· Distributions · Download · Documents · Links · Licensing · |