Rejig the build system a little so we have per ok defs per system. Probably easier in the long run.

This commit is contained in:
Roy Marples 2008-03-19 15:22:20 +00:00
parent 0e6eb0f764
commit 64853c4916
7 changed files with 14 additions and 31 deletions

View File

@ -51,5 +51,6 @@ clean:
rm -f ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK} ${CLEANFILES} rm -f ${OBJS} ${SOBJS} ${_LIBS} ${SHLIB_LINK} ${CLEANFILES}
include ${MK}/sys.mk include ${MK}/sys.mk
include ${MK}/os.mk
include ${MK}/depend.mk include ${MK}/depend.mk
include ${MK}/gitignore.mk include ${MK}/gitignore.mk

View File

@ -5,28 +5,10 @@
_OS_SH= uname -s _OS_SH= uname -s
_OS!= ${_OS_SH} _OS!= ${_OS_SH}
OS?= ${_OS}$(shell ${_OS_SH}) OS?= ${_OS}$(shell ${_OS_SH})
include ${MK}/os-${OS}.mk
_SUBOS_SH= case `uname -s` in \
*BSD|DragonFly) echo "BSD";; \
*) uname -s;; \
esac
_SUBOS!= ${_SUBOS_SH}
SUBOS?= ${_SUBOS}$(shell ${_SUBOS_SH})
RC_LIB= /$(LIBNAME)/rc RC_LIB= /$(LIBNAME)/rc
_DEF_SH= case `uname -s` in Linux) echo "-D_BSD_SOURCE -D_XOPEN_SOURCE=600";; *) echo;; esac
_DEF!= ${_DEF_SH}
CFLAGS+= ${_DEF}$(shell ${_DEF_SH})
_LIBDL_SH= case `uname -s` in Linux) echo "-Wl,-Bdynamic -ldl";; *) echo;; esac
_LIBDL!= ${_LIBDL_SH}
LIBDL?= ${_LIBDL}$(shell ${_LIBDL_SH})
_LIBKVM_SH= case `uname -s` in *BSD) echo "-lkvm";; *) echo;; esac
_LIBKVM!= ${_LIBKVM_SH}
LIBKVM?= ${_LIBKVM}$(shell ${_LIBKVM_SH})
_PREFIX_SH= if test -n "${PREFIX}" && test "${PREFIX}" != "/"; then echo "-DPREFIX=\\\"${PREFIX}\\\""; else echo ""; fi _PREFIX_SH= if test -n "${PREFIX}" && test "${PREFIX}" != "/"; then echo "-DPREFIX=\\\"${PREFIX}\\\""; else echo ""; fi
_PREFIX!= ${_PREFIX_SH} _PREFIX!= ${_PREFIX_SH}
CFLAGS+= ${_PREFIX}$(shell ${_PREFIX_SH}) CFLAGS+= ${_PREFIX}$(shell ${_PREFIX_SH})
@ -34,3 +16,7 @@ CFLAGS+= ${_PREFIX}$(shell ${_PREFIX_SH})
_PKG_PREFIX_SH= if test -n "${PKG_PREFIX}" && test "${PKG_PREFIX}" != "/"; then echo "-DPKG_PREFIX=\\\"${PKG_PREFIX}\\\""; else echo ""; fi _PKG_PREFIX_SH= if test -n "${PKG_PREFIX}" && test "${PKG_PREFIX}" != "/"; then echo "-DPKG_PREFIX=\\\"${PKG_PREFIX}\\\""; else echo ""; fi
_PKG_PREFIX!= ${_PKG_PREFIX_SH} _PKG_PREFIX!= ${_PKG_PREFIX_SH}
CFLAGS+= ${_PKG_PREFIX}$(shell ${_PKG_PREFIX_SH}) CFLAGS+= ${_PKG_PREFIX}$(shell ${_PKG_PREFIX_SH})
_LCL_PREFIX_SH= if test -n "${LOCAL_PREFIX}" && test "${LOCAL_PREFIX}" != "/"; then echo "-DLOCAL_PREFIX=\\\"${LOCAL_PREFIX}\\\""; else echo ""; fi
_LCL_PREFIX!= ${_LCL_PREFIX_SH}
CFLAGS+= ${_LCL_PREFIX}$(shell ${_LCL_PREFIX_SH})

