Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Feb 2024 22:40:17 -0500
From:      Paul Procacci <pprocacci@gmail.com>
To:        Jonathan Adams <jfadams1963@proton.me>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Need help with a makefile
Message-ID:  <CAFbbPuiOcg6vt6Xy=1mUOq7K19%2B1S87o=29B8s52Xxi1D=5cMA@mail.gmail.com>
In-Reply-To: <YIWJldQ_ZQqkZd0CmowerZK1sxpNyYgR0XwSaV_OHShYoU7Yonr8_9zgplV0ogOJhJRKPM8tqvubiCCo2rom5L07lXG_sKh62PViYmsxd8M=@proton.me>
References:  <YIWJldQ_ZQqkZd0CmowerZK1sxpNyYgR0XwSaV_OHShYoU7Yonr8_9zgplV0ogOJhJRKPM8tqvubiCCo2rom5L07lXG_sKh62PViYmsxd8M=@proton.me>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000399a8f0610c27209
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Feb 6, 2024 at 10:21=E2=80=AFPM Jonathan Adams <jfadams1963@proton.=
me>
wrote:

> Hi all,
>   I'm having a heck of a time getting my makefile conditional statements
> to not cause `make` to have fits. Could sure use some help on this. This =
is
> a makefile that works great _without_ the conditions, and my program
> compiles and runs on FBSD and Linux.
>   I've just added a function who's header file is in a different location
> on Linux, so I'm needing detect the OS and set the correct preprocessor
> directives. I get the same errors without the line continuation
> backslashes. (More errors actually; one for lines 7, 9, 10, and 11 each)
> I'm using tabs for indent, and have checked for extraneous/misplaced spac=
es
> too.
>
> Here is the start of the makefile including the troublesome bits:
>
>    1   =E2=94=82 CC      =3D cc
>    2   =E2=94=82 CFLAGS  =3D -g -w -Wall -Wextra
>    3   =E2=94=82 LDFLAGS =3D -Wl,--allow-multiple-definition -lssl -lcryp=
to
>
>    4   =E2=94=82 RM      =3D rm -f
>    5   =E2=94=82 UNAME  :=3D $(shell uname)
>    6   =E2=94=82
>
>    7   =E2=94=82 ifeq ($(UNAME),FreeBSD) \
>    8   =E2=94=82     CFLAGS +=3D -D BSD \
>    9   =E2=94=82 else ifeq ($(UNAME),Linux) \
>   10   =E2=94=82     CFLAGS +=3D -D LINUX \
>   11   =E2=94=82 endif
>         <snip>
>
> And here are the errors from `make`:
> ~/portable/src$ make
> make: "/home/jfa/portable/src/makefile" line 7: Invalid line type
> make: Fatal errors encountered -- cannot continue
> make: stopped in /home/jfa/portable/src
>
>   I'm working on 14.0-RELEASE-p4. I've found plenty of advice on
> Stackoverflow, but nothing that solves the issue. Duckduckgo-ing produces
> more of the same, so I thought I'd reach out here.
>
> Thanks!
>
> - Jonathan
> ____________________________________________
> "Before Turing, things were done to numbers.
> After Turing, numbers began doing things"
> - George Dyson



ifeq is gmake centric.
make(1) will show you all available statements.

gmake !=3D make

~Paul

--=20
__________________

:(){ :|:& };:

--000000000000399a8f0610c27209
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div dir=3D"ltr"><br></div><br><div class=3D"gmail_qu=
ote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Feb 6, 2024 at 10:21=E2=
=80=AFPM Jonathan Adams &lt;<a href=3D"mailto:jfadams1963@proton.me">jfadam=
s1963@proton.me</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">Hi all,<br>
=C2=A0 I&#39;m having a heck of a time getting my makefile conditional stat=
ements to not cause `make` to have fits. Could sure use some help on this. =
This is a makefile that works great _without_ the conditions, and my progra=
m compiles and runs on FBSD and Linux.<br>
=C2=A0 I&#39;ve just added a function who&#39;s header file is in a differe=
nt location on Linux, so I&#39;m needing detect the OS and set the correct =
preprocessor directives. I get the same errors without the line continuatio=
n backslashes. (More errors actually; one for lines 7, 9, 10, and 11 each) =
I&#39;m using tabs for indent, and have checked for extraneous/misplaced sp=
aces too.<br>
<br>
Here is the start of the makefile including the troublesome bits:<br>
<br>
=C2=A0 =C2=A01=C2=A0 =C2=A0=E2=94=82 CC=C2=A0 =C2=A0 =C2=A0 =3D cc<br>
=C2=A0 =C2=A02=C2=A0 =C2=A0=E2=94=82 CFLAGS=C2=A0 =3D -g -w -Wall -Wextra<b=
r>
=C2=A0 =C2=A03=C2=A0 =C2=A0=E2=94=82 LDFLAGS =3D -Wl,--allow-multiple-defin=
ition -lssl -lcrypto <br>
<br>
=C2=A0 =C2=A04=C2=A0 =C2=A0=E2=94=82 RM=C2=A0 =C2=A0 =C2=A0 =3D rm -f<br>
=C2=A0 =C2=A05=C2=A0 =C2=A0=E2=94=82 UNAME=C2=A0 :=3D $(shell uname)<br>
=C2=A0 =C2=A06=C2=A0 =C2=A0=E2=94=82 <br>
<br>
=C2=A0 =C2=A07=C2=A0 =C2=A0=E2=94=82 ifeq ($(UNAME),FreeBSD) \<br>
=C2=A0 =C2=A08=C2=A0 =C2=A0=E2=94=82=C2=A0 =C2=A0 =C2=A0CFLAGS +=3D -D BSD =
\<br>
=C2=A0 =C2=A09=C2=A0 =C2=A0=E2=94=82 else ifeq ($(UNAME),Linux) \<br>
=C2=A0 10=C2=A0 =C2=A0=E2=94=82=C2=A0 =C2=A0 =C2=A0CFLAGS +=3D -D LINUX \<b=
r>
=C2=A0 11=C2=A0 =C2=A0=E2=94=82 endif<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;snip&gt;<br>
<br>
And here are the errors from `make`:<br>
~/portable/src$ make<br>
make: &quot;/home/jfa/portable/src/makefile&quot; line 7: Invalid line type=
<br>
make: Fatal errors encountered -- cannot continue<br>
make: stopped in /home/jfa/portable/src<br>
<br>
=C2=A0 I&#39;m working on 14.0-RELEASE-p4. I&#39;ve found plenty of advice =
on Stackoverflow, but nothing that solves the issue. Duckduckgo-ing produce=
s more of the same, so I thought I&#39;d reach out here.<br>
<br>
Thanks!<br>
<br>
-=C2=A0Jonathan<br>
____________________________________________<br>
&quot;Before Turing, things were done to numbers.<br>
After Turing, numbers began doing things&quot;<br>
- George Dyson</blockquote></div><br clear=3D"all"></div><br><div>ifeq is g=
make centric.</div><div>make(1) will show you all available statements.<br>=
<br></div><div>gmake !=3D make<br><br></div><div>~Paul<br></div><br><div><s=
pan class=3D"gmail_signature_prefix">-- </span><br><div dir=3D"ltr" class=
=3D"gmail_signature">__________________<br><br>:(){ :|:&amp; };:</div></div=
></div>

--000000000000399a8f0610c27209--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFbbPuiOcg6vt6Xy=1mUOq7K19%2B1S87o=29B8s52Xxi1D=5cMA>