2009-05-22 09:46:13 -06:00
|
|
|
|
# $OpenBSD: bsd.xorg.mk,v 1.32 2009/05/22 15:46:13 matthieu Exp $ -*- makefile -*-
|
2006-11-25 07:56:32 -07:00
|
|
|
|
#
|
|
|
|
|
# Copyright <20> 2006 Matthieu Herrb
|
|
|
|
|
#
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|
|
AUTOMAKE_VERSION= 1.9
|
2009-05-02 07:51:29 -06:00
|
|
|
|
AUTOCONF_VERSION= 2.62
|
2009-05-22 09:34:15 -06:00
|
|
|
|
PYTHON_VERSION= 2.6
|
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
|
|
|
|
|
MANDIR= ${X11BASE}/man/cat
|
|
|
|
|
|
2007-02-04 16:15:27 -07:00
|
|
|
|
PKG_CONFIG_LIBDIR= ${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
|
|
|
|
|
INSTALL_DATA = ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 644
|
|
|
|
|
|
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}
|
|
|
|
|
|
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-25 03:23:01 -07:00
|
|
|
|
XMLTO=: \
|
2007-11-05 09:51:37 -07:00
|
|
|
|
CFLAGS="$(CFLAGS:C/ *$//)" \
|
|
|
|
|
MAKE="${MAKE}"
|
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)
|
2009-05-22 09:34:15 -06:00
|
|
|
|
.if !defined(PACKAGE_VERSION)
|
2008-08-20 23:54:41 -06:00
|
|
|
|
PACKAGE_VERSION!=m4 ${XSRCDIR}/share/mk/package_version.m4 ${_SRCDIR}/configure.ac
|
2009-05-22 09:34:15 -06:00
|
|
|
|
.endif
|
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' \
|
|
|
|
|
-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
|
2007-03-28 13:38:57 -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
|
|
|
|
|
@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
|
2006-12-31 03:55:41 -07:00
|
|
|
|
.endif
|
2008-08-20 23:54:41 -06:00
|
|
|
|
${CONFIGURE_ENV} 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)
|
|
|
|
|
depend:
|
|
|
|
|
@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:
|
2007-03-28 13:38:57 -06:00
|
|
|
|
exec ${MAKE} ${_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:
|
2007-03-28 13:38:57 -06:00
|
|
|
|
cd ${.CURDIR} && exec ${MAKE} ${_wrapper} cleandir
|
|
|
|
|
cd ${.CURDIR} && exec ${MAKE} ${_wrapper} depend
|
|
|
|
|
cd ${.CURDIR} && exec ${MAKE} ${_wrapper} all
|
|
|
|
|
cd ${.CURDIR} && exec ${SUDO} ${MAKE} ${_wrapper} install
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
.if !target(clean)
|
|
|
|
|
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
|
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
|
|
|
|
|
|
|
|
|
|
. if defined(OBJMACHINE)
|
|
|
|
|
__objdir= obj.$(MACHINE)
|
|
|
|
|
. else
|
|
|
|
|
__objdir= obj
|
|
|
|
|
. endif
|
|
|
|
|
|
2007-03-31 14:25:53 -06:00
|
|
|
|
. if defined(XOBJMACHINE)
|
|
|
|
|
__xobjdir= $(XOBJDIR).$(MACHINE)
|
2006-12-02 09:28:48 -07:00
|
|
|
|
__xobjdirpf=
|
|
|
|
|
. else
|
2007-03-31 14:25:53 -06:00
|
|
|
|
__xobjdir= $(XOBJDIR)
|
2006-12-02 09:28:48 -07:00
|
|
|
|
. if defined(OBJMACHINE)
|
|
|
|
|
__xobjdirpf= .$(MACHINE)
|
|
|
|
|
. else
|
|
|
|
|
__xobjdirpf=
|
|
|
|
|
. endif
|
|
|
|
|
. 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 \
|
|
|
|
|
dest=${__xobjdir}/$$subdir${__xobjdirpf}; \
|
|
|
|
|
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; \
|
2007-05-01 02:31:47 -06:00
|
|
|
|
if test -d ${__xobjdir}; then \
|
|
|
|
|
test -d $$dest || mkdir -p $$dest; \
|
2006-12-02 09:28:48 -07:00
|
|
|
|
else \
|
2007-05-01 02:31:47 -06:00
|
|
|
|
if test -e ${__xobjdir}; then \
|
|
|
|
|
echo "${__xobjdir} is not a directory"; \
|
|
|
|
|
else \
|
|
|
|
|
echo "${__xobjdir} does not exist"; \
|
|
|
|
|
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>
|