Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: Re: How to compile only for a target architecture
From: Andrew Johnson <anj@aps.anl.gov>
To: <tech-talk@aps.anl.gov>
Date: Wed, 12 Jul 2017 16:43:59 -0500
Hi Ricardo,

On 07/12/2017 04:24 PM, Ricardo Herrero wrote:
>  I want to ask you how to compile only for one target architecture in
> EPICS. In the application developer´s guide it is not clear enough . It
> seems as it always compile for host and for other target architectures.
> I want to compile for one target architecture, but not all of them and
> not for the host architecture. I just need to compile for linux-arm in
> any case from a x86_64.  How can I do that?

The EPICS Makefile below should build a library and an IOC for linux-arm
but not for the linux-x86_64 host architecture (assuming you built Base
with CROSS_COMPILER_TARGET_ARCHS = linux-arm). You may need to adjust
the TOP variable in the first line depending on how far down the tree
this file is placed, and obviously the source filenames. The important
parts for the target-only build are the setting of the LIBRARY* and
PROD_IOC* variables.

- Andrew


--------------------8<-------------------------
TOP=../..
include $(TOP)/configure/CONFIG

# Build an IOC support library
LIBRARY_linux-arm = testSupport
LIBRARY = $(LIBRARY_$(T_A))

# Compile and add the code to the support library
testSupport_SRCS += libA.c

# Link the library to the EPICS Base libraries
testSupport_LIBS += $(EPICS_BASE_IOC_LIBS)


# Build the IOC application on linux-arm only
PROD_IOC_linux-arm = test
PROD_IOC = $(PROD_IOC_$(T_A))

# test.dbd will be created and installed
DBD += test.dbd

# test.dbd will include these files:
test_DBD += base.dbd

# test_registerRecordDeviceDriver.cpp derives from test.dbd
test_SRCS += test_registerRecordDeviceDriver.cpp

# Build the main IOC entry point where needed
test_SRCS += testMain.cpp

# Link in the code from our support library
test_LIBS += testSupport

# Finally link IOC to the EPICS Base libraries
test_LIBS += $(EPICS_BASE_IOC_LIBS)

include $(TOP)/configure/RULES

--------------------8<-------------------------




-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon

References:
How to compile only for a target architecture Ricardo Herrero

Navigate by Date:
Prev: Re: How to compile only for a target architecture Ricardo Herrero
Next: Re: How to compile only for a target architecture Ronald L. Sluiter
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Re: How to compile only for a target architecture Andrew Johnson
Next: Re: How to compile only for a target architecture Ricardo Herrero
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 12 Jul 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·