Re: Need help with a makefile

From: Greg 'groggy' Lehey <grog_at_freebsd.org>
Date: Wed, 07 Feb 2024 03:38:52 UTC
On Wednesday,  7 February 2024 at  3:21:00 +0000, Jonathan Adams wrote:
>   I'm having a heck of a time getting my makefile conditional
>    statements to not cause `make` to have fits.
>
> Here is the start of the makefile including the troublesome bits:
> ...
>
>    7   │ ifeq ($(UNAME),FreeBSD) \
>    8   │     CFLAGS += -D BSD \
>    9   │ else ifeq ($(UNAME),Linux) \
>   10   │     CFLAGS += -D LINUX \
>   11   │ endif

This looks like GNU make.

> And here are the errors from `make`:
>> /portable/src$ make

And you're feeding it to BSD make.

The simple answer: use GNU make.  That should be installed on your
system, though it's not part of base FreeBSD.  It's called gmake.  If
you don't have it, there's a package.

However, I've put this through gmake, and it complains:

  $ gmake
  Makefile:7: extraneous text after 'ifeq' directive

I don't know GNU make very well, but possibly you can find the reason.
Quoting, maybe?

Greg
--
When replying to this message, please copy the original recipients.
If you don't, I may ignore the reply or reply to the original recipients.
For more information, see http://www.lemis.com/questions.html
Sent from my desktop computer.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php