comments for a pmake newb

Christian Weisgerber naddy at mips.inka.de
Tue Nov 11 15:30:09 UTC 2014


On 2014-11-10, Joseph Mingrone <jrm at ftfl.ca> wrote:

> I'm porting a program that uses a simple GNU make file, but I'm thinking
> about replacing the make file to remove the devel/gmake dependency.  I
> don't foresee many upstream changes that will make this an issue.  Is
> this a bad/good idea?

Probably not worth it.
If upstream intended to provide a portable Makefile but inadvertently
included gmake-isms, you can create a patch to fix this and submit
it back upstream.

> Are there any example ports that do this?  My
> searching didn't turn any up.

Potential candidates are ports that come with Makefile* in their
files/ directory.

> CFLAGS  = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_THREAD_SAFE -D_XOPEN_SOURCE=700 -pedantic -std=c11 -Wall
> INC	= -I/usr/local/include
> LDFLAGS = -L/usr/local/lib
> LDLIBS  = -lX11
>
> .ifmake debug
>    CFLAGS += -DDEBUG -g -O0
> .else
>    CFLAGS += -DNDEBUG -O3
> .endif

Do you intend to override CFLAGS again from the ports Makefile?

A port should respect the system CFLAGS that are passed in.  It
obviously can add -DBLA, but it must not clobber optimization setting
with its own -Ox.  Similarly, it shouldn't hardcode /usr/local but
use ${LOCALBASE}.

-- 
Christian "naddy" Weisgerber                          naddy at mips.inka.de


More information about the freebsd-ports mailing list