View File

@ -5,7 +5,6 @@
OBJS+= ${SRCS:.c=.o} OBJS+= ${SRCS:.c=.o}
include ${MK}/sys.mk
# Some systems don't include /lib in their standard link path # Some systems don't include /lib in their standard link path
# so we should embed it if different # so we should embed it if different
# This is currently hardcoded for NetBSD which has two dynamic linkers # This is currently hardcoded for NetBSD which has two dynamic linkers
@ -30,5 +29,7 @@ ${PROG}: ${SCRIPTS} ${OBJS}
clean: clean:
rm -f ${CLEANFILES} rm -f ${CLEANFILES}
include ${MK}/sys.mk
include ${MK}/os.mk
include ${MK}/depend.mk include ${MK}/depend.mk
include ${MK}/gitignore.mk include ${MK}/gitignore.mk

View File

@ -11,7 +11,7 @@ PREFIX?=
_UPREFIX_SH= case "${PREFIX}" in "") echo /usr;; *) echo "${PREFIX}";; esac _UPREFIX_SH= case "${PREFIX}" in "") echo /usr;; *) echo "${PREFIX}";; esac
_UPREFIX!= ${_UPREFIX_SH} _UPREFIX!= ${_UPREFIX_SH}
UPREFIX= ${_UPREFIX}$(shell ${_UPREFIX_SH}) UPREFIX= ${_UPREFIX}$(shell ${_UPREFIX_SH})
PKG_PREFIX= /usr/local LOCAL_PREFIX= /usr/local
PICFLAG?= -fPIC PICFLAG?= -fPIC

View File

@ -1,6 +1,3 @@
MK= ../../mk
include ${MK}/os.mk
LIB= einfo LIB= einfo
SHLIB_MAJOR= 1 SHLIB_MAJOR= 1
SRCS= libeinfo.c SRCS= libeinfo.c
@ -9,6 +6,7 @@ VERSION_MAP= einfo.map
CFLAGS+= -I../includes CFLAGS+= -I../includes
include ${MK}/cc.mk MK= ../../mk
include ${MK}/lib.mk include ${MK}/lib.mk
include ${MK}/cc.mk
include ${MK}/${MKTERMCAP}.mk include ${MK}/${MKTERMCAP}.mk

View File

@ -1,6 +1,3 @@
MK= ../../mk
include ${MK}/os.mk
LIB= rc LIB= rc
SHLIB_MAJOR= 1 SHLIB_MAJOR= 1
SRCS= librc.c librc-daemon.c librc-depend.c librc-misc.c \ SRCS= librc.c librc-daemon.c librc-depend.c librc-misc.c \
@ -14,5 +11,6 @@ LDADD+= ${LIBKVM}
CFLAGS+= -I../includes CFLAGS+= -I../includes
include ${MK}/cc.mk MK= ../../mk
include ${MK}/lib.mk include ${MK}/lib.mk
include ${MK}/cc.mk

View File

@ -36,9 +36,8 @@ LDADD+= -lutil -lrc -leinfo
#LDFLAGS+= -Wl,--rpath=../librc -Wl,--rpath=../libeinfo #LDFLAGS+= -Wl,--rpath=../librc -Wl,--rpath=../libeinfo
MK= ../../mk MK= ../../mk
include ${MK}/cc.mk
include ${MK}/os.mk
include ${MK}/prog.mk include ${MK}/prog.mk
include ${MK}/cc.mk
CFLAGS+= -I../includes -I../librc -I../libeinfo CFLAGS+= -I../includes -I../librc -I../libeinfo
CFLAGS+= -DLIB=\"${LIBNAME}\" CFLAGS+= -DLIB=\"${LIBNAME}\"