2011-07-25 02:03:17 +00:00
#
2012-04-30 06:01:11 +00:00
# atheme buildsys.mk
# Copyright (c) 2012 William Pitcock <nenolod@dereferenced.org>
#
# Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012
# Jonathan Schleifer <js@webkeks.org>
2011-07-25 02:03:17 +00:00
#
2012-04-30 06:01:11 +00:00
# Based on buildsys.mk:
# https://webkeks.org/git/?p=buildsys.git
2011-07-25 02:03:17 +00:00
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice is present in all copies.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
2012-04-30 06:01:11 +00:00
#V=1
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
2011-07-25 02:03:17 +00:00
AS = @AS@
CC = @CC@
CXX = @CXX@
CPP = @CPP@
DC = @DC@
ERLC = @ERLC@
OBJC = @OBJC@
OBJCXX = @OBJCXX@
AR = @AR@
LD = ${ CC }
RANLIB = @RANLIB@
PYTHON = @PYTHON@
ASFLAGS = @ASFLAGS@
CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
CPPFLAGS = @CPPFLAGS@
DFLAGS = @DFLAGS@
ERLCFLAGS = @ERLCFLAGS@
OBJCFLAGS = @OBJCFLAGS@
OBJCXXFLAGS = @OBJCXXFLAGS@
LDFLAGS = @LDFLAGS@
2012-04-30 06:01:11 +00:00
LDFLAGS_RPATH = @LDFLAGS_RPATH@
2011-07-25 02:03:17 +00:00
LIBS = @LIBS@
PYTHON_FLAGS = @PYTHON_FLAGS@
PROG_IMPLIB_NEEDED = @PROG_IMPLIB_NEEDED@
PROG_IMPLIB_LDFLAGS = @PROG_IMPLIB_LDFLAGS@
PROG_SUFFIX = @EXEEXT@
LIB_CFLAGS = @LIB_CFLAGS@
LIB_LDFLAGS = @LIB_LDFLAGS@
LIB_PREFIX = @LIB_PREFIX@
LIB_SUFFIX = @LIB_SUFFIX@
PLUGIN_CFLAGS = @PLUGIN_CFLAGS@
PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@
PLUGIN_SUFFIX = @PLUGIN_SUFFIX@
INSTALL_LIB = @INSTALL_LIB@
UNINSTALL_LIB = @UNINSTALL_LIB@
CLEAN_LIB = @CLEAN_LIB@
LN_S = @LN_S@
MKDIR_P = mkdir -p
INSTALL = @INSTALL@
SHELL = @SHELL@
MSGFMT = @MSGFMT@
2012-04-30 06:01:11 +00:00
JAVAC = @JAVAC@
JAVACFLAGS = @JAVACFLAGS@
JAR = @JAR@
WINDRES = @WINDRES@
2011-07-25 02:03:17 +00:00
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
2012-04-30 06:01:11 +00:00
plugindir ?= ${ libdir } /${ PACKAGE_NAME }
2011-07-25 02:03:17 +00:00
datarootdir = @datarootdir@
datadir = @datadir@
includedir = @includedir@
2012-04-30 06:01:11 +00:00
includesubdir ?= ${ PACKAGE_NAME }
2011-07-25 02:03:17 +00:00
localedir = @localedir@
2012-04-30 06:01:11 +00:00
localename ?= ${ PACKAGE_NAME }
2011-07-25 02:03:17 +00:00
mandir = @mandir@
mansubdir ?= man1
2012-04-30 06:01:11 +00:00
OBJS1 = ${ SRCS : .c=.o }
OBJS2 = ${ OBJS1 : .cc=.o }
OBJS3 = ${ OBJS2 : .cxx=.o }
OBJS4 = ${ OBJS3 : .d=.o }
OBJS5 = ${ OBJS4 : .erl=.beam }
OBJS6 = ${ OBJS5 : .java=.class }
OBJS7 = ${ OBJS6 : .m=.o }
OBJS8 = ${ OBJS7 : .mm=.o }
OBJS9 = ${ OBJS8 : .py=.pyc }
OBJS10 = ${ OBJS9 : .rc=.o }
OBJS11 = ${ OBJS10 : .S=.o }
OBJS += ${ OBJS11 : .xpm=.o }
LIB_OBJS = ${ OBJS : .o=.lib.o }
PLUGIN_OBJS = ${ OBJS : .o=.plugin.o }
2011-07-25 02:03:17 +00:00
MO_FILES = ${ LOCALES : .po=.mo }
2012-04-30 06:01:11 +00:00
DEPFILES = $( patsubst %,%.dep,${ SRCS } )
2011-07-25 02:03:17 +00:00
.SILENT :
.SUFFIXES :
2012-04-30 06:01:11 +00:00
.SUFFIXES : .beam .c .c .dep .cc .cc .dep .class .cxx .cxx .dep .d .erl .lib .o .java .mo .m .m .dep .mm .mm .dep .o .plugin .o .po .py .pyc .rc .S .S .dep .xpm
.PHONY : all subdirs ${SUBDIRS } pre -depend depend install install -extra uninstall uninstall -extra clean distclean locales
2011-07-25 02:03:17 +00:00
2012-04-30 06:01:11 +00:00
all : subdirs depend ${STATIC_LIB } ${STATIC_LIB_NOINST } ${STATIC_PIC_LIB } ${STATIC_PIC_LIB_NOINST } ${SHARED_LIB } ${SHARED_LIB_NOINST } ${PLUGIN } ${PLUGIN_NOINST } ${PROG } ${PROG_NOINST } ${JARFILE } locales
2011-07-25 02:03:17 +00:00
2012-04-30 06:01:11 +00:00
subdirs : ${SUBDIRS }
${SUBDIRS} :
${ MAKE } -C $@ ${ MFLAGS }
2011-07-25 02:03:17 +00:00
2012-04-30 06:01:11 +00:00
depend : pre -depend ${DEPFILES }
pre-depend :
.c.c.dep :
${ CPP } ${ CPPFLAGS } ${ CFLAGS } -M $< | \
sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \
{ rm -f $@ ; false; }
.cc.cc.dep .cxx.cxx.dep :
${ CPP } ${ CPPFLAGS } ${ CXXFLAGS } -M $< | \
sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \
{ rm -f $@ ; false; }
.m.m.dep :
${ CPP } ${ CPPFLAGS } ${ OBJCFLAGS } -M $< | \
sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \
{ rm -f $@ ; false; }
.mm.mm.dep :
${ CPP } ${ CPPFLAGS } ${ OBJCPPFLAGS } -M $< | \
sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \
{ rm -f $@ ; false; }
.S.S.dep :
${ CPP } ${ CPPFLAGS } ${ ASFLAGS } -M $< | \
sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.plugin.o:/' >$@ || \
{ rm -f $@ ; false; }
echo-cmd = $( if $( $( QUIET) $( 1) ) ,$( info $( phase_$( 1) ) : $( $( QUIET) $( 1) ) ) )
${PROG} ${PROG_NOINST} : ${EXT_DEPS } ${OBJS } ${OBJS_EXTRA }
LDOBJS = " ${ OBJS } ${ OBJS_EXTRA } " ; \
${ LINK_STATUS } ; \
if ${ LD } -o $@ ${ OBJS } ${ OBJS_EXTRA } ${ LDFLAGS } ${ LIBS } ; then \
${ LINK_OK } ; \
else \
${ LINK_FAILED } ; \
fi
2011-07-25 02:03:17 +00:00
2012-04-30 06:01:11 +00:00
${JARFILE} : ${EXT_DEPS } ${JAR_MANIFEST } ${OBJS } ${OBJS_EXTRA }
${ LINK_STATUS }
if test x" ${ JAR_MANIFEST } " != x"" ; then \
if ${ JAR } cfm ${ JARFILE } ${ JAR_MANIFEST } ${ OBJS } ${ OBJS_EXTRA } ; then \
${ LINK_OK } ; \
else \
${ LINK_FAILED } ; \
fi \
else \
if ${ JAR } cf ${ JARFILE } ${ OBJS } ${ OBJS_EXTRA } ; then \
${ LINK_OK } ; \
else \
${ LINK_FAILED } ; \
fi \
fi
${SHARED_LIB} ${SHARED_LIB_NOINST} : ${EXT_DEPS } ${LIB_OBJS } ${LIB_OBJS_EXTRA }
LDOBJS = " ${ LIB_OBJS } ${ LIB_OBJS_EXTRA } " ; \
${ LINK_STATUS } ; \
objs = "" ; \
ars = "" ; \
for i in ${ LIB_OBJS } ${ LIB_OBJS_EXTRA } ; do \
2011-07-25 02:03:17 +00:00
case $$ i in \
2012-04-30 06:01:11 +00:00
*.a) \
ars = " $$ ars $$ i " \
2011-07-25 02:03:17 +00:00
; ; \
2012-04-30 06:01:11 +00:00
*.o) \
objs = " $$ objs $$ i " \
2011-07-25 02:03:17 +00:00
; ; \
2012-04-30 06:01:11 +00:00
esac \
done ; \
for i in $$ ars; do \
dir = " . $$ (echo $$ i | sed 's/\//_/g').objs " ; \
rm -fr $$ dir; \
mkdir -p $$ dir; \
cd $$ dir; \
${ AR } x ../$$ i; \
for j in *.o; do \
objs = " $$ objs $$ dir/ $$ j " ; \
done ; \
cd ..; \
done ; \
if ${ LD } -o $@ $$ objs ${ LIB_LDFLAGS } ${ LDFLAGS } ${ LIBS } ; then \
${ LINK_OK } ; \
else \
${ LINK_FAILED } ; \
fi ; \
for i in $$ ars; do \
dir = " . $$ (echo $$ i | sed 's/\//_/g').objs " ; \
rm -fr $$ dir; \
done
${PLUGIN} ${PLUGIN_NOINST} : ${EXT_DEPS } ${PLUGIN_OBJS }
LDOBJS = " ${ PLUGIN_OBJS } " ; \
${ LINK_STATUS } ; \
objs = "" ; \
ars = "" ; \
for i in ${ PLUGIN_OBJS } ; do \
case $$ i in \
*.a) \
ars = " $$ ars $$ i " \
2011-07-25 02:03:17 +00:00
; ; \
2012-04-30 06:01:11 +00:00
*.o) \
objs = " $$ objs $$ i " \
2011-07-25 02:03:17 +00:00
; ; \
2012-04-30 06:01:11 +00:00
esac \
2011-07-25 02:03:17 +00:00
done ; \
2012-04-30 06:01:11 +00:00
for i in $$ ars; do \
dir = " . $$ (echo $$ i | sed 's/\//_/g').objs " ; \
rm -fr $$ dir; \
mkdir -p $$ dir; \
cd $$ dir; \
${ AR } x ../$$ i; \
for j in *.o; do \
objs = " $$ objs $$ dir/ $$ j " ; \
done ; \
cd ..; \
done ; \
if ${ LD } -o $@ $$ objs ${ PLUGIN_LDFLAGS } ${ LDFLAGS } ${ LIBS } ; then \
2011-07-25 02:03:17 +00:00
${ LINK_OK } ; \
else \
${ LINK_FAILED } ; \
2012-04-30 06:01:11 +00:00
fi ; \
for i in $$ ars; do \
dir = " . $$ (echo $$ i | sed 's/\//_/g').objs " ; \
rm -fr $$ dir; \
done
2011-07-25 02:03:17 +00:00
2012-04-30 06:01:11 +00:00
${STATIC_LIB} ${STATIC_LIB_NOINST} : ${EXT_DEPS } ${OBJS } ${OBJS_EXTRA }
LDOBJS = " ${ OBJS } ${ OBJS_EXTRA } " ; \
${ LINK_STATUS } ; \
rm -f $@ ; \
objs = "" ; \
ars = "" ; \
for i in ${ OBJS } ${ OBJS_EXTRA } ; do \
case $$ i in \
*.a) \
ars = " $$ ars $$ i " \
; ; \
*.o) \
objs = " $$ objs $$ i " \
; ; \
esac \
done ; \
for i in $$ ars; do \
dir = " . $$ (echo $$ i | sed 's/\//_/g').objs " ; \
rm -fr $$ dir; \
mkdir -p $$ dir; \
cd $$ dir; \
${ AR } x ../$$ i; \
for j in *.o; do \
objs = " $$ objs $$ dir/ $$ j " ; \
done ; \
cd ..; \
done ; \
if ${ AR } cr $@ $$ objs && ${ RANLIB } $@ ; then \
2011-07-25 02:03:17 +00:00
${ LINK_OK } ; \
else \
${ LINK_FAILED } ; \
2012-04-30 06:01:11 +00:00
rm -f $@ ; \
fi ; \
for i in $$ ars; do \
dir = " . $$ (echo $$ i | sed 's/\//_/g').objs " ; \
rm -fr $$ dir; \
done
2011-07-25 02:03:17 +00:00
2012-04-30 06:01:11 +00:00
${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} : ${EXT_DEPS } ${LIB_OBJS } ${LIB_OBJS_EXTRA }
LDOBJS = " ${ LIB_OBJS } ${ LIB_OBJS_EXTRA } " ; \
${ LINK_STATUS } ; \
rm -f $@
objs = "" ; \
ars = "" ; \
for i in ${ LIB_OBJS } ${ LIB_OBJS_EXTRA } ; do \
case $$ i in \
*.a) \
ars = " $$ ars $$ i " \
; ; \
*.o) \
objs = " $$ objs $$ i " \
; ; \
esac \
done ; \
for i in $$ ars; do \
dir = " . $$ (echo $$ i | sed 's/\//_/g').objs " ; \
rm -fr $$ dir; \
mkdir -p $$ dir; \
cd $$ dir; \
${ AR } x ../$$ i; \
for j in *.o; do \
objs = " $$ objs $$ dir/ $$ j " ; \
done ; \
cd ..; \
done ; \
if ${ AR } cr $@ $$ objs && ${ RANLIB } $@ ; then \
2011-07-25 02:03:17 +00:00
${ LINK_OK } ; \
else \
${ LINK_FAILED } ; \
rm -f $@ ; \
2012-04-30 06:01:11 +00:00
fi ; \
for i in $$ ars; do \
dir = " . $$ (echo $$ i | sed 's/\//_/g').objs " ; \
rm -fr $$ dir; \
done
2011-07-25 02:03:17 +00:00
locales : ${MO_FILES }
2012-04-30 06:01:11 +00:00
phase_cmd_cc = CompileExe
quiet_cmd_cc = $@
cmd_cc = ${ CC } ${ CFLAGS } ${ CPPFLAGS } -c -o $@ $<
phase_cmd_cc_lib = CompileLib
quiet_cmd_cc_lib = $@
cmd_cc_lib = ${ CC } ${ LIB_CFLAGS } ${ CFLAGS } ${ CPPFLAGS } -c -o $@ $<
phase_cmd_cc_plugin = CompilePlugin
quiet_cmd_cc_plugin = $@
cmd_cc_plugin = ${ CC } ${ PLUGIN_CFLAGS } ${ CFLAGS } ${ CPPFLAGS } -c -o $@ $<
2011-07-25 02:03:17 +00:00
.c.o :
2012-04-30 06:01:11 +00:00
$( call echo-cmd,cmd_cc)
$( cmd_cc)
.c.lib.o :
$( call echo-cmd,cmd_cc_lib)
$( cmd_cc_lib)
.c.plugin.o :
$( call echo-cmd,cmd_cc_plugin)
$( cmd_cc_plugin)
phase_cmd_cxx = CompileExe
quiet_cmd_cxx = $@
cmd_cxx = ${ CXX } ${ CXXFLAGS } ${ CPPFLAGS } -c -o $@ $<
phase_cmd_cxx_lib = CompileLib
quiet_cmd_cxx_lib = $@
cmd_cxx_lib = ${ CXX } ${ LIB_CFLAGS } ${ CXXFLAGS } ${ CPPFLAGS } -c -o $@ $<
phase_cmd_cxx_plugin = CompilePlugin
quiet_cmd_cxx_plugin = $@
cmd_cxx_plugin = ${ CXX } ${ PLUGIN_CFLAGS } ${ CXXFLAGS } ${ CPPFLAGS } -c -o $@ $<
2011-07-25 02:03:17 +00:00
.cc.o .cxx.o :
2012-04-30 06:01:11 +00:00
$( call echo-cmd,cmd_cxx)
$( cmd_cxx)
.cc.lib.o .cxx.lib.o :
$( call echo-cmd,cmd_cxx_lib)
$( cmd_cxx_lib)
.cc.plugin.o .cxx.plugin.o :
$( call echo-cmd,cmd_cxx_plugin)
$( cmd_cxx_plugin)
phase_cmd_dc = CompileExe
quiet_cmd_dc = $@
i f e q ( $( basename $ {DC }) , d m d )
cmd_dc = ${ CXX } ${ CXXFLAGS } ${ CPPFLAGS } -c -of$@ $<
e l s e
cmd_dc = ${ CXX } ${ CXXFLAGS } ${ CPPFLAGS } -c -o $@ $<
e n d i f
2011-07-25 02:03:17 +00:00
.d.o :
2012-04-30 06:01:11 +00:00
$( call echo-cmd,cmd_dc)
$( cmd_dc)
phase_cmd_erlc = CompileErlang
quiet_cmd_erlc = $@
cmd_erlc = ${ ERLC } ${ ERLCFLAGS } -o $@ $<
2011-07-25 02:03:17 +00:00
.erl.beam :
2012-04-30 06:01:11 +00:00
$( call echo-cmd,cmd_erlc)
$( cmd_erlc)
phase_cmd_javac = CompileJava
quiet_cmd_javac = $@
cmd_javac = ${ JAVAC } ${ JAVACFLAGS } $<
.java.class :
$( call echo-cmd,cmd_javac)
$( cmd_javac)
phase_cmd_objc = CompileExe
quiet_cmd_objc = $@
cmd_objc = ${ OBJC } ${ OBJCFLAGS } ${ CPPFLAGS } -c -o $@ $<
phase_cmd_objc_lib = CompileLib
quiet_cmd_objc_lib = $@
cmd_objc_lib = ${ OBJC } ${ LIB_CFLAGS } ${ OBJCFLAGS } ${ CPPFLAGS } -c -o $@ $<
phase_cmd_objc_plugin = CompilePlugin
quiet_cmd_objc_plugin = $@
cmd_objc_plugin = ${ OBJC } ${ PLUGIN_CFLAGS } ${ OBJCFLAGS } ${ CPPFLAGS } -c -o $@ $<
2011-07-25 02:03:17 +00:00
.m.o :
2012-04-30 06:01:11 +00:00
$( call echo-cmd,cmd_objc)
$( cmd_objc)
.m.lib.o :
$( call echo-cmd,cmd_objc_lib)
$( cmd_objc_lib)
.m.plugin.o :
$( call echo-cmd,cmd_objc_plugin)
$( cmd_objc_plugin)
phase_cmd_objcxx = CompileExe
quiet_cmd_objcxx = $@
cmd_objcxx = ${ OBJCXX } ${ OBJCXXFLAGS } ${ OBJCFLAGS } ${ CPPFLAGS } -c -o $@ $<
phase_cmd_objcxx_lib = CompileLib
quiet_cmd_objcxx_lib = $@
cmd_objcxx_lib = ${ OBJCXX } ${ LIB_CFLAGS } ${ OBJCXXFLAGS } ${ OBJCFLAGS } ${ CPPFLAGS } -c -o $@ $<
phase_cmd_objcxx_plugin = CompilePlugin
quiet_cmd_objcxx_plugin = $@
cmd_objcxx_plugin = ${ OBJCXX } ${ PLUGIN_CFLAGS } ${ OBJCXXFLAGS } ${ OBJCFLAGS } ${ CPPFLAGS } -c -o $@ $<
2011-07-25 02:03:17 +00:00
.mm.o :
2012-04-30 06:01:11 +00:00
$( call echo-cmd,cmd_objcxx)
$( cmd_objcxx)
.mm.lib.o :
$( call echo-cmd,cmd_objcxx_lib)
$( cmd_objcxx_lib)
.mm.plugin.o :
$( call echo-cmd,cmd_objcxx_plugin)
$( cmd_objcxx_plugin)
phase_cmd_msgfmt = CompileResource
quiet_cmd_msgfmt = $@
cmd_msgfmt = ${ MSGFMT } -c -o $@ $<
2011-07-25 02:03:17 +00:00
.po.mo :
2012-04-30 06:01:11 +00:00
$( call echo-cmd,cmd_msgfmt)
$( cmd_msgfmt)
phase_cmd_pythonc = CompilePython
quiet_cmd_pythonc = $@
cmd_pythonc = ${ PYTHON } ${ PYTHON_FLAGS } -c " import py_compile; py_compile.compile(' $<') "
2011-07-25 02:03:17 +00:00
.py.pyc :
2012-04-30 06:01:11 +00:00
$( call echo-cmd,cmd_pythonc)
$( cmd_pythonc)
2011-07-25 02:03:17 +00:00
2012-04-30 06:01:11 +00:00
phase_cmd_windres = CompileResource
quiet_cmd_windres = $@
cmd_windres = ${ WINDRES } ${ CPPFLAGS } -J rc -O coff -o $@ $<
.rc.o .rc.lib.o .rc.plugin.o :
$( call echo-cmd,cmd_windres)
$( cmd_windres)
phase_cmd_as = CompileExe
quiet_cmd_as = $@
cmd_as = ${ AS } ${ ASFLAGS } ${ CPPFLAGS } -c -o $@ $<
phase_cmd_as_lib = CompileLib
quiet_cmd_as_lib = $@
cmd_as_lib = ${ AS } ${ LIB_CFLAGS } ${ ASFLAGS } ${ CPPFLAGS } -c -o $@ $<
phase_cmd_as_plugin = CompilePlugin
quiet_cmd_as_plugin = $@
cmd_as_plugin = ${ AS } ${ PLUGIN_CFLAGS } ${ ASFLAGS } ${ CPPFLAGS } -c -o $@ $<
2011-07-25 02:03:17 +00:00
.S.o :
2012-04-30 06:01:11 +00:00
$( call echo-cmd,cmd_as)
$( cmd_as)
.S.lib.o :
$( call echo-cmd,cmd_as_lib)
$( cmd_as_lib)
.S.plugin.o :
$( call echo-cmd,cmd_as_plugin)
$( cmd_as_plugin)
2011-07-25 02:03:17 +00:00
2012-04-30 06:01:11 +00:00
phase_cmd_xpm = CompileExe
quiet_cmd_xpm = $@
cmd_xpm = ${ CC } ${ CFLAGS } ${ CPPFLAGS } -x c -c -o $@ $<
phase_cmd_xpm_lib = CompileLib
quiet_cmd_xpm_lib = $@
cmd_xpm_lib = ${ CC } ${ LIB_CFLAGS } ${ CFLAGS } ${ CPPFLAGS } -x c -c -o $@ $<
phase_cmd_xpm_plugin = CompilePlugin
quiet_cmd_xpm_plugin = $@
cmd_xpm_plugin = ${ CC } ${ PLUGIN_CFLAGS } ${ CFLAGS } ${ CPPFLAGS } -x c -c -o $@ $<
.xpm.o :
$( call echo-cmd,cmd_xpm)
$( cmd_xpm)
.xpm.lib.o :
$( call echo-cmd,cmd_xpm_lib)
$( cmd_xpm_lib)
.xpm.plugin.o :
$( call echo-cmd,cmd_xpm_plugin)
$( cmd_xpm_plugin)
install : ${SHARED_LIB } ${STATIC_LIB } ${STATIC_PIC_LIB } ${PLUGIN } ${PROG } install -extra
2011-07-25 02:03:17 +00:00
for i in ${ SUBDIRS } ; do \
2012-04-30 06:01:11 +00:00
${ MAKE } -C $$ i ${ MFLAGS } install || exit $$ ?; \
2011-07-25 02:03:17 +00:00
done
2012-04-30 06:01:11 +00:00
for i in ${ SHARED_LIB } ; do \
2011-07-25 02:03:17 +00:00
${ INSTALL_STATUS } ; \
2012-04-30 06:01:11 +00:00
if ${ MKDIR_P } ${ DESTDIR } ${ libdir } ${ INSTALL_LIB } ; then \
2011-07-25 02:03:17 +00:00
${ INSTALL_OK } ; \
else \
${ INSTALL_FAILED } ; \
fi \
done
2012-04-30 06:01:11 +00:00
for i in ${ STATIC_LIB } ${ STATIC_PIC_LIB } ; do \
2011-07-25 02:03:17 +00:00
${ INSTALL_STATUS } ; \
if ${ MKDIR_P } ${ DESTDIR } ${ libdir } && ${ INSTALL } -m 644 $$ i ${ DESTDIR } ${ libdir } /$$ i; then \
${ INSTALL_OK } ; \
else \
${ INSTALL_FAILED } ; \
fi \
done
for i in ${ PLUGIN } ; do \
${ INSTALL_STATUS } ; \
if ${ MKDIR_P } ${ DESTDIR } ${ plugindir } && ${ INSTALL } -m 755 $$ i ${ DESTDIR } ${ plugindir } /$$ i; then \
${ INSTALL_OK } ; \
else \
${ INSTALL_FAILED } ; \
fi \
done
for i in ${ DATA } ; do \
${ INSTALL_STATUS } ; \
2012-04-30 06:01:11 +00:00
if ${ MKDIR_P } $$ ( dirname ${ DESTDIR } ${ datadir } /${ PACKAGE_NAME } /$$ i) && ${ INSTALL } -m 644 $$ i ${ DESTDIR } ${ datadir } /${ PACKAGE_NAME } /$$ i; then \
2011-07-25 02:03:17 +00:00
${ INSTALL_OK } ; \
else \
${ INSTALL_FAILED } ; \
fi \
done
for i in ${ PROG } ; do \
${ INSTALL_STATUS } ; \
if ${ MKDIR_P } ${ DESTDIR } ${ bindir } && ${ INSTALL } -m 755 $$ i ${ DESTDIR } ${ bindir } /$$ i; then \
${ INSTALL_OK } ; \
else \
${ INSTALL_FAILED } ; \
fi \
done
for i in ${ INCLUDES } ; do \
${ INSTALL_STATUS } ; \
if ${ MKDIR_P } ${ DESTDIR } ${ includedir } /${ includesubdir } && ${ INSTALL } -m 644 $$ i ${ DESTDIR } ${ includedir } /${ includesubdir } /$$ i; then \
${ INSTALL_OK } ; \
else \
${ INSTALL_FAILED } ; \
fi \
done
2012-04-30 06:01:11 +00:00
for i in ${ MO_FILES } ; do \
${ INSTALL_STATUS } ; \
if ${ MKDIR_P } ${ DESTDIR } ${ localedir } /$$ { i%.mo} /LC_MESSAGES && ${ INSTALL } -m 644 $$ i ${ DESTDIR } ${ localedir } /$$ { i%.mo} /LC_MESSAGES/${ localename } .mo; then \
${ INSTALL_OK } ; \
else \
${ INSTALL_FAILED } ; \
fi \
done
2011-07-25 02:03:17 +00:00
for i in ${ MAN } ; do \
${ INSTALL_STATUS } ; \
if ${ MKDIR_P } ${ DESTDIR } ${ mandir } /${ mansubdir } && ${ INSTALL } -m 644 $$ i ${ DESTDIR } ${ mandir } /${ mansubdir } /$$ i; then \
${ INSTALL_OK } ; \
else \
${ INSTALL_FAILED } ; \
fi \
done
install-extra :
uninstall : uninstall -extra
for i in ${ SUBDIRS } ; do \
2012-04-30 06:01:11 +00:00
${ MAKE } -C $$ i ${ MFLAGS } uninstall || exit $$ ?; \
2011-07-25 02:03:17 +00:00
done
2012-04-30 06:01:11 +00:00
for i in ${ SHARED_LIB } ; do \
2011-07-25 02:03:17 +00:00
if test -f ${ DESTDIR } ${ libdir } /$$ i; then \
2012-04-30 06:01:11 +00:00
if : ${ UNINSTALL_LIB } ; then \
2011-07-25 02:03:17 +00:00
${ DELETE_OK } ; \
else \
${ DELETE_FAILED } ; \
fi \
fi ; \
done
2012-04-30 06:01:11 +00:00
for i in ${ STATIC_LIB } ${ STATIC_PIC_LIB } ; do \
2011-07-25 02:03:17 +00:00
if test -f ${ DESTDIR } ${ libdir } /$$ i; then \
if rm -f ${ DESTDIR } ${ libdir } /$$ i; then \
${ DELETE_OK } ; \
else \
${ DELETE_FAILED } ; \
fi \
fi \
done
for i in ${ PLUGIN } ; do \
if test -f ${ DESTDIR } ${ plugindir } /$$ i; then \
if rm -f ${ DESTDIR } ${ plugindir } /$$ i; then \
${ DELETE_OK } ; \
else \
${ DELETE_FAILED } ; \
fi \
fi \
done
-rmdir ${ DESTDIR } ${ plugindir } >/dev/null 2>& 1
for i in ${ DATA } ; do \
2012-04-30 06:01:11 +00:00
if test -f ${ DESTDIR } ${ datadir } /${ PACKAGE_NAME } /$$ i; then \
if rm -f ${ DESTDIR } ${ datadir } /${ PACKAGE_NAME } /$$ i; then \
2011-07-25 02:03:17 +00:00
${ DELETE_OK } ; \
else \
${ DELETE_FAILED } ; \
fi \
2012-04-30 06:01:11 +00:00
fi ; \
rmdir " $$ (dirname ${ DESTDIR } ${ datadir } / ${ PACKAGE_NAME } / $$ i) " >/dev/null 2>& 1 || true; \
2011-07-25 02:03:17 +00:00
done
2012-04-30 06:01:11 +00:00
-rmdir ${ DESTDIR } ${ datadir } /${ PACKAGE_NAME } >/dev/null 2>& 1
2011-07-25 02:03:17 +00:00
for i in ${ PROG } ; do \
if test -f ${ DESTDIR } ${ bindir } /$$ i; then \
if rm -f ${ DESTDIR } ${ bindir } /$$ i; then \
${ DELETE_OK } ; \
else \
${ DELETE_FAILED } ; \
fi \
fi \
done
for i in ${ INCLUDES } ; do \
if test -f ${ DESTDIR } ${ includedir } /${ includesubdir } /$$ i; then \
if rm -f ${ DESTDIR } ${ includedir } /${ includesubdir } /$$ i; then \
${ DELETE_OK } ; \
else \
${ DELETE_FAILED } ; \
fi \
fi \
done
-rmdir ${ DESTDIR } ${ includedir } /${ includesubdir } >/dev/null 2>& 1
2012-04-30 06:01:11 +00:00
for i in ${ MO_FILES } ; do \
if test -f ${ DESTDIR } ${ localedir } /$$ { i%.mo} /LC_MESSAGES/${ localename } .mo; then \
if rm -f ${ DESTDIR } ${ localedir } /$$ { i%.mo} /LC_MESSAGES/${ localename } .mo; then \
${ DELETE_OK } ; \
else \
${ DELETE_FAILED } ; \
fi \
fi \
done
2011-07-25 02:03:17 +00:00
for i in ${ MAN } ; do \
if test -f ${ DESTDIR } ${ mandir } /${ mansubdir } /$$ i; then \
if rm -f ${ DESTDIR } ${ mandir } /${ mansubdir } /$$ i; then \
${ DELETE_OK } ; \
else \
${ DELETE_FAILED } ; \
fi \
fi \
done
uninstall-extra :
clean :
for i in ${ SUBDIRS } ; do \
2012-04-30 06:01:11 +00:00
${ MAKE } -C $$ i ${ MFLAGS } clean || exit $$ ?; \
2011-07-25 02:03:17 +00:00
done
2012-04-30 06:01:11 +00:00
for i in ${ DEPS } ${ OBJS } ${ OBJS_EXTRA } ${ LIB_OBJS } ${ LIB_OBJS_EXTRA } ${ PLUGIN_OBJS } ${ PROG } ${ PROG_NOINST } ${ SHARED_LIB } ${ SHARED_LIB_NOINST } ${ STATIC_LIB } ${ STATIC_LIB_NOINST } ${ STATIC_PIC_LIB } ${ STATIC_PIC_LIB_NOINST } ${ PLUGIN } ${ PLUGIN_NOINST } ${ CLEAN_LIB } ${ MO_FILES } ${ CLEAN } ; do \
2011-07-25 02:03:17 +00:00
if test -f $$ i -o -d $$ i; then \
if rm -fr $$ i; then \
${ DELETE_OK } ; \
else \
${ DELETE_FAILED } ; \
fi \
fi \
done
distclean : clean
for i in ${ SUBDIRS } ; do \
2012-04-30 06:01:11 +00:00
${ MAKE } -C $$ i ${ MFLAGS } distclean || exit $$ ?; \
2011-07-25 02:03:17 +00:00
done
2012-04-30 06:01:11 +00:00
for i in ${ DISTCLEAN } *.dep *~; do \
2011-07-25 02:03:17 +00:00
if test -f $$ i -o -d $$ i; then \
if rm -fr $$ i; then \
${ DELETE_OK } ; \
else \
${ DELETE_FAILED } ; \
fi \
fi \
done
2012-04-30 06:01:11 +00:00
i f n d e f V
QUIET = quiet_
LINK_STATUS = printf " Link: $@ \n "
LINK_OK = true
LINK_FAILED = exit $$ ?
INSTALL_STATUS = printf " Install: $$ i\n "
INSTALL_OK = true
INSTALL_FAILED = exit $$ ?
DELETE_OK = printf " Delete: $$ i\n "
DELETE_FAILED = exit $$ ?
e l s e
QUIET =
LINK_STATUS = printf " Link: ${ LD } $@ $$ LDOBJS ${ LDFLAGS } ${ LIBS } \n "
LINK_OK = true
LINK_FAILED = exit $$ ?
INSTALL_STATUS = printf " Install: $$ i\n "
INSTALL_OK = true
INSTALL_FAILED = exit $$ ?
DELETE_OK = printf " Delete: $$ i\n "
DELETE_FAILED = exit $$ ?
e n d i f
- i n c l u d e $ { D E P F I L E S }