Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jan 2003 16:59:55 -0500
From:      Pete Fritchman <petef@absolutbsd.org>
To:        David Thiel <lx@redundancy.redundancy.org>
Cc:        ports@freebsd.org
Subject:   Re: makefile style questions
Message-ID:  <20030111215955.GD81234@absolutbsd.org>
In-Reply-To: <20030111215813.GA600@redundancy.redundancy.org>
References:  <20030111215813.GA600@redundancy.redundancy.org>

next in thread | previous in thread | raw e-mail | index | archive | help
++ 11/01/03 13:58 -0800 - David Thiel:
| I've been doing a port of the Samhain IDS, and the distribution has
| an "install-user" target that I'd like users to be able to run from
| the port makefile - in other words, running make install-user in
| /usr/ports/security/samhain runs make install-user in
| /usr/ports/security/samhain/work/samhainx.x.  Without make -C,
| what's the proper way to do this?

I'd add:

install-user:
	@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} install-user)

| Also, when running portlint, I'm always told that RUN_DEPENDS needs
| to be earlier in the makefile - but I'm using it like so:
| 
| .if defined(WITH_GPG)
| CONFIGURE_ARGS+=  --with-gpg=${PREFIX}/bin/gpg
| RUN_DEPENDS=    gnupg:${PORTSDIR}/security/gnupg
| .endif
| 
| Should I be doing that another way?

Well, it should be split up:

MAINTAINER = blah

(other *_DEPENDS)
.if defined(WITH_GPG)
RUN_DEPENDS+=	gnupg...
.endif

(other stuff until you get to configure-related things)
CONFIGURE_ARGS+=	--disable-something-global --whatever
.if defined(WITH_GPG)
CONFIGURE_ARGS+=	--with-gpg
.else
CONFIGURE_ARGS+=	--without-gpg
.endif

Lots of ports don't do it that way, but I think that's the Right Way(tm),
makes the Makefile easier to follow if anything.

--pete


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030111215955.GD81234>