2008-01-05 19:25:55 +00:00
|
|
|
# rules to build a library
|
|
|
|
# based on FreeBSD's bsd.prog.mk
|
|
|
|
|
2008-03-26 17:53:37 +00:00
|
|
|
# Copyright 2008 Roy Marples <roy@marples.name>
|
|
|
|
# All rights reserved. Released under the 2-clause BSD license.
|
2008-01-05 19:25:55 +00:00
|
|
|
|
|
|
|
OBJS+= ${SRCS:.c=.o}
|
|
|
|
|
2008-01-11 17:21:21 +00:00
|
|
|
# Some systems don't include /lib in their standard link path
|
|
|
|
# so we should embed it if different
|
2008-01-11 23:40:22 +00:00
|
|
|
# This is currently hardcoded for NetBSD which has two dynamic linkers
|
|
|
|
# and we need to use the one in /libexec instead of /usr/libexec
|
2008-03-02 10:40:08 +00:00
|
|
|
_DYNLINK_SH= if test "${PREFIX}" = "" && test -e /libexec/ld.elf_so; then \
|
2008-01-11 23:40:22 +00:00
|
|
|
echo "-Wl,-dynamic-linker=/libexec/ld.elf_so"; \
|
2008-01-18 11:26:23 +00:00
|
|
|
else \
|
|
|
|
echo ""; \
|
2008-01-11 17:21:21 +00:00
|
|
|
fi
|
2008-01-11 23:40:22 +00:00
|
|
|
_DYNLINK!= ${_DYNLINK_SH}
|
|
|
|
LDFLAGS+= ${_DYNLINK}$(shell ${_DYNLINK_SH})
|
2008-03-02 10:40:08 +00:00
|
|
|
LDFLAGS+= -Wl,-rpath=${PREFIX}/${LIBNAME} -L${PREFIX}/${LIBNAME}
|
2008-01-11 17:21:21 +00:00
|
|
|
LDFLAGS+= ${PROGLDFLAGS}
|
|
|
|
|
2008-03-03 13:04:08 +00:00
|
|
|
CLEANFILES+= ${OBJS} ${PROG}
|
|
|
|
|
2008-01-07 14:20:13 +00:00
|
|
|
all: depend ${PROG}
|
2008-01-05 19:25:55 +00:00
|
|
|
|
|
|
|
${PROG}: ${SCRIPTS} ${OBJS}
|
2008-02-20 18:06:01 +00:00
|
|
|
${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
|
2008-01-05 19:25:55 +00:00
|
|
|
|
2008-01-09 11:44:43 +00:00
|
|
|
clean:
|
2008-03-03 13:04:08 +00:00
|
|
|
rm -f ${CLEANFILES}
|
2008-01-07 14:20:13 +00:00
|
|
|
|
2008-03-19 15:22:20 +00:00
|
|
|
include ${MK}/sys.mk
|
|
|
|
include ${MK}/os.mk
|
2008-01-10 16:35:59 +00:00
|
|
|
include ${MK}/depend.mk
|
2008-03-03 13:04:08 +00:00
|
|
|
include ${MK}/gitignore.mk
|