2007-11-25 03:23:01 -07:00
|
|
|
|
# $OpenBSD: bsd.xorg.mk,v 1.22 2007/11/25 10:23:01 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
|
|
|
|
|
AUTOCONF_VERSION= 2.59
|
|
|
|
|
|
|
|
|
|
# Where source lives
|
2007-03-31 14:25:53 -06:00
|
|
|
|
XSRCDIR?= /usr/src/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)
|
|
|
|
|
|
2007-03-28 13:38:57 -06:00
|
|
|
|
CONFIGURE_ENV= PKG_CONFIG_LIBDIR="$(PKG_CONFIG_LIBDIR)" \
|
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
|
|
|
|
|
|
|
|
|
.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"
|
2007-03-28 13:38:57 -06:00
|
|
|
|
cd ${.CURDIR}; ${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 \
|
|
|
|
|
cd ${.CURDIR}; \
|
|
|
|
|
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
|
2007-03-28 13:38:57 -06:00
|
|
|
|
${CONFIGURE_ENV} exec sh ${.CURDIR}/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:
|
2007-03-28 13:38:57 -06:00
|
|
|
|
-@if [ -e Makefile ]; then exec ${MAKE} clean; fi
|
2006-11-25 07:56:32 -07:00
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
.if !target(cleandir)
|
|
|
|
|
cleandir: clean
|
2007-03-28 13:38:57 -06:00
|
|
|
|
-@if [ -e 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>
|