From nobody Wed Feb 7 03:40:17 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TV5Tc3f8jz58cwy for ; Wed, 7 Feb 2024 03:39:48 +0000 (UTC) (envelope-from pprocacci@gmail.com) Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TV5Tc1mxnz4NhT for ; Wed, 7 Feb 2024 03:39:48 +0000 (UTC) (envelope-from pprocacci@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2cf4a22e10dso2110791fa.3 for ; Tue, 06 Feb 2024 19:39:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707277187; x=1707881987; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9/gWRPO9o/n8qI+y/Pvf5Vb9HWOREX8kQo4I0HY5cmU=; b=R/4qBVVd+avOiAfh8tf++fkL/T5fO/ftKGQe0gaIlt9sX81ySsPqyR7UdV0oPfEUjL A1aqnLlunJqn3B5SvnQ+FVn0t62jMg2eU1RfVRTI2TwOrlg5vaLWk3gAJVXspTt1oxVt UwhamWnb3A00tDW7n+cSTwVKtgIVQQEu/W2HpMpguirThyhD0IH3BAv6QAuXyf8Xkm2e OeWrktgGuHJSF8w0F3o4qcjmyCyPUgZW2dc5njyQeRPUME/PRqGvegb6mICPhUBWX7gy KT9c9Jodkir0e2t9CJoSvf0xRbBDuT3hYZyQ/TRlwvg5SMjTQNbWFMt+PkN9HvjoDVIe lX/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707277187; x=1707881987; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9/gWRPO9o/n8qI+y/Pvf5Vb9HWOREX8kQo4I0HY5cmU=; b=LsgVem1Zxia5ygYD60UCdSdiaY8uejKLta0EOMrn/OcU3mla5BkUqV1DnH904eNIQX k8F54QvcS8o3CR3W5xM5p0oNYv09if54c99KHjnMzB57yYQ43VNmsd1oqjk7qDl/Nke7 DHuomX3fAuG+eocrm6Lr6GRDF1rVrqoCgb3U255oMy+oDlHg5g7YdPgQieur9e584M73 GIrn8AjWjU4rIQJDfL8dvxILoZo95Ju59XfVp9twwlJh7QOm7ngQgnJUjw7/LsDzH/zG GTHHb7NLU94WIUwTi73kpRsxae1UWXq900CR6+Z5RlgAONf6Eb4AidKTW0OM1N5b92Sq K3vw== X-Gm-Message-State: AOJu0YyD2MlVbVPvdinQ3tW5kpdEWJR8MUUvVvsE4QBX4AQtoiAD0QoE 8G21hBik7wT0B8zLp+p6d6pQhxmpmmQpGNBIZmb6tWlGxz87Resue8PaNI9Rkky+VrJ4PHM2OhD /CiSC70sMsY6Lo3e0tNSv7Rny16rsyGEn7Q== X-Google-Smtp-Source: AGHT+IFmyYW8RAIfArPXsvw7vUmff6hP45oBiCdZYOKeDAl+Bul20XjpyXHQegZUhabqfsE13ot9WliGieDMH0+c9sQ= X-Received: by 2002:a2e:a788:0:b0:2d0:bdfa:fcfc with SMTP id c8-20020a2ea788000000b002d0bdfafcfcmr3708516ljf.8.1707277186340; Tue, 06 Feb 2024 19:39:46 -0800 (PST) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Paul Procacci Date: Tue, 6 Feb 2024 22:40:17 -0500 Message-ID: Subject: Re: Need help with a makefile To: Jonathan Adams Cc: freebsd-questions@freebsd.org Content-Type: multipart/alternative; boundary="000000000000399a8f0610c27209" X-Rspamd-Queue-Id: 4TV5Tc1mxnz4NhT X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --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 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 > > > 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


On Tue, Feb 6, 2024 at 10:21=E2= =80=AFPM Jonathan Adams <jfadam= s1963@proton.me> wrote:
Hi all,
=C2=A0 I'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.
=C2=A0 I've just added a function who's header file is in a differe= nt location on Linux, so I'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'm using tabs for indent, and have checked for extraneous/misplaced sp= aces too.

Here is the start of the makefile including the troublesome bits:

=C2=A0 =C2=A01=C2=A0 =C2=A0=E2=94=82 CC=C2=A0 =C2=A0 =C2=A0 =3D cc
=C2=A0 =C2=A02=C2=A0 =C2=A0=E2=94=82 CFLAGS=C2=A0 =3D -g -w -Wall -Wextra =C2=A0 =C2=A03=C2=A0 =C2=A0=E2=94=82 LDFLAGS =3D -Wl,--allow-multiple-defin= ition -lssl -lcrypto

=C2=A0 =C2=A04=C2=A0 =C2=A0=E2=94=82 RM=C2=A0 =C2=A0 =C2=A0 =3D rm -f
=C2=A0 =C2=A05=C2=A0 =C2=A0=E2=94=82 UNAME=C2=A0 :=3D $(shell uname)
=C2=A0 =C2=A06=C2=A0 =C2=A0=E2=94=82

=C2=A0 =C2=A07=C2=A0 =C2=A0=E2=94=82 ifeq ($(UNAME),FreeBSD) \
=C2=A0 =C2=A08=C2=A0 =C2=A0=E2=94=82=C2=A0 =C2=A0 =C2=A0CFLAGS +=3D -D BSD = \
=C2=A0 =C2=A09=C2=A0 =C2=A0=E2=94=82 else ifeq ($(UNAME),Linux) \
=C2=A0 10=C2=A0 =C2=A0=E2=94=82=C2=A0 =C2=A0 =C2=A0CFLAGS +=3D -D LINUX \ =C2=A0 11=C2=A0 =C2=A0=E2=94=82 endif
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <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

=C2=A0 I'm working on 14.0-RELEASE-p4. I'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'd reach out here.

Thanks!

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


ifeq is g= make centric.
make(1) will show you all available statements.
=
gmake !=3D make

~Paul

--
__________________

:(){ :|:& };:
--000000000000399a8f0610c27209--