Module Name: src Committed By: pooka Date: Mon Dec 13 17:22:26 UTC 2010
Modified Files: src/share/mk: bsd.own.mk bsd.prog.mk Log Message: Define RUMPPRG, which is just like PROG, except it additionally builds a rump client with the name rump.${PROG}. The rump client is not installed suid/sgid by default even if BINMODE is defined. To generate a diff of this commit: cvs rdiff -u -r1.645 -r1.646 src/share/mk/bsd.own.mk cvs rdiff -u -r1.254 -r1.255 src/share/mk/bsd.prog.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.645 src/share/mk/bsd.own.mk:1.646 --- src/share/mk/bsd.own.mk:1.645 Sun Dec 5 09:54:34 2010 +++ src/share/mk/bsd.own.mk Mon Dec 13 17:22:26 2010 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.645 2010/12/05 09:54:34 mrg Exp $ +# $NetBSD: bsd.own.mk,v 1.646 2010/12/13 17:22:26 pooka Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -442,6 +442,13 @@ BINMODE?= 555 NONBINMODE?= 444 +# These are here mainly because we don't want suid root in case +# a Makefile defines BINMODE. +RUMPBINGRP?= wheel +RUMPBINOWN?= root +RUMPBINMODE?= 555 +RUMPNONBINMODE?=444 + MANDIR?= /usr/share/man MANGRP?= wheel MANOWN?= root Index: src/share/mk/bsd.prog.mk diff -u src/share/mk/bsd.prog.mk:1.254 src/share/mk/bsd.prog.mk:1.255 --- src/share/mk/bsd.prog.mk:1.254 Fri Dec 10 20:08:17 2010 +++ src/share/mk/bsd.prog.mk Mon Dec 13 17:22:26 2010 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prog.mk,v 1.254 2010/12/10 20:08:17 joerg Exp $ +# $NetBSD: bsd.prog.mk,v 1.255 2010/12/13 17:22:26 pooka Exp $ # @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94 .ifndef HOSTPROG @@ -179,6 +179,11 @@ ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${STRIPFLAG} ${.ALLSRC} ${.TARGET} +__progrumpinstall: .USE + ${_MKTARGET_INSTALL} + ${INSTALL_FILE} -o ${RUMPBINOWN} -g ${RUMPBINGRP} -m ${RUMPBINMODE} \ + ${STRIPFLAG} ${.ALLSRC} ${.TARGET} + __progdebuginstall: .USE ${_MKTARGET_INSTALL} ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \ @@ -204,6 +209,22 @@ _CCLINK= ${CXX} ${_CCLINKFLAGS} .endif +.if defined(RUMPPRG) +PROG= ${RUMPPRG} +PROGS= ${RUMPPRG} rump.${RUMPPRG} +. if defined(SRCS) +SRCS.rump.${PROG}:= ${SRCS} ${PROG}_rumpops.c ${RUMPSRCS} +SRCS+= ${PROG}_hostops.c +. else +SRCS= ${PROG}.c ${PROG}_hostops.c +SRCS.rump.${PROG}= ${PROG}.c ${PROG}_rumpops.c ${RUMPSRCS} +. endif +LDADD.rump.${PROG}+= -lrumpclient +DPADD.rump.${PROG}+= ${LIBRUMPCLIENT} +MAN.rump.${PROG}= # defined but feeling empty +_RUMPINSTALL.rump.${PROG}=# defined +.endif + .if defined(PROG) _CCLINK?= ${CC} ${_CCLINKFLAGS} . if defined(MAN) @@ -224,14 +245,14 @@ # Turn the single-program PROG and PROG_CXX variables into their multi-word # counterparts, PROGS and PROGS_CXX. -.if defined(PROG_CXX) && !defined(PROGS_CXX) +.if !defined(RUMPPRG) +. if defined(PROG_CXX) && !defined(PROGS_CXX) PROGS_CXX= ${PROG_CXX} -.elif defined(PROG) && !defined(PROGS) +. elif defined(PROG) && !defined(PROGS) PROGS= ${PROG} +. endif .endif - - # # Per-program definitions and targets. # @@ -351,7 +372,11 @@ ${_PROGDEBUG.${_P}:D${DESTDIR}${DEBUGDIR}${BINDIR.${_P}}/${_PROGDEBUG.${_P}}} .if ${MKUPDATE} == "no" +.if defined(_RUMPINSTALL.${_P}) +${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __progrumpinstall +.else ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! ${_P} __proginstall +.endif .if !defined(BUILD) && !make(all) && !make(${_P}) ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}! .MADE .endif @@ -362,7 +387,11 @@ .endif .endif # define(_PROGDEBUG.${_P}) .else # MKUPDATE != no +.if defined(_RUMPINSTALL.${_P}) +${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __progrumpinstall +.else ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: ${_P} __proginstall +.endif .if !defined(BUILD) && !make(all) && !make(${_P}) ${DESTDIR}${BINDIR.${_P}}/${PROGNAME.${_P}}: .MADE .endif