2014-08-24 09:53:08 -06:00
|
|
|
|
# $OpenBSD: bsd.xorg.mk,v 1.51 2014/08/24 15:53:08 matthieu Exp $ -*- makefile -*-
|
2006-11-25 07:56:32 -07:00
|
|
|
|
#
|
2012-03-11 04:08:59 -06:00
|
|
|
|
# Copyright <20> 2006,2012 Matthieu Herrb
|
2006-11-25 07:56:32 -07:00
|
|
|
|
#
|
|
|
|
|
# Permission to use, copy, modify, and distribute this software for any
|
|
|
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
|
|
|
# copyright notice and this permission notice appear in all copies.
|
|
|
|
|
#
|
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
|
.endif
|
|
|
|
|
|
2012-08-04 11:10:01 -06:00
|
|
|
|
AUTOMAKE_VERSION= 1.12
|
2012-08-05 12:08:05 -06:00
|
|
|
|
AUTOCONF_VERSION= 2.69
|
2012-03-11 04:08:59 -06:00
|
|
|
|
PYTHON_VERSION= 2.7
|
2006-11-25 07:56:32 -07:00
|
|
|
|
|
|
|
|
|
# Where source lives
|
2008-03-03 00:01:44 -07:00
|
|
|
|
XSRCDIR?= /usr/xenocara
|
2006-11-25 07:56:32 -07:00
|
|
|
|
|
2006-12-02 09:28:48 -07:00
|
|
|
|
# Where to build
|
2007-03-31 14:25:53 -06:00
|
|
|
|
XOBJDIR?= /usr/xobj
|
2006-11-25 07:56:32 -07:00
|
|
|
|
|
|
|
|
|
# Where to install
|
2006-11-28 06:43:46 -07:00
|
|
|
|
BINDIR?= ${X11BASE}/bin
|
2006-11-25 07:56:32 -07:00
|
|
|
|
LIBDIR= ${X11BASE}/lib
|
|
|
|
|
INCSDIR= ${X11BASE}/include
|
2011-06-23 16:48:59 -06:00
|
|
|
|
MANDIR= ${X11BASE}/man/man
|
2006-11-25 07:56:32 -07:00
|
|
|
|
|
2014-05-18 04:29:01 -06:00
|
|
|
|
PKG_CONFIG_LIBDIR= /usr/lib/pkgconfig:${X11BASE}/lib/pkgconfig
|
2006-11-25 07:56:32 -07:00
|
|
|
|
|
2007-03-30 11:24:12 -06:00
|
|
|
|
# A few aliases for *-install targets
|
2010-05-08 04:32:12 -06:00
|
|
|
|
INSTALL_DATA = \
|
|
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${SHAREMODE}
|
2007-03-30 11:24:12 -06:00
|
|
|
|
|
2006-12-31 03:55:41 -07:00
|
|
|
|
# Autoconf cache
|
2007-03-31 14:25:53 -06:00
|
|
|
|
_cache= --cache-file=${XOBJDIR}/xorg-config.cache.${MACHINE}
|
2006-11-25 07:56:32 -07:00
|
|
|
|
|
2006-12-31 09:00:03 -07:00
|
|
|
|
CFLAGS+= $(COPTS)
|
|
|
|
|
|
2008-05-11 14:58:10 -06:00
|
|
|
|
.if !defined(CONFIG_SITE)
|
|
|
|
|
CONFIG_SITE= ${XSRCDIR}/etc/config.site
|
|
|
|
|
.endif
|
|
|
|
|
|
2008-08-20 23:54:41 -06:00
|
|
|
|
_SRCDIR?= ${.CURDIR}
|
|
|
|
|
|
2010-08-04 16:50:51 -06:00
|
|
|
|
XENOCARA_PATH?= /bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
|
|
|
|
|
|
2007-03-28 13:38:57 -06:00
|
|
|
|
CONFIGURE_ENV= PKG_CONFIG_LIBDIR="$(PKG_CONFIG_LIBDIR)" \
|
2008-05-11 14:58:10 -06:00
|
|
|
|
CONFIG_SITE=$(CONFIG_SITE) \
|
2007-11-05 09:51:37 -07:00
|
|
|
|
CFLAGS="$(CFLAGS:C/ *$//)" \
|
|
|
|
|
MAKE="${MAKE}"
|
2007-03-28 13:38:57 -06:00
|
|
|
|
|
2012-08-04 11:10:01 -06:00
|
|
|
|
CONFIGURE_ARGS+= --disable-silent-rules
|
|
|
|
|
|
2007-03-28 13:38:57 -06:00
|
|
|
|
AUTOTOOLS_ENV= AUTOMAKE_VERSION="$(AUTOMAKE_VERSION)" \
|
2006-11-25 07:56:32 -07:00
|
|
|
|
AUTOCONF_VERSION="$(AUTOCONF_VERSION)" \
|
|
|
|
|
ACLOCAL="aclocal -I ${X11BASE}/share/aclocal" \
|
2007-03-28 13:38:57 -06:00
|
|
|
|
$(CONFIGURE_ENV)
|
2006-11-25 07:56:32 -07:00
|
|
|
|
|
2008-03-25 17:28:19 -06:00
|
|
|
|
##
|
|
|
|
|
## Default rules
|
|
|
|
|
##
|
|
|
|
|
|
|
|
|
|
# pkgconfig
|
|
|
|
|
.if defined(PKGCONFIG)
|
2012-11-03 09:19:02 -06:00
|
|
|
|
|
|
|
|
|
PACKAGE_VERSION ?= `m4 ${DESTDIR}${X11BASE}/share/mk/package_version.m4 ${_SRCDIR}/configure.ac`
|
2008-03-25 17:28:19 -06:00
|
|
|
|
|
2009-05-22 09:09:28 -06:00
|
|
|
|
all: ${PKGCONFIG}
|
2008-03-25 17:28:19 -06:00
|
|
|
|
|
|
|
|
|
${PKGCONFIG}: ${PKGCONFIG}.in
|
|
|
|
|
@sed -e 's#@prefix@#${X11BASE}#g' \
|
2009-05-22 09:21:21 -06:00
|
|
|
|
-e 's#@datarootdir@#$${prefix}/share#g' \
|
|
|
|
|
-e 's#@datadir@#$${datarootdir}#g' \
|
2008-03-25 17:28:19 -06:00
|
|
|
|
-e 's#@exec_prefix@#$${prefix}#g' \
|
|
|
|
|
-e 's#@libdir@#$${exec_prefix}/lib#g' \
|
|
|
|
|
-e 's#@includedir@#$${prefix}/include#g' \
|
2012-11-03 09:19:02 -06:00
|
|
|
|
-e 's#@PACKAGE_VERSION@#'${PACKAGE_VERSION}'#g' \
|
2009-05-22 09:21:21 -06:00
|
|
|
|
${EXTRA_PKGCONFIG_SUBST} \
|
2009-05-22 09:46:13 -06:00
|
|
|
|
< $? > $@
|
2008-03-25 17:28:19 -06:00
|
|
|
|
|
2009-05-22 09:09:28 -06:00
|
|
|
|
install-pc: ${PKGCONFIG}
|
2008-03-25 17:28:19 -06:00
|
|
|
|
${INSTALL_DATA} ${PKGCONFIG} ${DESTDIR}${LIBDIR}/pkgconfig
|
|
|
|
|
|
2009-05-22 09:09:28 -06:00
|
|
|
|
clean-pc:
|
|
|
|
|
rm -rf ${PKGCONFIG}
|
|
|
|
|
|
|
|
|
|
realinstall: install-pc
|
|
|
|
|
|
|
|
|
|
clean: clean-pc
|
|
|
|
|
|
|
|
|
|
|
2008-03-25 17:28:19 -06:00
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
# headers
|
|
|
|
|
.if defined(HEADERS)
|
2009-05-22 09:09:28 -06:00
|
|
|
|
install-headers:
|
2008-03-25 17:28:19 -06:00
|
|
|
|
@echo installing ${HEADERS} in ${INCSDIR}/${HEADERS_SUBDIR}
|
2008-08-20 23:54:41 -06:00
|
|
|
|
@cd ${_SRCDIR}; for i in ${HEADERS}; do \
|
2008-03-25 17:28:19 -06:00
|
|
|
|
cmp -s $$i ${DESTDIR}${INCSDIR}/${HEADERS_SUBDIR}$$i || \
|
|
|
|
|
${INSTALL_DATA} $$i ${DESTDIR}${INCSDIR}/${HEADERS_SUBDIR}$$i;\
|
|
|
|
|
done
|
2009-05-22 09:09:28 -06:00
|
|
|
|
|
|
|
|
|
realinstall: install-headers
|
2008-03-25 17:28:19 -06:00
|
|
|
|
.endif
|
|
|
|
|
.if defined(HEADERS_SUBDIRS)
|
|
|
|
|
.for d in ${HEADERS_SUBDIRS}
|
2009-05-22 09:09:28 -06:00
|
|
|
|
install-headers-subdirs::
|
2008-03-25 17:28:19 -06:00
|
|
|
|
@echo installing ${HEADERS_${d:S/\//_/}} in ${INCSDIR}/${d}
|
2008-08-20 23:54:41 -06:00
|
|
|
|
@cd ${_SRCDIR}; for i in ${HEADERS_${d:S/\//_/}}; do \
|
2008-03-25 17:28:19 -06:00
|
|
|
|
cmp -s $$i ${DESTDIR}${INCSDIR}/$d/$$i || \
|
|
|
|
|
${INSTALL_DATA} $$i ${DESTDIR}${INCSDIR}/${d}; \
|
|
|
|
|
done
|
2009-05-22 09:09:28 -06:00
|
|
|
|
|
|
|
|
|
realinstall: install-headers-subdirs
|
2008-03-25 17:28:19 -06:00
|
|
|
|
.endfor
|
|
|
|
|
.endif
|
|
|
|
|
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.if !target(.MAIN)
|
|
|
|
|
.MAIN: all
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
.if !target(includes)
|
2006-12-17 13:41:36 -07:00
|
|
|
|
includes: _SUBDIRUSE
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
.if defined(SHARED_LIBS)
|
|
|
|
|
_lt_libs=
|
|
|
|
|
.for _n _v in ${SHARED_LIBS}
|
|
|
|
|
_lt_libs+=lib${_n:S/+/_/g:S/-/_/g:S/./_/g}_ltversion=${_v}
|
|
|
|
|
.endfor
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
.if !target(all)
|
|
|
|
|
all: config.status
|
2014-08-24 09:53:08 -06:00
|
|
|
|
@exec ${MAKE} ${_lt_libs}
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.endif
|
|
|
|
|
|
2007-03-17 13:32:41 -06:00
|
|
|
|
|
|
|
|
|
REORDER_DEPENDENCIES += ${X11BASE}/share/mk/automake.dep
|
2007-03-30 01:11:06 -06:00
|
|
|
|
ECHO_REORDER ?= :
|
2007-03-17 13:32:41 -06:00
|
|
|
|
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.if !target(config.status)
|
2006-12-31 03:55:41 -07:00
|
|
|
|
config.status:
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.if defined(XENOCARA_RERUN_AUTOCONF) && ${XENOCARA_RERUN_AUTOCONF:L} == "yes"
|
2008-08-20 23:54:41 -06:00
|
|
|
|
cd ${_SRCDIR}; ${AUTOTOOLS_ENV} exec autoreconf -v --install --force
|
2007-03-17 13:32:41 -06:00
|
|
|
|
.else
|
2012-08-08 15:54:33 -06:00
|
|
|
|
.if !defined(NO_REORDER)
|
2007-03-17 13:32:41 -06:00
|
|
|
|
@sed -e '/^#/d' ${REORDER_DEPENDENCIES} | \
|
|
|
|
|
tsort -r|while read f; do \
|
2008-08-20 23:54:41 -06:00
|
|
|
|
cd ${_SRCDIR}; \
|
2007-03-17 13:32:41 -06:00
|
|
|
|
case $$f in \
|
|
|
|
|
/*) \
|
|
|
|
|
find . -name $${f#/} -print| while read i; \
|
2007-03-30 01:11:06 -06:00
|
|
|
|
do ${ECHO_REORDER} "Touching $$i"; touch $$i; done \
|
2007-03-17 13:32:41 -06:00
|
|
|
|
;; \
|
|
|
|
|
*) \
|
|
|
|
|
if test -e $$f ; then \
|
2007-03-30 01:11:06 -06:00
|
|
|
|
${ECHO_REORDER} "Touching $$f"; touch $$f; \
|
2007-03-17 13:32:41 -06:00
|
|
|
|
fi \
|
|
|
|
|
;; \
|
|
|
|
|
esac; done
|
2012-08-08 15:54:33 -06:00
|
|
|
|
.endif
|
2006-12-31 03:55:41 -07:00
|
|
|
|
.endif
|
2010-08-04 16:56:00 -06:00
|
|
|
|
${CONFIGURE_ENV} PATH=$(XENOCARA_PATH) \
|
|
|
|
|
exec sh ${_SRCDIR}/configure --prefix=${X11BASE} \
|
2006-11-25 07:56:32 -07:00
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
|
--mandir=${X11BASE}/man \
|
|
|
|
|
${_cache} \
|
|
|
|
|
${CONFIGURE_ARGS}
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
.if !target(depend)
|
2012-03-11 04:08:59 -06:00
|
|
|
|
depend:
|
2006-11-25 07:56:32 -07:00
|
|
|
|
@echo "no dependencies here yet"
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
.if !target(install)
|
2006-12-17 13:41:36 -07:00
|
|
|
|
. if !target(beforeinstall)
|
|
|
|
|
beforeinstall:
|
|
|
|
|
. endif
|
|
|
|
|
. if !target(afterinstall)
|
|
|
|
|
afterinstall:
|
|
|
|
|
. endif
|
|
|
|
|
. if !target(realinstall)
|
|
|
|
|
realinstall:
|
2013-04-14 13:57:40 -06:00
|
|
|
|
exec ${MAKE} ${MAKE_FLAGS} ${_lt_libs} install
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.endif
|
2006-12-17 13:41:36 -07:00
|
|
|
|
install: maninstall
|
|
|
|
|
maninstall: afterinstall
|
|
|
|
|
afterinstall: realinstall
|
|
|
|
|
realinstall: beforeinstall
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
.if !target(build)
|
|
|
|
|
.if exists(Makefile.bsd-wrapper)
|
|
|
|
|
_wrapper = -f Makefile.bsd-wrapper
|
|
|
|
|
.endif
|
|
|
|
|
build:
|
2013-04-14 13:57:40 -06:00
|
|
|
|
cd ${.CURDIR} && exec ${MAKE} ${MAKE_FLAGS} ${_wrapper} cleandir
|
|
|
|
|
cd ${.CURDIR} && exec ${MAKE} ${MAKE_FLAGS} ${_wrapper} depend
|
|
|
|
|
cd ${.CURDIR} && exec ${MAKE} ${MAKE_FLAGS} ${_wrapper} all
|
|
|
|
|
cd ${.CURDIR} && exec ${SUDO} ${MAKE} ${MAKE_FLAGS} ${_wrapper} install
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.endif
|
|
|
|
|
|
2012-08-21 14:18:48 -06:00
|
|
|
|
.if !target(clean) && ${MAKEFILE:T} != "Makefile"
|
2006-11-25 07:56:32 -07:00
|
|
|
|
clean:
|
2009-05-22 09:03:03 -06:00
|
|
|
|
-@if [ -f Makefile ]; then exec ${MAKE} clean; fi
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
.if !target(cleandir)
|
|
|
|
|
cleandir: clean
|
2009-05-22 09:03:03 -06:00
|
|
|
|
-@if [ -f Makefile ]; then exec ${MAKE} distclean; fi
|
2011-11-05 05:49:01 -06:00
|
|
|
|
-@if [ -f config.status ]; then \
|
|
|
|
|
echo "rm config.status"; \
|
|
|
|
|
rm -f config.status; \
|
|
|
|
|
fi
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.endif
|
|
|
|
|
|
2006-12-02 09:28:48 -07:00
|
|
|
|
#
|
|
|
|
|
# Obj dir rules for xenocara
|
|
|
|
|
#
|
|
|
|
|
.if !target(_xenocara_obj)
|
|
|
|
|
. if defined(NOOBJ)
|
|
|
|
|
_xenocara_obj:
|
|
|
|
|
. else
|
|
|
|
|
|
2013-11-22 08:44:48 -07:00
|
|
|
|
. if defined(MAKEOBJDIR)
|
|
|
|
|
__objdir= ${MAKEOBJDIR}
|
2006-12-02 09:28:48 -07:00
|
|
|
|
. else
|
|
|
|
|
__objdir= obj
|
|
|
|
|
. endif
|
|
|
|
|
|
|
|
|
|
_SUBDIRUSE:
|
|
|
|
|
|
|
|
|
|
_xenocara_obj! _SUBDIRUSE
|
|
|
|
|
@cd $(.CURDIR); \
|
2007-03-31 14:25:53 -06:00
|
|
|
|
here=`/bin/pwd`; xsrcdir=`cd $(XSRCDIR); /bin/pwd`; \
|
|
|
|
|
subdir=$${here#$${xsrcdir}/}; \
|
2006-12-02 09:28:48 -07:00
|
|
|
|
if test $$here != $$subdir ; then \
|
2013-11-22 08:44:48 -07:00
|
|
|
|
dest=${XOBJDIR}/$$subdir; \
|
2006-12-02 09:28:48 -07:00
|
|
|
|
echo "$$here/${__objdir} -> $$dest"; \
|
|
|
|
|
if test ! -L ${__objdir} -o \
|
|
|
|
|
X`readlink ${__objdir}` != X$$dest; then \
|
|
|
|
|
if test -e ${__objdir}; then rm -rf ${__objdir}; fi; \
|
|
|
|
|
ln -sf $$dest ${__objdir}; \
|
|
|
|
|
fi; \
|
2013-11-22 08:44:48 -07:00
|
|
|
|
if test -d ${XOBJDIR}; then \
|
2007-05-01 02:31:47 -06:00
|
|
|
|
test -d $$dest || mkdir -p $$dest; \
|
2006-12-02 09:28:48 -07:00
|
|
|
|
else \
|
2013-11-22 08:44:48 -07:00
|
|
|
|
if test -e ${XOBJDIR}; then \
|
|
|
|
|
echo "${XOBJDIR} is not a directory"; \
|
2007-05-01 02:31:47 -06:00
|
|
|
|
else \
|
2013-11-22 08:44:48 -07:00
|
|
|
|
echo "${XOBJDIR} does not exist"; \
|
2007-05-01 02:31:47 -06:00
|
|
|
|
fi; \
|
2006-12-02 09:28:48 -07:00
|
|
|
|
fi; \
|
|
|
|
|
else \
|
|
|
|
|
dest=$$here/${__objdir}; \
|
|
|
|
|
if test ! -d ${__objdir}; then \
|
|
|
|
|
echo "making $$dest"; \
|
|
|
|
|
mkdir $$dest; \
|
|
|
|
|
fi ; \
|
|
|
|
|
fi
|
|
|
|
|
. endif
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
.if !target(obj)
|
|
|
|
|
obj: _xenocara_obj
|
|
|
|
|
.endif
|
2006-12-17 13:41:36 -07:00
|
|
|
|
|
|
|
|
|
.include <bsd.subdir.mk>
|