Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Feb 2024 03:21:00 +0000
From:      Jonathan Adams <jfadams1963@proton.me>
To:        freebsd-questions@freebsd.org
Subject:   Need help with a makefile
Message-ID:  <YIWJldQ_ZQqkZd0CmowerZK1sxpNyYgR0XwSaV_OHShYoU7Yonr8_9zgplV0ogOJhJRKPM8tqvubiCCo2rom5L07lXG_sKh62PViYmsxd8M=@proton.me>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------ddc9ae43d3b402d64dc8c11a57357ef91cec221434904d6accd055036060e913
Content-Type: multipart/mixed;boundary=---------------------3d34fa24a71fb91606c6424199280f3f

-----------------------3d34fa24a71fb91606c6424199280f3f
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;charset=utf-8

Hi all,
  I'm having a heck of a time getting my makefile conditional statements t=
o 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 comp=
iles 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 di=
rectives. 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 tab=
s for indent, and have checked for extraneous/misplaced spaces 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 -lcrypt=
o =


   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 Stackover=
flow, but nothing that solves the issue. Duckduckgo-ing produces more of t=
he same, so I thought I'd reach out here.

Thanks!

-=C2=A0Jonathan
____________________________________________
"Before Turing, things were done to numbers.
After Turing, numbers began doing things"
- George Dyson
-----------------------3d34fa24a71fb91606c6424199280f3f--

--------ddc9ae43d3b402d64dc8c11a57357ef91cec221434904d6accd055036060e913
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: ProtonMail

wnUEARYKACcFgmXC9wIJkI6O/sbt8r3IFiEEcBGzOO9wDbcpT/10jo7+xu3y
vcgAAB5hAP9+PP4TIvlHO9ZgQSodvSnwJS181T/oUWY4rrWs17WzWwD/en72
lqcdCRlhgv8vv3pcdjdPt8mAaw/sRSTgj7RI1wU=
=bmvX
-----END PGP SIGNATURE-----


--------ddc9ae43d3b402d64dc8c11a57357ef91cec221434904d6accd055036060e913--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YIWJldQ_ZQqkZd0CmowerZK1sxpNyYgR0XwSaV_OHShYoU7Yonr8_9zgplV0ogOJhJRKPM8tqvubiCCo2rom5L07lXG_sKh62PViYmsxd8M=>