Hi Jakub,
What you are proposing is how many areaDetector directories are already structured. For example ADVimba, ADSpinnaker, etc.
I just cloned your repository and I think I have fixed the problem.
Replace uvcSupport/Makefile with this:
####################
TOP=..
include $(TOP)/configure/CONFIG
SRC_DIRS += ../libuvc
INC += libuvc/libuvc.h
INC += libuvc/libuvc_config.h
INC += libuvc/libuvc_internal.h
INC += utlist.h
ifeq (linux-x86_64, $(findstring linux-x86_64, $(T_A)))
LIBRARY = uvc
endif
# Should be able to compile libuvc on arm
ifeq (linux-arm, $(findstring linux-arm, $(T_A)))
LIBRARY = uvc
endif
# TODO: Try building libuvc on windows
#ifeq (windows-x64, $(findstring windows-x64, $(T_A)))
#endif
uvc_SRCS += ctrl.c
uvc_SRCS += ctrl-gen.c
uvc_SRCS += device.c
uvc_SRCS += diag.c
uvc_SRCS += frame.c
uvc_SRCS += frame-mjpeg.c
uvc_SRCS += init.c
uvc_SRCS += misc.c
uvc_SRCS += stream.c
uvc_LIBS += jpeg
uvc_SYS_LIBS += usb-1.0
#DIRS := $(DIRS) uvcSupport/libuvc
#uvcSupport_DEPEND_DIRS += uvcSupport/libuvc
include $(TOP)/configure/RULES
############################
Delete uvcSupport/libuvc/Makefile, it is not needed.
Because you used SRC_DIRS for libuvc you don't need a Makefile there, and you put the build commands for the library directly in this Makefile.
Mark
________________________________
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Wlodek, Jakub via Tech-talk <tech-talk at aps.anl.gov>
Sent: Monday, November 23, 2020 2:45 PM
To: tech-talk at aps.anl.gov
Subject: Best practice for compiling helper support library via EPICS build system
Hi all,
I had a question regarding best practices for building a helper support library for EPICS applications as a part of the EPICS build system.
At the moment I have the following (seemingly working) structure, omitting some boilerplate that doesn't affect this question:
A Top level makefile that lists directories and their dependencies:
DIRS := $(DIRS) configure
DIRS := $(DIRS) uvcSupport
DIRS := $(DIRS) uvcSupport/libuvc
DIRS := $(DIRS) uvcApp
uvcSupport_DEPEND_DIRS += uvcSupport/libuvc
uvcApp_DEPEND_DIRS += uvcSupport
A *Support directory who's Makefile installs the appropriate header files and libraries:
SRC_DIRS += ../libuvc
INC += libuvc/libuvc.h
INC += libuvc/libuvc_config.h
INC += libuvc/libuvc_internal.h
INC += utlist.h
ifeq (linux-x86_64, $(findstring linux-x86_64, $(T_A)))
LIB_INSTALLS_Linux += ../libuvc/O.$(EPICS_HOST_ARCH)/libuvc.a
LIB_INSTALLS_Linux += ../libuvc/O.$(EPICS_HOST_ARCH)/libuvc.so
endif
And a directory containing modified source and header files designed to build with EPICS
for the helper library along with a Makefile to build them, located in the *Support dir:
LIBRARY = uvc
uvc_SRCS += ctrl.c
uvc_SRCS += ctrl-gen.c
uvc_SRCS += device.c
uvc_SRCS += diag.c
uvc_SRCS += frame.c
uvc_SRCS += frame-mjpeg.c
uvc_SRCS += init.c
uvc_SRCS += misc.c
uvc_SRCS += stream.c
uvc_LIBS += jpeg
uvc_SYS_LIBS += usb-1.0
This seems to build everything correctly, at least from the top level, however, I noticed that if I only run `make` from the *Support directory I get an error.
Ideally I'd like to be able to `make` the Support directory independently so some helper non-IOC programs can be built without building the entire IOC lib and
executable.
How would I go about doing this, or is the current solution the recommended "best practice"?
I currently have this sitting on a development branch here: https://github.com/areaDetector/ADUVC/tree/libuvc-epics-build
Thanks,
Jakub
- Replies:
- Re: Best practice for compiling helper support library via EPICS build system Wlodek, Jakub via Tech-talk
- References:
- Best practice for compiling helper support library via EPICS build system Wlodek, Jakub via Tech-talk
- Navigate by Date:
- Prev:
Best practice for compiling helper support library via EPICS build system Wlodek, Jakub via Tech-talk
- Next:
Re: Best practice for compiling helper support library via EPICS build system Wlodek, Jakub via Tech-talk
- 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
2018
2019
<2020>
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Best practice for compiling helper support library via EPICS build system Wlodek, Jakub via Tech-talk
- Next:
Re: Best practice for compiling helper support library via EPICS build system Wlodek, Jakub via Tech-talk
- 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
2018
2019
<2020>
2021
2022
2023
2024
|