Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Feb 2011 09:10:36 +0100
From:      Polytropon <>
To:        Vikash Badal <>
Cc:        "" <>
Subject:   Re: switching from gnu make to bsd make
Message-ID:  <>
In-Reply-To: <>
References:  <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Thu, 10 Feb 2011 09:32:06 +0200, Vikash Badal <> 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?

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

Want to link to this message? Use this URL: <>