openrc/mk/prog.mk

27 lines
603 B
Makefile
Raw Normal View History

# rules to build a library
# based on FreeBSD's bsd.prog.mk
# Copyright 2008 Roy Marples
OBJS+= ${SRCS:.c=.o}
include ${MK}/sys.mk
# Some systems don't include /lib in their standard link path
# so we should embed it if different
_RPATH_SH= if test "${SHLIBDIR}" != "/usr/${LIBNAME}"; then \
2008-01-12 00:25:46 +05:30
echo "-Wl,-rpath=/${LIBNAME}"; \
fi
_RPATH!= ${_RPATH_SH}
LDFLAGS+= ${_RPATH}$(shell ${_RPATH_SH})
LDFLAGS+= ${PROGLDFLAGS}
all: depend ${PROG}
${PROG}: ${SCRIPTS} ${OBJS}
${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
2008-01-09 17:14:43 +05:30
clean:
rm -f ${OBJS} ${PROG} ${CLEANFILES}
include ${MK}/depend.mk