From 28afeac09e15c9983021d7afb7af523f8f62c5fa Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 11 Jan 2008 16:03:38 +0000 Subject: [PATCH] Add sys.mk to define system locations. --- man/Makefile | 14 +++++++------- mk/lib.mk | 17 +---------------- mk/os.mk | 3 --- mk/prog.mk | 4 +--- mk/sys.mk | 22 ++++++++++++++++++++++ runlevels/Makefile | 1 + 6 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 mk/sys.mk diff --git a/man/Makefile b/man/Makefile index eaae253f..ee044d3f 100644 --- a/man/Makefile +++ b/man/Makefile @@ -1,4 +1,3 @@ -DIR= /usr/share/man _MAN3_SH= ls -1 *.3 _MAN3!= ${_MAN3_SH} MAN3= ${_MAN3}$(shell ${_MAN3_SH}) @@ -14,23 +13,24 @@ MAKE_LINKS= suffix=$${man\#*.}; \ -n -e '/^\.Sh NAME$$/,/\.Sh/ s/\.Nm //p' $${man}`; do \ if test "$${link}" != "$${prefix}" ; then \ ln -sf $${man} \ - ${DESTDIR}/${DIR}/man$${suffix}/$${link}.$${suffix} ; \ + ${DESTDIR}/${MANDIR}$${suffix}/$${link}.$${suffix} ; \ fi; \ done; -INSTALL?= install +MK= ../mk +include ${MK}/sys.mk all: install: - ${INSTALL} -d ${DESTDIR}/${DIR}/man3 + ${INSTALL} -d ${DESTDIR}/${MANDIR}3 for man in ${MAN3}; do \ - ${INSTALL} -m 0644 "$$man" ${DESTDIR}/${DIR}/man3 || exit $$?; \ + ${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}3 || exit $$?; \ ${MAKE_LINKS} \ done - ${INSTALL} -d ${DESTDIR}/${DIR}/man8 + ${INSTALL} -d ${DESTDIR}/${MANDIR}8 for man in ${MAN8}; do \ - ${INSTALL} -m 0644 "$$man" ${DESTDIR}/${DIR}/man8 || exit $$?; \ + ${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}8 || exit $$?; \ ${MAKE_LINKS} \ done diff --git a/mk/lib.mk b/mk/lib.mk index 7a570ebe..43856bf2 100644 --- a/mk/lib.mk +++ b/mk/lib.mk @@ -3,30 +3,14 @@ # Copyright 2008 Roy Marples -LIBNAME?= lib - SHLIB_NAME= lib${LIB}.so.${SHLIB_MAJOR} SHLIB_LINK= lib${LIB}.so -SHLIBDIR?= /${LIBNAME} SONAME?= ${SHLIB_NAME} OBJS+= ${SRCS:.c=.o} SOBJS+= ${OBJS:.o=.So} _LIBS= lib${LIB}.a ${SHLIB_NAME} -ECHO?= echo -AR?= ar -RANLIB?= ranlib -INSTALL?= install - -PICFLAG?= -fPIC - -INCDIR?= /usr/include -INCMODE?= 0444 - -LIBDIR?= /usr/${LIBNAME} -LIBMODE?= 0444 - .SUFFIXES: .So .c.So: @@ -62,4 +46,5 @@ install: all clean: rm -f ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK} ${CLEANFILES} +include ${MK}/sys.mk include ${MK}/depend.mk diff --git a/mk/os.mk b/mk/os.mk index f2499416..2de3bc61 100644 --- a/mk/os.mk +++ b/mk/os.mk @@ -29,6 +29,3 @@ LIBDL?= ${_LIBDL}$(shell ${_LIBDL_SH}) _LIBKVM_SH= case `uname -s` in *BSD) echo "-lkvm";; *) echo;; esac _LIBKVM!= ${_LIBKVM_SH} LIBKVM?= ${_LIBKVM}$(shell ${_LIBKVM_SH}) - -# Maye as well define INSTALL here as everything uses us -INSTALL?= install diff --git a/mk/prog.mk b/mk/prog.mk index 716707c6..75562508 100644 --- a/mk/prog.mk +++ b/mk/prog.mk @@ -3,11 +3,8 @@ # Copyright 2008 Roy Marples -BINDIR?= /sbin OBJS+= ${SRCS:.c=.o} -INSTALL?= install - all: depend ${PROG} ${PROG}: ${SCRIPTS} ${OBJS} @@ -16,4 +13,5 @@ ${PROG}: ${SCRIPTS} ${OBJS} clean: rm -f ${OBJS} ${PROG} ${CLEANFILES} +include ${MK}/sys.mk include ${MK}/depend.mk diff --git a/mk/sys.mk b/mk/sys.mk new file mode 100644 index 00000000..471b7064 --- /dev/null +++ b/mk/sys.mk @@ -0,0 +1,22 @@ +# Generic system definitions +# Copyright 2008 Roy Marples + +AR?= ar +ECHO?= echo +INSTALL?= install +RANLIB?= ranlib + +PICFLAG?= -fPIC + +BINDIR?= /sbin + +INCDIR?= /usr/include +INCMODE?= 0444 + +LIBNAME?= lib +LIBDIR?= /usr/${LIBNAME} +LIBMODE?= 0444 +SHLIBDIR?= /${LIBNAME} + +MANDIR?= /usr/share/man/man +MANMODE?= 0444 diff --git a/runlevels/Makefile b/runlevels/Makefile index e6ca09d4..1e2591ab 100644 --- a/runlevels/Makefile +++ b/runlevels/Makefile @@ -7,6 +7,7 @@ BOOTDIR= ${LEVELDIR}/boot DEFAULTDIR= ${LEVELDIR}/default MK= ../mk +include ${MK}/sys.mk include ${MK}/os.mk include Makefile.${OS} include Makefile.${SUBOS}