EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: building libraries from only objs and libs in 3.14
From: Benjamin Franksen <[email protected]>
To: Janet Anderson <[email protected]>
Cc: [email protected]
Date: Fri, 8 Apr 2005 12:03:01 +0200
On Wednesday 06 April 2005 21:54, you wrote:
> Benjamin Franksen wrote:
> > I have created the example application with
> >
> > makeBaseApp.pl -t example ex
> >
> > When I comment out all the *_SRCS definitions in
> > exApp/src/Makefile, I get
> >
> > make[1]: *** No rule to make target `ex.o', needed by `ex'.  Stop.
> > make: *** [install.hpux-parisc] Error 2
>
> You should be able to bundle objects and libraries into a new library
> or prod, but you need to have at least 1 source or object defined for
> that LIBRARY or PROD for each target arch.

Hi Janet,

it seems I missed some of the fine print in the docs. This works:

PROD_IOC = ex
ex_SRCS_vxWorks += -nil-
ex_SRCS_DEFAULT += exMain.cpp

ex_LIBS += $(EPICS_BASE_IOC_LIBS)
ex_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

There are some issues here, that are not obvious for the newcomer:

(1) The first is that one needs at least one object or source for a 
'product', plus the trick with the "-nil-" definition. I finally found 
the place where this is documented, lost among the 30 or so pages of 
somewhat repetitive listings of make variable explanations.

(2) Even for vxWorks the final IOC target is an executable (PROD_xxx), 
not a library (LIBRARY_xxx) as it used to be. Creating a library for an 
IOC ('LIBRARY_IOC...') is completely optional. BTW, I wonder what these 
'munch' files are about? Is there a place where I can read more about 
them?

> Re-adding the ex_SRCS_DEFAULT += exMain.cpp line worked for me.
> You must have changed something else in the Makefile to stop the
> build of libxxxSupport library. That library is required for the
> ex prod ( ex_LIBS += xxxSupport ).

Yes, but the error says 'no rule to make target xxxSupport.a'. I created 
everything again to make sure. Same error. However, since I now 
realized that I don't need to create a library, everything is fine for 
me (for the moment ;-).

FYI, I attached the latest revision of my additions to our local 
configure/RULES which fixes db file generation from substitution files 
written in the dbLoadTemplate style. (Please ignore the last include 
line.)

Ben
include $(EPICS_BASE)/configure/RULES

DBFLAGS += -I$(COMMON_DIR)

$(COMMON_DIR)/%.template: ../%.template
	@$(RM) $@
	@$(CP) $< $@

$(COMMON_DIR)/%.db$(RAW)$(DEP): %.substitutions
	@$(PERL) -e 'undef $$/; $$_=<>; @d=m/(?:^|})\s*file\s+([^{\s]*)\s*\{/g; map\
	 {$$_="$(COMMON_DIR)/$$_"} @d; print "$(COMMON_DIR)/$*.db$(RAW): @d\n";' $< > $@

$(COMMON_DIR)/%.db$(RAW): %.substitutions
	@echo "Inflating database from $<"
	@$(RM) $@
	$(MSI) $(DBFLAGS) -S$< $(TEMPLATE_FILENAME) > msi.tmp
	@$(MV) msi.tmp $@

ifeq '$(DB_OPT)' 'YES'
DBST_TARGETS = $(addprefix $(COMMON_DIR)/,$(notdir $(filter %.db, $(DB))))

$(DBST_TARGETS): $(COMMON_DIR)/%.db: $(COMMON_DIR)/$(DBDNAME) $(COMMON_DIR)/%.db$(RAW)
	@echo "Optimizing database $@"
	@$(RM) $@
	@$(DBST) $^ -w0,,$@
endif

include $(TOP)/configure/RULES_FOREIGN

References:
building libraries from only objs and libs in 3.14 Benjamin Franksen

Navigate by Date:
Prev: Re: ???registrar(function_name) Andrew Johnson
Next: Re: ???registrar(function_name) Tim Mooney
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: building libraries from only objs and libs in 3.14 Benjamin Franksen
Next: synApps 5.1 release Tim Mooney
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·