Skip to content
Snippets Groups Projects
Commit 7dc67db6 authored by Anthony Mallet's avatar Anthony Mallet
Browse files

[wip/genom3] Add module.mk for inclusion in a genom3 module

The module.mk file defines the necessary stuff for compiling a genom3
component. In particular, it defines a list of options corresponding to each
available template and a PLIST.template common to all components.

Note: building separate binary packages for each template is currently not
possible in robotpkg. A directory corresponds very much to a single package,
and adding multi-packages without breaking higher level targets (like checkout,
package sets or bulk) will be very hard.
parent 53ff0f34
No related branches found
No related tags found
No related merge requests found
@comment Thu May 16 18:16:18 CEST 2013
@comment pocolibs/server
${PLIST.pocolibs-server}bin/${GENOM_MODULE}-pocolibs
@comment pocolibs/client/c
${PLIST.pocolibs-client-c}include/${GENOM_MODULE}/c/client.h
${PLIST.pocolibs-client-c}lib/genom/client/c/${GENOM_MODULE}.la
${PLIST.pocolibs-client-c}lib/lib${GENOM_MODULE}-c-client.la
${PLIST.pocolibs-client-c}lib/pkgconfig/${GENOM_MODULE}-c-client.pc
@comment ros/server
${PLIST.ros-server}bin/${GENOM_MODULE}-ros
@comment ros/client/c
${PLIST.ros-client-c}include/${GENOM_MODULE}/c/client.h
${PLIST.ros-client-c}lib/genom/client/c/${GENOM_MODULE}.la
${PLIST.ros-client-c}lib/lib${GENOM_MODULE}-c-client.la
${PLIST.ros-client-c}lib/pkgconfig/${GENOM_MODULE}-c-client.pc
@comment ros/client/ros is a dynamic PLIST generated by the template
@comment openprs/client
${PLIST.openprs}lib/genom/client/openprs/${GENOM_MODULE}-openprs-client.la
${PLIST.openprs}lib/pkgconfig/${GENOM_MODULE}-openprs-client.pc
${PLIST.openprs}share/openprs/site/${GENOM_MODULE}Openprs.inc
${PLIST.openprs}share/openprs/site/${GENOM_MODULE}Openprs.opf
${PLIST.openprs}share/openprs/site/${GENOM_MODULE}Openprs.sym
# robotpkg module.mk for: wip/genom3
# Created: Anthony Mallet on Tue May 14 2013
#
ifndef GENOM_MODULE_MK
GENOM_MODULE_MK=defined
# --- generic rules --------------------------------------------------------
GENOM_MODULE?= ${PKGBASE:-genom3=}
GENOM_ARGS?=
TEMPLATES_WRKDIR?= ${WRKDIR}/templates
CODELS_WRKSRC?= $(if $(filter codels,${PKG_OPTIONS}),${WRKSRC})
TMPL1_WRKSRC?=
TMPL2_WRKSRC?=
# codels must be configured/built before templates, and some templates require
# proper ordering (namely, openprs requires client-c).
CONFIGURE_DIRS?= ${CODELS_WRKSRC} ${TMPL1_WRKSRC} ${TMPL2_WRKSRC}
AUTORECONF_DIRS?= ${CODELS_WRKSRC}
GNU_CONFIGURE= yes
# inter-templates dependencies
PKG_CONFIG_DIRS+= ${CODELS_WRKSRC} ${TMPL1_WRKSRC} ${TMPL2_WRKSRC}
# generate a template
genom3-generate(%): .FORCE
@${STEP_MSG} "Generating $*"
${RUN}${CONFIGURE_LOGFILTER} ${GENOM3} ${GENOM_ARGS} \
$* -C ${TEMPLATES_WRKDIR}/$* ${WRKSRC}/${GENOM_MODULE}.gen
# autoreconf a template
genom3-autoreconf(%): genom3-generate(%)
@${STEP_MSG} "Running autoreconf for $*"
${RUN} cd ${TEMPLATES_WRKDIR}/$*; \
${CONFIGURE_LOGFILTER} ${SETENV} ${CONFIGURE_ENV} \
${AUTORECONF} -vif
# --- options --------------------------------------------------------------
PKG_OPTIONS_OPTIONAL_GROUPS+= client-c
# codels
PKG_SUPPORTED_OPTIONS+= codels
PKG_SUGGESTED_OPTIONS+= codels
PKG_OPTION_DESCR.codels= Build server codels
# pocolibs
PKG_SUPPORTED_OPTIONS+= pocolibs-server
PKG_OPTION_DESCR.pocolibs-server= Build a pocolibs server
define PKG_OPTION_SET.pocolibs-server
ifeq (,$(filter codels,${PKG_OPTIONS}))
PKG_FAIL_REASON+= "'pocolibs-server' option for ${PKGBASE} requires the"
PKG_FAIL_REASON+= "following options to be enabled:"
PKG_FAIL_REASON+= codels
endif
TMPL1_WRKSRC+= ${TEMPLATES_WRKDIR}/pocolibs/server
pre-configure: genom3-autoreconf(pocolibs/server)
include ../../middleware/pocolibs/depend.mk
include ../../wip/genom3-pocolibs/depend.mk
endef
PKG_OPTIONS_GROUP.client-c+= pocolibs-client-c
PKG_OPTION_DESCR.pocolibs-client-c= Build a pocolibs C client
define PKG_OPTION_SET.pocolibs-client-c
TMPL1_WRKSRC+= ${TEMPLATES_WRKDIR}/pocolibs/client/c
# XXX temporary
MAKE_JOBS_SAFE=no
pre-configure: genom3-autoreconf(pocolibs/client/c)
include ../../middleware/pocolibs/depend.mk
include ../../wip/genom3-pocolibs/depend.mk
endef
# ros
PKG_SUPPORTED_OPTIONS+= ros-server
PKG_OPTION_DESCR.ros-server= Build a ROS server
define PKG_OPTION_SET.ros-server
ifeq (,$(filter codels,${PKG_OPTIONS}))
PKG_FAIL_REASON+= "'ros-server' option for ${PKGBASE} requires the"
PKG_FAIL_REASON+= "following options to be enabled:"
PKG_FAIL_REASON+= codels
endif
TMPL1_WRKSRC+= ${TEMPLATES_WRKDIR}/ros/server
pre-configure: genom3-autoreconf(ros/server)
include ../../devel/boost-headers/depend.mk
include ../../devel/ros-core/depend.mk
include ../../interfaces/ros-common-msgs/depend.mk
include ../../middleware/ros-actionlib/depend.mk
include ../../middleware/ros-comm/depend.mk
include ../../wip/genom3-ros/depend.mk
include ../../mk/language/c++.mk
endef
PKG_OPTIONS_GROUP.client-c+= ros-client-c
PKG_OPTION_DESCR.ros-client-c= Build a ROS C client
define PKG_OPTION_SET.ros-client-c
TMPL1_WRKSRC+= ${TEMPLATES_WRKDIR}/ros/client/c
pre-configure: genom3-autoreconf(ros/client/c)
include ../../devel/boost-headers/depend.mk
include ../../devel/ros-core/depend.mk
include ../../interfaces/ros-common-msgs/depend.mk
include ../../middleware/ros-actionlib/depend.mk
include ../../middleware/ros-comm/depend.mk
include ../../wip/genom3-ros/depend.mk
include ../../mk/language/c++.mk
endef
PKG_SUPPORTED_OPTIONS+= ros-client-ros
PKG_OPTION_DESCR.ros-client-ros= Build a ROS client
define PKG_OPTION_SET.ros-client-ros
TMPL1_WRKSRC+= ${TEMPLATES_WRKDIR}/ros/client/ros
# the PLIST heavily depends on the actual list of services and .pyc/o files
# must be added.
GENERATE_PLIST+=\
${CAT} ${TEMPLATES_WRKDIR}/ros/client/ros/plist | ${AWK} ' \
{ sub("^${PREFIX}/?", ""); print } \
/[.]py$$/ { \
sub("[.]py$$", ""); \
n=match($$0, "/[^/]+$$"); p=substr($$0,1,n); s=substr($$0,n); \
print p "${PYTHON_PYCACHE}" s "${PYTHON_TAG}.pyc"; \
print p "${PYTHON_PYCACHE}" s "${PYTHON_TAG}.pyo"; \
} \
';
# hackish ... but this is for a PLIST.guess anyway, so nothing critical
PRINT_PLIST_AWK_FILTERS+=\
/include\/[$$]{GENOM_MODULE}\// {next} \
/[$$]{PYTHON_SITELIB}\/[$$]{GENOM_MODULE}\// {next} \
/share\/[$$]{GENOM_MODULE}\/manifest.xml$$/ {next} \
/share\/[$$]{GENOM_MODULE}\/msg/ {next} \
/share\/[$$]{GENOM_MODULE}\/srv/ {next}
pre-configure: genom3-autoreconf(ros/client/ros)
include ../../devel/boost-headers/depend.mk
include ../../devel/ros-core/depend.mk
include ../../interfaces/ros-common-msgs/depend.mk
include ../../middleware/ros-actionlib/depend.mk
include ../../middleware/ros-comm/depend.mk
include ../../wip/genom3-ros/depend.mk
include ../../mk/language/c++.mk
include ../../mk/sysdep/python.mk
endef
# openprs
PKG_SUPPORTED_OPTIONS+= openprs
PKG_OPTION_DESCR.openprs= Build an OpenPRS client
define PKG_OPTION_SET.openprs
ifeq (,$(filter %-client-c,${PKG_OPTIONS}))
PKG_FAIL_REASON+= "'openprs' option for ${PKGBASE} requires one of the"
PKG_FAIL_REASON+= "following options to be enabled:"
PKG_FAIL_REASON+= $(filter %-client-c,${PKG_SUPPORTED_OPTIONS})
endif
TMPL2_WRKSRC+= ${TEMPLATES_WRKDIR}/openprs/client
pre-configure: genom3-autoreconf(openprs/client)
include ../../supervision/openprs/depend.mk
include ../../wip/genom3-openprs/depend.mk
include ../../wip/transgen3/depend.mk
endef
# --- plist ----------------------------------------------------------------
# Add extra replacement in PLISTs and a generic template for standard genom
# files
PLIST_TEMPLATES= wip/genom3/PLIST.templates
PLIST_SUBST+= GENOM_MODULE=$(call quote,${GENOM_MODULE})
GENERATE_PLIST+= ${CAT} ${ROBOTPKG_DIR}/${PLIST_TEMPLATES};
PRINT_PLIST_AWK_SUBST+= gsub("${GENOM_MODULE}", "$${GENOM_MODULE}");
PRINT_PLIST_AWK_FILTERS=
PRINT_PLIST_FILTER+=\
${AWK} ' \
BEGIN { print "@comment includes ${PLIST_TEMPLATES}" } \
${PRINT_PLIST_AWK_FILTERS} \
NR > FNR { \
if (!($$0 in filter)) print "$${PLIST.codels}" $$0; next; \
} \
{ gsub("[$$]{PLIST[^}]*}", ""); filter[$$0] } \
' ${ROBOTPKG_DIR}/${PLIST_TEMPLATES} -;
# --- common dependencies --------------------------------------------------
include ../../pkgtools/libtool/depend.mk
include ../../pkgtools/pkg-config/depend.mk
include ../../mk/sysdep/autoconf.mk
include ../../mk/sysdep/automake.mk
include ../../wip/genom3/depend.mk
endif # GENOM_MODULE_MK
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment