switching from gnu make to bsd make

Polytropon freebsd at edvax.de
Thu Feb 10 08:10:40 UTC 2011


On Thu, 10 Feb 2011 09:32:06 +0200, Vikash Badal <Vikash.Badal at is.co.za> wrote:
> Can someone please advise me as to how I switch the following lines of gnu make to bsd make
> 
> 
> $(OBJDIR)/%.o:${SRCDIR}/%.c
>         ${CC} -c ${CFLAGS} ${INCDIR} ${LIBDIR} $< -o $@

It sems to work with BSD make, I've tried it.

	% make foo
	... starts compiling foo.c ...

The only thing I would change is the order of the last
arguments, which should be "-o $@ $<" (input files last),
and a space after ":" in the first line (for better
reading). Anyway, it seems to be compatible.

Of course, in my testing case OBJDIR and SRCDIR are
empty, and I didn't define any of CC, CFLAGS, INCDIR or
LIBDIR, so the defaults have been chosen.

Do you encounter a specific problem?



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list