Buildsystem: Add mk/
This commit is contained in:
parent
c628970c60
commit
3f9c8a0030
65
mk/build.common.mk
Normal file
65
mk/build.common.mk
Normal file
@ -0,0 +1,65 @@
|
||||
#
|
||||
# Copyright (c) 2001-2009 Hypertriton, Inc. <http://hypertriton.com/>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# 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 AUTHOR 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.
|
||||
|
||||
#
|
||||
# Generic defines common to all BSDBuild libraries.
|
||||
#
|
||||
|
||||
PREFIX?= /usr/local
|
||||
DESTDIR?=
|
||||
LOCALSTATEDIR?= ${PREFIX}/share
|
||||
SYSCONFDIR?= ${PREFIX}/etc
|
||||
SHAREDIR?= ${PREFIX}/share
|
||||
BINDIR?= ${PREFIX}/bin
|
||||
LIBDIR?= ${PREFIX}/lib
|
||||
INCLDIR?= ${PREFIX}/include
|
||||
MANDIR?= ${PREFIX}/man
|
||||
PSDIR?= ${PREFIX}/man
|
||||
|
||||
SUDO?=
|
||||
SH?= sh
|
||||
FIND?= find
|
||||
AWK?= awk
|
||||
|
||||
INSTALL_PROG= install -c -m 755
|
||||
INSTALL_LIB= install -c -m 644
|
||||
INSTALL_DATA= install -c -m 644
|
||||
INSTALL_INCL= install -c -m 644
|
||||
|
||||
INSTALL_PROG_DIR= mkdir -p
|
||||
INSTALL_LIB_DIR= mkdir -p
|
||||
INSTALL_DATA_DIR= mkdir -p
|
||||
INSTALL_INCL_DIR= mkdir -p
|
||||
INSTALL_MAN_DIR= mkdir -p
|
||||
INSTALL_PS_DIR= mkdir -p
|
||||
|
||||
DEINSTALL_PROG= rm -f
|
||||
DEINSTALL_LIB= rm -f
|
||||
DEINSTALL_DATA= rm -f
|
||||
DEINSTALL_INCL= rm -f
|
||||
|
||||
DEINSTALL_PROG_DIR= rmdir -p
|
||||
DEINSTALL_LIB_DIR= rmdir -p
|
||||
DEINSTALL_DATA_DIR= rmdir -p
|
||||
DEINSTALL_INCL_DIR= rmdir -p
|
||||
47
mk/build.dep.mk
Normal file
47
mk/build.dep.mk
Normal file
@ -0,0 +1,47 @@
|
||||
#
|
||||
# Copyright (c) 2001-2007 Hypertriton, Inc. <http://hypertriton.com/>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# 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 AUTHOR 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.
|
||||
|
||||
#
|
||||
# Get object file dependency information from the compiler.
|
||||
#
|
||||
|
||||
MKDEP= sh ${TOP}/mk/mkdep
|
||||
CC?= cc
|
||||
|
||||
depend: ${DPADD} depend-subdir
|
||||
@echo > .depend
|
||||
@files="${SRCS}"; \
|
||||
if [ "$$files" != "" -a "$$files" != "none" ]; then \
|
||||
if [ "${BUILD}" != "" ]; then \
|
||||
env CC=${CC} ${MKDEP} ${CFLAGS} -I${BUILD} $$files; \
|
||||
env CC=${CC} ${MKDEP} -a -l ${CFLAGS} -I${BUILD} $$files; \
|
||||
else \
|
||||
env CC=${CC} ${MKDEP} ${CFLAGS} $$files; \
|
||||
env CC=${CC} ${MKDEP} -a -l ${CFLAGS} $$files; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
clean-depend:
|
||||
echo > .depend
|
||||
|
||||
410
mk/build.prog.mk
Normal file
410
mk/build.prog.mk
Normal file
@ -0,0 +1,410 @@
|
||||
#
|
||||
# Copyright (c) 2001-2009 Hypertriton, Inc. <http://hypertriton.com/>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# 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 AUTHOR 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.
|
||||
|
||||
#
|
||||
# Compile executables from source.
|
||||
#
|
||||
|
||||
PROG?=
|
||||
GMONOUT?= gmon.out
|
||||
WINRES?=
|
||||
|
||||
CC?= cc
|
||||
ASM?= nasm
|
||||
LEX?= lex
|
||||
YACC?= yacc
|
||||
WINDRES?=
|
||||
|
||||
CFLAGS?= -O2 -g
|
||||
CPPFLAGS?=
|
||||
CXXFLAGS?=
|
||||
OBJCFLAGS?= ${CFLAGS}
|
||||
ASMFLAGS?= -g -w-orphan-labels
|
||||
LFLAGS?=
|
||||
LIBL?= -ll
|
||||
YFLAGS?= -d
|
||||
|
||||
PROG_INSTALL?= Yes
|
||||
PROG_TYPE?= "CLI"
|
||||
PROG_GUID?=
|
||||
|
||||
SHARE?=none
|
||||
SHARESRC?=none
|
||||
SRCS?=none
|
||||
OBJS?=none
|
||||
POBJS?=none
|
||||
SHOBJS?=none
|
||||
CONF?=none
|
||||
CONF_OVERWRITE?=No
|
||||
CLEANFILES?=
|
||||
|
||||
CTAGS?=
|
||||
CTAGSFLAGS?=
|
||||
DPADD+=prog-tags
|
||||
|
||||
all: all-subdir ${PROG}
|
||||
install: install-prog install-subdir
|
||||
deinstall: deinstall-prog deinstall-subdir
|
||||
clean: clean-prog clean-subdir
|
||||
cleandir: clean-prog clean-subdir cleandir-prog cleandir-subdir
|
||||
regress: regress-subdir
|
||||
depend: depend-subdir
|
||||
|
||||
.SUFFIXES: .o .po .c .cc .cpp .asm .l .y .m
|
||||
|
||||
# Compile C code into an object file
|
||||
.c.o:
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} -o $@ -c $<
|
||||
.c.po:
|
||||
${CC} -pg -DPROF ${CFLAGS} ${CPPFLAGS} -o $@ -c $<
|
||||
|
||||
# Compile C++ code into an object file
|
||||
.cc.o:
|
||||
${CXX} ${CXXFLAGS} ${CPPFLAGS} -o $@ -c $<
|
||||
.cc.po:
|
||||
${CXX} -pg -DPROF ${CXXFLAGS} ${CPPFLAGS} -o $@ -c $<
|
||||
.cpp.o:
|
||||
${CXX} ${CXXFLAGS} ${CPPFLAGS} -o $@ -c $<
|
||||
.cpp.po:
|
||||
${CXX} -pg -DPROF ${CXXFLAGS} ${CPPFLAGS} -o $@ -c $<
|
||||
|
||||
# Compile C+Objective-C code into an object file
|
||||
.m.o:
|
||||
${CC} ${OBJCFLAGS} ${CPPFLAGS} -o $@ -c $<
|
||||
.m.po:
|
||||
${CC} -pg -DPROF ${OBJCFLAGS} ${CPPFLAGS} -o $@ -c $<
|
||||
|
||||
# Compile assembly code into an object file
|
||||
.asm.o:
|
||||
${ASM} ${ASMFLAGS} ${CPPFLAGS} -o $@ $<
|
||||
|
||||
# Compile a Lex lexer into an object file
|
||||
.l:
|
||||
${LEX} ${LFLAGS} -o$@.yy.c $<
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o $@ $@.yy.c ${LIBL} ${LIBS}
|
||||
@rm -f $@.yy.c
|
||||
.l.o:
|
||||
${LEX} ${LFLAGS} -o$@.yy.c $<
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} -o $@ -c $@.yy.c
|
||||
@mv -f $@.yy.o $@
|
||||
@rm -f $@.yy.c
|
||||
.l.po:
|
||||
${LEX} ${LFLAGS} -o$@.yy.c $<
|
||||
${CC} -pg -DPROF ${CFLAGS} ${CPPFLAGS} -o $@ -c $@.yy.c
|
||||
@mv -f $@.yy.o $@
|
||||
@rm -f $@.yy.c
|
||||
|
||||
# Compile a Yacc parser into an object file
|
||||
.y:
|
||||
${YACC} ${YFLAGS} -b $@ $<
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o $@ $@.tab.c ${LIBS}
|
||||
@rm -f $@.tab.c
|
||||
.y.o:
|
||||
${YACC} ${YFLAGS} -b $@ $<
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} -o $@ -c $@.tab.c
|
||||
@mv -f $@.tab.o $@
|
||||
@rm -f $@.tab.c
|
||||
.y.po:
|
||||
${YACC} ${YFLAGS} -b $@ $<
|
||||
${CC} -pg -DPROF ${CFLAGS} ${CPPFLAGS} -o $@ -c $@.tab.c
|
||||
@mv -f $@.tab.o $@
|
||||
@rm -f $@.tab.c
|
||||
|
||||
# Build the program's object files
|
||||
_prog_objs:
|
||||
@if [ "${PROG}" != "" -a "${OBJS}" = "none" \
|
||||
-a "${SRCS}" != "none" ]; then \
|
||||
for F in ${SRCS}; do \
|
||||
F=`echo $$F | sed 's/.[clym]$$/.o/'`; \
|
||||
F=`echo $$F | sed 's/.cc$$/.o/'`; \
|
||||
F=`echo $$F | sed 's/.cpp$$/.o/'`; \
|
||||
F=`echo $$F | sed 's/.asm$$/.o/'`; \
|
||||
${MAKE} $$F; \
|
||||
if [ $$? != 0 ]; then \
|
||||
echo "${MAKE}: failure"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi
|
||||
@if [ "${WINRES}" != "" -a "${WINDRES}" != "" ]; then \
|
||||
echo "${WINDRES} -o ${WINRES}.o ${WINRES}"; \
|
||||
${WINDRES} -o ${WINRES}.o ${WINRES}; \
|
||||
fi
|
||||
|
||||
# Build profiled versions of the program's object files
|
||||
_prog_pobjs:
|
||||
@if [ "${GMONOUT}" != "" -a "${POBJS}" = "none" \
|
||||
-a "${SRCS}" != "none" ]; then \
|
||||
for F in ${SRCS}; do \
|
||||
F=`echo $$F | sed 's/.[clym]$$/.po/'`; \
|
||||
F=`echo $$F | sed 's/.cc$$/.po/'`; \
|
||||
F=`echo $$F | sed 's/.cpp$$/.po/'`; \
|
||||
F=`echo $$F | sed 's/.asm$$/.po/'`; \
|
||||
${MAKE} $$F; \
|
||||
if [ $$? != 0 ]; then \
|
||||
echo "${MAKE}: failure"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
# Compile and link the program
|
||||
${PROG}: _prog_objs ${OBJS}
|
||||
@if [ "${PROG}" != "" -a "${SRCS}" != "none" ]; then \
|
||||
if [ "${OBJS}" = "none" ]; then \
|
||||
export _objs=""; \
|
||||
for F in ${SRCS}; do \
|
||||
F=`echo $$F | sed 's/.[clym]$$/.o/'`; \
|
||||
F=`echo $$F | sed 's/.cc$$/.o/'`; \
|
||||
F=`echo $$F | sed 's/.cpp$$/.o/'`; \
|
||||
F=`echo $$F | sed 's/.asm$$/.o/'`; \
|
||||
_objs="$$_objs $$F"; \
|
||||
done; \
|
||||
if [ "${WINRES}" != "" ]; then \
|
||||
echo "${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} $$_objs ${LIBS} \
|
||||
${WINRES}.o"; \
|
||||
${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} $$_objs ${LIBS} \
|
||||
${WINRES}.o; \
|
||||
else \
|
||||
echo "${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} $$_objs ${LIBS}"; \
|
||||
${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} $$_objs ${LIBS}; \
|
||||
fi; \
|
||||
else \
|
||||
if [ "${WINRES}" != "" ]; then \
|
||||
echo "${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS} \
|
||||
${WINRES}.o"; \
|
||||
${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS} \
|
||||
${WINRES}.o; \
|
||||
else \
|
||||
echo "${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS}"; \
|
||||
${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS}; \
|
||||
fi; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
# Compile and link a profiled version of the program
|
||||
${GMONOUT}: _prog_pobjs ${POBJS}
|
||||
@if [ "${GMONOUT}" != "" -a "${SRCS}" != "none" ]; then \
|
||||
if [ "${POBJS}" = "none" ]; then \
|
||||
export _pobjs=""; \
|
||||
for F in ${SRCS}; do \
|
||||
F=`echo $$F | sed 's/.[clym]$$/.po/'`; \
|
||||
F=`echo $$F | sed 's/.cc$$/.po/'`; \
|
||||
F=`echo $$F | sed 's/.cpp$$/.po/'`; \
|
||||
F=`echo $$F | sed 's/.asm$$/.po/'`; \
|
||||
_pobjs="$$_pobjs $$F"; \
|
||||
done; \
|
||||
echo "${CC} -pg -DPROF ${LDFLAGS} -o ${GMONOUT} $$_pobjs \
|
||||
${LIBS}"; \
|
||||
${CC} -pg -DPROF ${LDFLAGS} -o ${GMONOUT} $$_pobjs ${LIBS}; \
|
||||
else \
|
||||
echo "${CC} -pg -DPROF ${LDFLAGS} -o ${GMONOUT} ${POBJS} \
|
||||
${LIBS}"; \
|
||||
${CC} -pg -DPROF ${LDFLAGS} -o ${GMONOUT} ${POBJS} ${LIBS}; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
clean-prog:
|
||||
@if [ "${PROG}" != "" -a "${SRCS}" != "none" ]; then \
|
||||
if [ "${SHOBJS}" = "none" ]; then \
|
||||
export _objs=""; \
|
||||
for F in ${SRCS}; do \
|
||||
F=`echo $$F | sed 's/.[clym]$$/.lo/'`; \
|
||||
F=`echo $$F | sed 's/.cc$$/.lo/'`; \
|
||||
F=`echo $$F | sed 's/.cpp$$/.lo/'`; \
|
||||
F=`echo $$F | sed 's/.asm$$/.lo/'`; \
|
||||
_objs="$$_objs $$F"; \
|
||||
done; \
|
||||
echo "rm -f $$_objs"; \
|
||||
rm -f $$_objs; \
|
||||
else \
|
||||
export _objs=""; \
|
||||
for F in ${SHOBJS}; do \
|
||||
F=`echo $$F | sed 's/.lo$$/.o/'`; \
|
||||
_objs="$$_objs $$F"; \
|
||||
done; \
|
||||
echo "rm -f $$_objs ${SHOBJS}"; \
|
||||
rm -f $$_objs ${SHOBJS}; \
|
||||
fi; \
|
||||
if [ "${OBJS}" = "none" ]; then \
|
||||
export _objs=""; \
|
||||
for F in ${SRCS}; do \
|
||||
F=`echo $$F | sed 's/.[clym]$$/.o/'`; \
|
||||
F=`echo $$F | sed 's/.cc$$/.o/'`; \
|
||||
F=`echo $$F | sed 's/.cpp$$/.o/'`; \
|
||||
F=`echo $$F | sed 's/.asm$$/.o/'`; \
|
||||
_objs="$$_objs $$F"; \
|
||||
done; \
|
||||
echo "rm -f $$_objs"; \
|
||||
rm -f $$_objs; \
|
||||
else \
|
||||
echo "rm -f ${OBJS}"; \
|
||||
rm -f ${OBJS}; \
|
||||
fi; \
|
||||
if [ "${POBJS}" = "none" ]; then \
|
||||
export _objs=""; \
|
||||
for F in ${SRCS}; do \
|
||||
F=`echo $$F | sed 's/.[clym]$$/.po/'`; \
|
||||
F=`echo $$F | sed 's/.cc$$/.po/'`; \
|
||||
F=`echo $$F | sed 's/.cpp$$/.po/'`; \
|
||||
F=`echo $$F | sed 's/.asm$$/.po/'`; \
|
||||
_objs="$$_objs $$F"; \
|
||||
done; \
|
||||
echo "rm -f $$_objs"; \
|
||||
rm -f $$_objs; \
|
||||
else \
|
||||
echo "rm -f ${POBJS}"; \
|
||||
rm -f ${OBJS}; \
|
||||
fi; \
|
||||
echo "rm -f ${PROG}${EXECSUFFIX} ${GMONOUT} ${WINRES}.o"; \
|
||||
rm -f ${PROG}${EXECSUFFIX} ${GMONOUT} ${WINRES}.o; \
|
||||
fi
|
||||
@if [ "${CLEANFILES}" != "" ]; then \
|
||||
echo "rm -f ${CLEANFILES}"; \
|
||||
rm -f ${CLEANFILES}; \
|
||||
fi
|
||||
@if [ -e ".depend" ]; then \
|
||||
echo "echo >.depend"; \
|
||||
echo >.depend; \
|
||||
fi
|
||||
|
||||
cleandir-prog:
|
||||
rm -f *.core config.log configure.lua tags
|
||||
if [ -e "./config/prefix.h" ]; then rm -fr ./config; fi
|
||||
if [ -e "Makefile.config" ]; then echo >Makefile.config; fi
|
||||
if [ -e ".depend" ]; then echo >.depend; fi
|
||||
|
||||
install-prog:
|
||||
@if [ ! -e "${BINDIR}" ]; then \
|
||||
echo "${INSTALL_PROG_DIR} ${BINDIR}"; \
|
||||
${SUDO} ${INSTALL_PROG_DIR} ${DESTDIR}${BINDIR}; \
|
||||
fi
|
||||
@if [ "${PROG}" != "" -a "${PROG_INSTALL}" != "No" ]; then \
|
||||
echo "${INSTALL_PROG} ${PROG}${EXECSUFFIX} ${BINDIR}"; \
|
||||
${SUDO} ${INSTALL_PROG} ${PROG}${EXECSUFFIX} ${DESTDIR}${BINDIR}; \
|
||||
fi
|
||||
@if [ "${SHARE}" != "none" ]; then \
|
||||
if [ ! -d "${SHAREDIR}" ]; then \
|
||||
echo "${INSTALL_DATA_DIR} ${SHAREDIR}"; \
|
||||
${SUDO} ${INSTALL_DATA_DIR} ${DESTDIR}${SHAREDIR}; \
|
||||
fi; \
|
||||
for F in ${SHARE}; do \
|
||||
echo "${INSTALL_DATA} $$F ${SHAREDIR}"; \
|
||||
${SUDO} ${INSTALL_DATA} $$F ${DESTDIR}${SHAREDIR}; \
|
||||
done; \
|
||||
fi
|
||||
@if [ "${SHARESRC}" != "none" ]; then \
|
||||
if [ ! -d "${SHAREDIR}" ]; then \
|
||||
echo "${INSTALL_DATA_DIR} ${SHAREDIR}"; \
|
||||
${SUDO} ${INSTALL_DATA_DIR} ${DESTDIR}${SHAREDIR}; \
|
||||
fi; \
|
||||
if [ "${SRC}" != "" ]; then \
|
||||
for F in ${SHARESRC}; do \
|
||||
echo "${INSTALL_DATA} $$F ${SHAREDIR}"; \
|
||||
${SUDO} ${INSTALL_DATA} ${SRC}/${BUILDREL}/$$F \
|
||||
${DESTDIR}${SHAREDIR}; \
|
||||
done; \
|
||||
else \
|
||||
for F in ${SHARESRC}; do \
|
||||
echo "${INSTALL_DATA} $$F ${SHAREDIR}"; \
|
||||
${SUDO} ${INSTALL_DATA} $$F ${DESTDIR}${SHAREDIR}; \
|
||||
done; \
|
||||
fi; \
|
||||
fi
|
||||
@if [ "${CONF}" != "none" ]; then \
|
||||
if [ ! -d "${SYSCONFDIR}" ]; then \
|
||||
echo "${INSTALL_DATA_DIR} ${SYSCONFDIR}"; \
|
||||
${SUDO} ${INSTALL_DATA_DIR} ${DESTDIR}${SYSCONFDIR}; \
|
||||
fi; \
|
||||
if [ "${CONF_OVERWRITE}" != "Yes" ]; then \
|
||||
echo "+----------------"; \
|
||||
echo "| The following configuration files exist and "; \
|
||||
echo "| will not be overwritten:"; \
|
||||
echo "|"; \
|
||||
for F in ${CONF}; do \
|
||||
if [ -e "${DESTDIR}${SYSCONFDIR}/$$F" ]; then \
|
||||
echo "| - $$F"; \
|
||||
else \
|
||||
${SUDO} ${INSTALL_DATA} $$F ${DESTDIR}${SYSCONFDIR}; \
|
||||
fi; \
|
||||
done; \
|
||||
echo "+----------------"; \
|
||||
else \
|
||||
for F in ${CONF}; do \
|
||||
echo "${INSTALL_DATA} $$F ${SYSCONFDIR}"; \
|
||||
${SUDO} ${INSTALL_DATA} $$F ${DESTDIR}${SYSCONFDIR}; \
|
||||
done; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
deinstall-prog:
|
||||
@if [ "${PROG}" != "" -a "${PROG_INSTALL}" != "No" ]; then \
|
||||
echo "${DEINSTALL_PROG} ${BINDIR}/${PROG}${EXECSUFFIX}"; \
|
||||
${SUDO} ${DEINSTALL_PROG} ${DESTDIR}${BINDIR}/${PROG}${EXECSUFFIX}; \
|
||||
fi
|
||||
@if [ "${SHARE}" != "none" ]; then \
|
||||
for F in ${SHARE}; do \
|
||||
echo "${DEINSTALL_DATA} ${SHAREDIR}/$$F"; \
|
||||
${SUDO} ${DEINSTALL_DATA} ${DESTDIR}${SHAREDIR}/$$F; \
|
||||
done; \
|
||||
fi
|
||||
@if [ "${CONF}" != "none" ]; then \
|
||||
echo "+----------------"; \
|
||||
echo "| To completely deinstall ${PROG} you need to perform."; \
|
||||
echo "| the following steps as root:"; \
|
||||
echo "|"; \
|
||||
for F in ${CONF}; do \
|
||||
if [ -e "${DESTDIR}${SYSCONFDIR}/$$F" ]; then \
|
||||
echo "| rm -f $$F"; \
|
||||
fi; \
|
||||
done; \
|
||||
echo "|"; \
|
||||
echo "| Do not do this if you plan on re-installing ${PROG}"; \
|
||||
echo "| at some future time."; \
|
||||
echo "+----------------"; \
|
||||
fi
|
||||
|
||||
none:
|
||||
|
||||
prog-tags:
|
||||
-@if [ "${CTAGS}" != "" ]; then \
|
||||
if [ "${SRC}" != "" ]; then \
|
||||
(cd ${SRC}; \
|
||||
echo "${CTAGS} ${CTAGSFLAGS} -R"; \
|
||||
${CTAGS} ${CTAGSFLAGS} -R); \
|
||||
else \
|
||||
echo "${CTAGS} ${CTAGSFLAGS} -R"; \
|
||||
${CTAGS} ${CTAGSFLAGS} -R; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
.PHONY: install deinstall clean cleandir regress depend
|
||||
.PHONY: install-prog deinstall-prog clean-prog cleandir-prog
|
||||
.PHONY: _prog_objs _prog_pobjs prog-tags none
|
||||
|
||||
include ${TOP}/mk/build.common.mk
|
||||
include ${TOP}/mk/build.dep.mk
|
||||
include ${TOP}/mk/build.proj.mk
|
||||
include ${TOP}/mk/build.subdir.mk
|
||||
include .depend
|
||||
164
mk/build.proj.mk
Normal file
164
mk/build.proj.mk
Normal file
@ -0,0 +1,164 @@
|
||||
#
|
||||
# Copyright (c) 2007 Hypertriton, Inc. <http://hypertriton.com/>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# 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 AUTHOR 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.
|
||||
|
||||
#
|
||||
# For Makefiles using <build.prog.mk> and <build.lib.mk>, generate project
|
||||
# files for various IDEs using Premake (http://premake.sourceforge.net/).
|
||||
#
|
||||
|
||||
PREMAKE?= premake
|
||||
ZIP?= zip
|
||||
ZIPFLAGS?= -r
|
||||
MKPROJFILES?= mkprojfiles
|
||||
PREMAKEOUT?= premake.lua
|
||||
PREMAKEFLAGS?=
|
||||
|
||||
PROJECT?=
|
||||
PROJDIR?= ProjectFiles
|
||||
PROJFILESEXTRA?=
|
||||
PROJFILELIST= .projfiles2.out
|
||||
PROJCONFIGDIR?=
|
||||
PROJNOCLEAN?= no
|
||||
|
||||
PROJFILES?= linux:cb-gcc:: \
|
||||
macosx:cb-gcc:: \
|
||||
windows:cb-gcc:: \
|
||||
windows:cb-ow:: \
|
||||
windows:vs2005:: \
|
||||
windows:vs2008::
|
||||
|
||||
CLEANFILES+= ${PREMAKEOUT}
|
||||
|
||||
proj-package:
|
||||
@if [ "${PROJECT}" = "" ]; then \
|
||||
echo "cat Makefile | ${MKPROJFILES} > ${PREMAKEOUT}"; \
|
||||
cat Makefile | \
|
||||
env PROJTARGET="${PROJTARGET}" PROJOS="${PROJOS}" \
|
||||
PROJFLAVOR="" PROJINCLUDES="${TOP}/configure.lua" \
|
||||
${MKPROJFILES} > ${PREMAKEOUT}; \
|
||||
fi
|
||||
|
||||
proj:
|
||||
@if [ ! -d "${PROJDIR}" ]; then \
|
||||
echo "mkdir -p ${PROJDIR}"; \
|
||||
mkdir -p ${PROJDIR}; \
|
||||
fi
|
||||
@for TGT in ${PROJFILES}; do \
|
||||
_tgtos=`echo $$TGT |awk -F: '{print $$1}' `; \
|
||||
_tgtproj=`echo $$TGT |awk -F: '{print $$2}' `; \
|
||||
_tgtflav=`echo $$TGT |awk -F: '{print $$3}' `; \
|
||||
_tgtopts=`echo $$TGT |awk -F: '{print $$4}'|sed 's/,/ /g'`; \
|
||||
echo "*"; \
|
||||
echo "* Target: $$_tgtos ($$_tgtproj)"; \
|
||||
echo "* Target flavor: $$_tgtflav"; \
|
||||
echo "* Target options: $$_tgtopts"; \
|
||||
echo "*"; \
|
||||
\
|
||||
if [ -e "config" ]; then \
|
||||
echo "rm -fR config"; \
|
||||
rm -fR config; \
|
||||
fi; \
|
||||
if [ -e "${PROJCONFIGDIR}" ]; then \
|
||||
echo "rm -fR ${PROJCONFIGDIR}"; \
|
||||
rm -fR "${PROJCONFIGDIR}"; \
|
||||
fi; \
|
||||
echo "mkconfigure --emul-env=$$_tgtproj --emul-os=$$_tgtos \
|
||||
--output-lua=${TOP}/configure.lua > configure.tmp"; \
|
||||
cat configure.in | \
|
||||
mkconfigure --emul-env=$$_tgtproj --emul-os=$$_tgtos \
|
||||
--output-lua=${TOP}/configure.lua > configure.tmp; \
|
||||
if [ $$? != 0 ]; then \
|
||||
echo "mkconfigure failed"; \
|
||||
rm -fR configure.tmp ${TOP}/configure.lua; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
echo "./configure.tmp $$_tgtopts --with-proj-generation"; \
|
||||
${SH} ./configure.tmp $$_tgtopts --with-proj-generation; \
|
||||
if [ $$? != 0 ]; then \
|
||||
echo "configure failed"; \
|
||||
echo > Makefile.config; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
echo "${MAKE} proj-package-subdir"; \
|
||||
env PROJTARGET="$$_tgtproj" PROJOS="$$_tgtos" \
|
||||
${MAKE} proj-package-subdir; \
|
||||
\
|
||||
if [ "${PROJCONFIGDIR}" != "" ]; then \
|
||||
echo "rm -fR ${PROJCONFIGDIR}"; \
|
||||
rm -fR ${PROJCONFIGDIR}; \
|
||||
echo "mv -f config ${PROJCONFIGDIR}"; \
|
||||
mv -f config ${PROJCONFIGDIR}; \
|
||||
fi; \
|
||||
if [ "${PROJNOCLEAN}" = "no" ]; then \
|
||||
echo "rm -f configure.tmp config.log"; \
|
||||
rm -f configure.tmp config.log; \
|
||||
fi; \
|
||||
\
|
||||
echo "cat Makefile | ${MKPROJFILES} > ${PREMAKEOUT}"; \
|
||||
cat Makefile | \
|
||||
env PROJFLAVOR="$$_tgtflav" \
|
||||
PROJOS="$$_tgtos" \
|
||||
PROJINCLUDES="${TOP}/configure.lua" \
|
||||
${MKPROJFILES} > ${PREMAKEOUT}; \
|
||||
perl ${TOP}/mk/cmpfiles.pl; \
|
||||
echo "${PREMAKE} ${PREMAKEFLAGS} --file ${PREMAKEOUT} \
|
||||
--os $$_tgtos --target $$_tgtproj"; \
|
||||
${PREMAKE} ${PREMAKEFLAGS} --file ${PREMAKEOUT} \
|
||||
--os $$_tgtos --target $$_tgtproj; \
|
||||
if [ $$? != 0 ]; then \
|
||||
echo "premake failed"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
perl ${TOP}/mk/cmpfiles.pl added > .projfiles.out; \
|
||||
echo "* Generated files: "; \
|
||||
cat .projfiles.out; \
|
||||
cp -f .projfiles.out ${PROJFILELIST}; \
|
||||
rm .cmpfiles.out; \
|
||||
if [ "${PROJFILESEXTRA}" != "" ]; then \
|
||||
for EXTRA in ${PROJFILESEXTRA}; do \
|
||||
echo "+ $$EXTRA: "; \
|
||||
echo "$$EXTRA" >> ${PROJFILELIST}; \
|
||||
done; \
|
||||
fi; \
|
||||
if [ -e "${PROJCONFIGDIR}" ]; then \
|
||||
echo "+ ${PROJCONFIGDIR}"; \
|
||||
echo "${PROJCONFIGDIR}" >> ${PROJFILELIST}; \
|
||||
fi; \
|
||||
echo "rm -f ${PROJDIR}/$$_tgtproj-$$_tgtos$$_tgtflav.zip"; \
|
||||
rm -f "${PROJDIR}/$$_tgtproj-$$_tgtos$$_tgtflav.zip"; \
|
||||
echo "* Creating $$_tgtproj-$$_tgtos$$_tgtflav.zip";\
|
||||
cat ${PROJFILELIST} | ${ZIP} ${ZIPFLAGS} \
|
||||
${PROJDIR}/$$_tgtproj-$$_tgtos$$_tgtflav.zip -@;\
|
||||
if [ "${PROJNOCLEAN}" = "no" ]; then \
|
||||
echo "cat .projfiles.out | perl ${TOP}/mk/cleanfiles.pl"; \
|
||||
cat .projfiles.out | perl ${TOP}/mk/cleanfiles.pl; \
|
||||
echo "rm -fR ${PROJCONFIGDIR} ${PROJFILELIST}"; \
|
||||
rm -fR ${PROJCONFIGDIR} ${PROJFILELIST}; \
|
||||
echo "rm -f .projfiles.out ${TOP}/configure.lua"; \
|
||||
rm -f .projfiles.out ${TOP}/configure.lua; \
|
||||
fi; \
|
||||
done
|
||||
@echo "* Done"
|
||||
|
||||
.PHONY: proj
|
||||
307
mk/build.subdir.mk
Normal file
307
mk/build.subdir.mk
Normal file
@ -0,0 +1,307 @@
|
||||
#
|
||||
# Copyright (c) 2001-2009 Hypertriton, Inc. <http://hypertriton.com/>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# 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 AUTHOR 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.
|
||||
|
||||
#
|
||||
# Logic required for recursing into subdirectories.
|
||||
#
|
||||
|
||||
MAKE?=make
|
||||
|
||||
all-subdir:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
all-subdir-ifexists:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
if [ -e "$$F" ]; then \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
clean-subdir:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ clean); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
clean-subdir-ifexists:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
if [ -e "$$F" ]; then \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ clean); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
install-subdir:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ install); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
install-subdir-ifexists:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
if [ -e "$$F" ]; then \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ install); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
deinstall-subdir:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ deinstall); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
deinstall-subdir-ifexists:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
if [ -e "$$F" ]; then \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ deinstall); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
depend-subdir:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ depend); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
depend-subdir-ifexists:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
if [ -e "$$F" ]; then \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ depend); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
|
||||
cleandir-subdir:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ cleandir); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
cleandir-subdir-ifexists:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
if [ -e "$$F" ]; then \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ cleandir); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
regress-subdir:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ regress); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
regress-subdir-ifexists:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
if [ -e "$$F" ]; then \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ regress); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
proj-package-subdir:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ proj-package); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
proj-clean-subdir:
|
||||
@(if [ "${SUBDIR}" = "" ]; then \
|
||||
SUBDIR="NONE"; \
|
||||
else \
|
||||
SUBDIR="${SUBDIR}"; \
|
||||
fi; \
|
||||
if [ "$$SUBDIR" != "" -a "$$SUBDIR" != "NONE" ]; then \
|
||||
for F in $$SUBDIR; do \
|
||||
echo "==> ${REL}$$F"; \
|
||||
(cd $$F && ${MAKE} REL=${REL}$$F/ proj-clean); \
|
||||
if [ $$? != 0 ]; then \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done; \
|
||||
fi)
|
||||
|
||||
.PHONY: all-subdir clean-subdir cleandir-subdir install-subdir
|
||||
.PHONY: deinstall-subdir depend-subdir regress-subdir
|
||||
.PHONY: all-subdir-ifexists clean-subdir-ifexists cleandir-subdir-ifexists
|
||||
.PHONY: install-subdir-ifexists deinstall-subdir-ifexists
|
||||
.PHONY: depend-subdir-ifexists regress-subdir-ifexists
|
||||
.PHONY: proj-package-subdir proj-clean-subdir
|
||||
1554
mk/config.guess
vendored
Normal file
1554
mk/config.guess
vendored
Normal file
File diff suppressed because it is too large
Load Diff
27
mk/install-manpages.sh
Normal file
27
mk/install-manpages.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Public domain
|
||||
#
|
||||
# Install the manual pages ${MAN} and ${CATMAN} into ${MANDIR} and
|
||||
# ${CATMANDIR}, respectively. ${CATMAN} is optional.
|
||||
#
|
||||
|
||||
for F in ${MAN}; do
|
||||
echo "${INSTALL_DATA} $F ${MANDIR}"
|
||||
${INSTALL_DATA} $F ${MANDIR}
|
||||
if [ $? != 0 ]; then
|
||||
exit 1;
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${NOCATMAN}" != "yes" ]; then
|
||||
for F in ${CATMAN} ignore; do
|
||||
if [ "$F" = "ignore" ]; then continue; fi
|
||||
CAT=`echo $F | sed 's/.1$$/.cat1/'`
|
||||
echo "${INSTALL_DATA} $CAT ${CATMANDIR}"
|
||||
${INSTALL_DATA} $CAT ${CATMANDIR}
|
||||
if [ $? != 0 ]; then
|
||||
exit 1;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
143
mk/mkdep
Normal file
143
mk/mkdep
Normal file
@ -0,0 +1,143 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $Csoft: mkdep,v 1.8 2003/08/13 03:57:04 vedge Exp $
|
||||
# $OpenBSD: mkdep.gcc.sh,v 1.10 2000/07/23 22:22:07 millert Exp $
|
||||
# $NetBSD: mkdep.gcc.sh,v 1.9 1994/12/23 07:34:59 jtc Exp $
|
||||
#
|
||||
# Copyright (c) 1991, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
||||
#
|
||||
# @(#)mkdep.gcc.sh 8.1 (Berkeley) 6/6/93
|
||||
#
|
||||
|
||||
D=.depend # default dependency file is .depend
|
||||
append=0
|
||||
pflag=
|
||||
lflag=
|
||||
|
||||
while :
|
||||
do case "$1" in
|
||||
# -a appends to the depend file
|
||||
-a)
|
||||
append=1
|
||||
shift ;;
|
||||
|
||||
# -f allows you to select a makefile name
|
||||
-f)
|
||||
D=$2
|
||||
shift; shift ;;
|
||||
|
||||
# the -p flag produces "program: program.c" style dependencies
|
||||
# so .o's don't get produced
|
||||
-p)
|
||||
pflag=p
|
||||
shift ;;
|
||||
|
||||
# the -l flag produces dependencies for .lo's instead of .o's
|
||||
-l)
|
||||
lflag=p
|
||||
shift ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
ccargs=""
|
||||
for arg
|
||||
do
|
||||
case "${arg}" in
|
||||
-I*|-D*|*.c*)
|
||||
ccargs="${ccargs} ${arg}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "${ccargs}" = "" ]; then
|
||||
echo 'mkdep: nothing to do'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# = 0 ] ; then
|
||||
echo 'usage: mkdep [-p] [-l] [-f depend_file] [cc_flags] file ...'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DTMP=/tmp/mkdep$$
|
||||
TMP=$DTMP/mkdep
|
||||
OTMP=$DTMP/out
|
||||
|
||||
um=`umask`
|
||||
umask 022
|
||||
if ! mkdir $DTMP ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
umask $um
|
||||
trap 'rm -rf $DTMP ; trap 2 ; kill -2 $$' 1 2 3 13 15
|
||||
|
||||
if [ x$pflag = x ]; then
|
||||
echo "${CC} -M ${ccargs}"
|
||||
${CC} -M ${ccargs} > $OTMP
|
||||
if [ $? != 0 ]; then
|
||||
rm -rf $DTMP
|
||||
exit 1
|
||||
fi
|
||||
if [ x$lflag = x ]; then
|
||||
cat $OTMP | sed -e 's; \./; ;g' > $TMP
|
||||
else
|
||||
cat $OTMP | sed -e 's; \./; ;g' -e 's;\.o:;\.lo:;g' > $TMP
|
||||
fi
|
||||
else
|
||||
echo "${CC} -M ${ccargs}"
|
||||
${CC} -M ${ccargs} > $OTMP
|
||||
if [ $? != 0 ]; then
|
||||
rm -rf $DTMP
|
||||
exit 1
|
||||
fi
|
||||
cat $OTMP | sed -e 's;\.o[ ]*:; :;' -e 's; \./; ;g' > $TMP
|
||||
fi
|
||||
|
||||
if [ $append = 1 ]; then
|
||||
cat $TMP >> $D
|
||||
if [ $? != 0 ]; then
|
||||
rm -rf $DTMP
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
mv -f $TMP $D
|
||||
if [ $? != 0 ]; then
|
||||
rm -rf $DTMP
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf $DTMP
|
||||
exit 0
|
||||
37
mk/tests/imlib2.pm
Normal file
37
mk/tests/imlib2.pm
Normal file
@ -0,0 +1,37 @@
|
||||
sub Test
|
||||
{
|
||||
my ($ver, $pfx) = @_;
|
||||
|
||||
MkExecPkgConfig($pfx, 'imlib2', '--modversion', 'IMLIB2_VERSION');
|
||||
MkExecPkgConfig($pfx, 'imlib2', '--cflags', 'IMLIB2_CFLAGS');
|
||||
MkExecPkgConfig($pfx, 'imlib2', '--libs', 'IMLIB2_LIBS');
|
||||
MkIfNE('${IMLIB2_VERSION}', '');
|
||||
MkCompileC('HAVE_IMLIB2', '${IMLIB2_CFLAGS}', '${IMLIB2_LIBS}', << 'EOF');
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <Imlib2.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
imlib_context_set_display(NULL);
|
||||
|
||||
return (0);
|
||||
}
|
||||
EOF
|
||||
MkSaveIfTrue('${HAVE_IMLIB2}', 'IMLIB2_CFLAGS', 'IMLIB2_LIBS');
|
||||
MkElse;
|
||||
MkPrint('no');
|
||||
MkSaveUndef('HAVE_IMLIB2');
|
||||
MkEndif;
|
||||
return (0);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$DESCR{'imlib2'} = 'Imlib2 library (http://docs.enlightenment.org/api/imlib2/html)';
|
||||
$TESTS{'imlib2'} = \&Test;
|
||||
$DEPS{'imlib2'} = 'cc,x11';
|
||||
}
|
||||
|
||||
;1
|
||||
37
mk/tests/xft.pm
Normal file
37
mk/tests/xft.pm
Normal file
@ -0,0 +1,37 @@
|
||||
|
||||
sub Test
|
||||
{
|
||||
my ($ver, $pfx) = @_;
|
||||
|
||||
MkExecPkgConfig($pfx, 'xft', '--modversion', 'XFT_VERSION');
|
||||
MkExecPkgConfig($pfx, 'xft', '--cflags', 'XFT_CFLAGS');
|
||||
MkExecPkgConfig($pfx, 'xft', '--libs', 'XFT_LIBS');
|
||||
MkIfNE('${XFT_VERSION}', '');
|
||||
MkCompileC('HAVE_XFT', '${XFT_CFLAGS}', '${XFT_LIBS}', << 'EOF');
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <X11/Xft/Xft.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
XftFontOpenName(NULL, 0, NULL);
|
||||
return (0);
|
||||
}
|
||||
EOF
|
||||
MkSaveIfTrue('${HAVE_XFT}', 'XFT_CFLAGS', 'XFT_LIBS');
|
||||
MkElse;
|
||||
MkPrint('no');
|
||||
MkSaveUndef('HAVE_XFT');
|
||||
MkEndif;
|
||||
return (0);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$DESCR{'xft'} = 'X11 xft extension';
|
||||
$TESTS{'xft'} = \&Test;
|
||||
$DEPS{'xft'} = 'cc,x11';
|
||||
}
|
||||
|
||||
;1
|
||||
38
mk/tests/xinerama.pm
Normal file
38
mk/tests/xinerama.pm
Normal file
@ -0,0 +1,38 @@
|
||||
|
||||
sub Test
|
||||
{
|
||||
my ($ver, $pfx) = @_;
|
||||
|
||||
MkExecPkgConfig($pfx, 'xinerama', '--modversion', 'XINERAMA_VERSION');
|
||||
MkExecPkgConfig($pfx, 'xinerama', '--cflags', 'XINERAMA_CFLAGS');
|
||||
MkExecPkgConfig($pfx, 'xinerama', '--libs', 'XINERAMA_LIBS');
|
||||
MkIfNE('${XINERAMA_VERSION}', '');
|
||||
MkCompileC('HAVE_XINERAMA', '${XINERAMA_CFLAGS}', '${XINERAMA_LIBS}', << 'EOF');
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <X11/extensions/Xinerama.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
XineramaQueryExtension(NULL, NULL, NULL);
|
||||
|
||||
return (0);
|
||||
}
|
||||
EOF
|
||||
MkSaveIfTrue('${HAVE_XINERAMA}', 'XINERAMA_CFLAGS', 'XINERAMA_LIBS');
|
||||
MkElse;
|
||||
MkPrint('no');
|
||||
MkSaveUndef('HAVE_XINERAMA');
|
||||
MkEndif;
|
||||
return (0);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$DESCR{'xinerama'} = 'X11 Xinerama library';
|
||||
$TESTS{'xinerama'} = \&Test;
|
||||
$DEPS{'xinerama'} = 'cc,x11';
|
||||
}
|
||||
|
||||
;1
|
||||
38
mk/tests/xrandr.pm
Normal file
38
mk/tests/xrandr.pm
Normal file
@ -0,0 +1,38 @@
|
||||
|
||||
sub Test
|
||||
{
|
||||
my ($ver, $pfx) = @_;
|
||||
|
||||
MkExecPkgConfig($pfx, 'xrandr', '--modversion', 'XRANDR_VERSION');
|
||||
MkExecPkgConfig($pfx, 'xrandr', '--cflags', 'XRANDR_CFLAGS');
|
||||
MkExecPkgConfig($pfx, 'xrandr', '--libs', 'XRANDR_LIBS');
|
||||
MkIfNE('${XRANDR_VERSION}', '');
|
||||
MkCompileC('HAVE_XRANDR', '${XRANDR_CFLAGS}', '${XRANDR_LIBS}', << 'EOF');
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
XRRQueryExtension(NULL, NULL, NULL);
|
||||
|
||||
return (0);
|
||||
}
|
||||
EOF
|
||||
MkSaveIfTrue('${HAVE_XRANDR}', 'XRANDR_CFLAGS', 'XRANDR_LIBS');
|
||||
MkElse;
|
||||
MkPrint('no');
|
||||
MkSaveUndef('HAVE_XRANDR');
|
||||
MkEndif;
|
||||
return (0);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
$DESCR{'xrandr'} = 'X11 xrandr extension';
|
||||
$TESTS{'xrandr'} = \&Test;
|
||||
$DEPS{'xrandr'} = 'cc,x11';
|
||||
}
|
||||
|
||||
;1
|
||||
Loading…
x
Reference in New Issue
Block a user