Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The computing field is always in need of new cliches. -- Alan Perlis


devel / comp.lang.c / Re: C and Make

SubjectAuthor
* C and Makebart
+* Re: C and MakeKaz Kylheku
|`* Re: C and MakeBlue-Maned_Hawk
| `* Re: C and MakeBGB
|  `* Re: C and MakeLawrence D'Oliveiro
|   `* Re: C and MakeBGB
|    `* Re: C and MakeAndreas Kempe
|     +- Re: C and MakeAndreas Kempe
|     `* Re: C and MakeDavid Brown
|      +* Re: C and MakeAndreas Kempe
|      |`- Re: C and MakeDavid Brown
|      +* Re: C and MakeKaz Kylheku
|      |+- Re: C and MakeDavid Brown
|      |+* Re: C and MakeKeith Thompson
|      ||`* Re: C and MakeKaz Kylheku
|      || `- Re: C and MakeKeith Thompson
|      |`- Re: C and MakeLawrence D'Oliveiro
|      `- Re: C and Makebart
+* Re: C and MakeLawrence D'Oliveiro
|`* Re: C and Makebart
| `* Re: C and MakeScott Lurndal
|  `* Re: C and MakeBGB
|   +* Re: C and MakeScott Lurndal
|   |`* Re: C and MakeBGB
|   | `* Re: C and MakeChris M. Thomasson
|   |  +- Re: C and MakeChris M. Thomasson
|   |  `- Re: C and MakeBGB
|   `* Re: C and MakeDavid Brown
|    `- Re: C and MakeBGB
`* Re: C and Makevallor
 `* Re: C and Makebart
  `* Re: C and MakeScott Lurndal
   +* Re: C and MakeLew Pitcher
   |`* Re: C and MakeKeith Thompson
   | `* Re: C and MakeLew Pitcher
   |  `* Re: C and MakeKeith Thompson
   |   +- Re: C and MakeLew Pitcher
   |   +* Re: C and MakeScott Lurndal
   |   |`- Re: C and MakeGary R. Schmidt
   |   `- Re: C and MakeLawrence D'Oliveiro
   `* Re: C and MakeLawrence D'Oliveiro
    `* Re: C and MakeScott Lurndal
     `* Re: C and MakeLawrence D'Oliveiro
      +* Re: C and MakeScott Lurndal
      |`* Re: C and MakeLawrence D'Oliveiro
      | `* Re: C and MakeScott Lurndal
      |  `* Re: C and MakeLawrence D'Oliveiro
      |   `* Re: C and MakeScott Lurndal
      |    `- Re: C and MakeKeith Thompson
      `* Re: C and MakeLew Pitcher
       `- Re: C and MakeLew Pitcher

Pages:123
Re: C and Make

<yjBpN.26872$SyNd.3740@fx33.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31032&group=comp.lang.c#31032

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx33.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: C and Make
Newsgroups: comp.lang.c,comp.unix.programmer
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me> <uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad> <uo6bv7$1g4ih$1@dont-email.me> <87ply1drya.fsf@nosuchdomain.example.com> <uo6knh$1g4ih$2@dont-email.me> <87le8pdquv.fsf@nosuchdomain.example.com>
Lines: 34
Message-ID: <yjBpN.26872$SyNd.3740@fx33.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 16 Jan 2024 20:04:46 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 16 Jan 2024 20:04:46 GMT
X-Received-Bytes: 1865
 by: Scott Lurndal - Tue, 16 Jan 2024 20:04 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>> On Tue, 16 Jan 2024 11:00:13 -0800, Keith Thompson wrote:
>>> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>>> [...]
>>>> Or, if you want to specify the section (given that some
>>>> sections have man pages with names that you might find
>>>> in other sections):
>>>>
>>>> man section manpage
>>>>
>>>> as in
>>>> man 1 mktemp
>>>> which describes the program "mktemp", vs
>>>> man 3 mktemp
>>>> which describes the library function "mktemp()"
>>>
>>> You can also type
>>> man mktemp.1
>>> or
>>> man mktemp.3
>>
>> That only works if there's a file called "mktemp.1"
>> (or "mktemp.3") in your local directory, at least
>> for the version of man(1) that I have available.
>
>Interesting.
>
>I have man 2.20.1 on Ubuntu, provided by the "man-db" package.

It doesn't work that way on my ancient Fedora 20 install (mandb-2.6.5-6)

It does work that way on my Ubuntu 18 install (man-db-2.8.3)

Re: C and Make

<uo709b$1ksuv$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31041&group=comp.lang.c#31041

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: C and Make
Date: Tue, 16 Jan 2024 22:34:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <uo709b$1ksuv$2@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me>
<uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 16 Jan 2024 22:34:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ca75c4ad8a1ef3af6a8bb895abab775c";
logging-data="1733599"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196hM0YMJMxRQIGalMopYGg"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:S3bwocOh+IC5KQpzL9Lvi+s2ISc=
 by: Lawrence D'Oliv - Tue, 16 Jan 2024 22:34 UTC

On Tue, 16 Jan 2024 16:13:36 GMT, Scott Lurndal wrote:

> @$(QUIET) || echo " BUILDPDF $@" $(HUSHCOMPILE)groff -t -man $< | ps2pdf - > $@

Why, can’t your groff installation generate PDF directly?

Re: C and Make

<uo70e7$1ksuv$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31042&group=comp.lang.c#31042

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: C and Make
Date: Tue, 16 Jan 2024 22:36:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <uo70e7$1ksuv$3@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me>
<uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad>
<uo6bv7$1g4ih$1@dont-email.me> <87ply1drya.fsf@nosuchdomain.example.com>
<uo6knh$1g4ih$2@dont-email.me> <87le8pdquv.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 16 Jan 2024 22:36:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ca75c4ad8a1ef3af6a8bb895abab775c";
logging-data="1733599"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18EKD7rIRAyyTShBOwy4YQY"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:Uqs65bhcft4DLoD31Am9KD/TTWY=
 by: Lawrence D'Oliv - Tue, 16 Jan 2024 22:36 UTC

On Tue, 16 Jan 2024 11:23:52 -0800, Keith Thompson wrote:

> I have man 2.20.1 on Ubuntu, provided by the "man-db" package.
> "man mktemp.1" will look up the corresponding man page in $MANPATH.

It also works if the file is mktemp.1.gz.

> If I want to use a local file, I can use an absolute or relative path
> with a '/' in it, such as "man ./mktemp.1".

Yup. Or the “-l” option.

Re: C and Make

<%PDpN.125107$yEgf.91020@fx09.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31044&group=comp.lang.c#31044

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: C and Make
Newsgroups: comp.lang.c,comp.unix.programmer
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me> <uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad> <uo709b$1ksuv$2@dont-email.me>
Lines: 8
Message-ID: <%PDpN.125107$yEgf.91020@fx09.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 16 Jan 2024 22:55:55 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 16 Jan 2024 22:55:55 GMT
X-Received-Bytes: 1021
 by: Scott Lurndal - Tue, 16 Jan 2024 22:55 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On Tue, 16 Jan 2024 16:13:36 GMT, Scott Lurndal wrote:
>
>> @$(QUIET) || echo " BUILDPDF $@" $(HUSHCOMPILE)groff -t -man $< | ps2pdf - > $@
>
>Why, can’t your groff installation generate PDF directly?

It couldn't when I first wrote this rule a couple of decades ago.

Re: C and Make

<uo73na$2von$2@nyheter.lysator.liu.se>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31045&group=comp.lang.c#31045

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!nyheter.lysator.liu.se!.POSTED!not-for-mail
From: kem...@lysator.liu.se (Andreas Kempe)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Tue, 16 Jan 2024 23:32:58 -0000 (UTC)
Organization: Lysator ACS
Message-ID: <uo73na$2von$2@nyheter.lysator.liu.se>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me>
Injection-Date: Tue, 16 Jan 2024 23:32:58 -0000 (UTC)
Injection-Info: nyheter.lysator.liu.se; posting-account="kempe";
logging-data="98071"; mail-complaints-to="newsmaster@lysator.liu.se"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Andreas Kempe - Tue, 16 Jan 2024 23:32 UTC

Den 2024-01-16 skrev BGB <cr88192@gmail.com>:
> Things like CMake and Ninja seemed to work effectively in the past from
> what little I had used them...
>

As a long time user of CMake, I think it works very well and I use it
for most of my projects, even if they're small. The most simple for I
use is usually

cmake_minimum_required(VERSION $my_installed_version)
project($project_name)

add_executable($output_binay $source_files)

Replace the $-variables with actual values. I like it even for simple
things because it gives me make, make install and make clean or ninja
equivalents with three lines.

That said, CMake is extremely flexible so it's very easy to write
shitty CMake that's very fragile and complex. I know some projects
have replaced CMake with Meson for that reason.

Re: C and Make

<uo73ro$2von$3@nyheter.lysator.liu.se>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31046&group=comp.lang.c#31046

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!nyheter.lysator.liu.se!.POSTED!not-for-mail
From: kem...@lysator.liu.se (Andreas Kempe)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Tue, 16 Jan 2024 23:35:20 -0000 (UTC)
Organization: Lysator ACS
Message-ID: <uo73ro$2von$3@nyheter.lysator.liu.se>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
Injection-Date: Tue, 16 Jan 2024 23:35:20 -0000 (UTC)
Injection-Info: nyheter.lysator.liu.se; posting-account="kempe";
logging-data="98071"; mail-complaints-to="newsmaster@lysator.liu.se"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Andreas Kempe - Tue, 16 Jan 2024 23:35 UTC

Den 2024-01-16 skrev Andreas Kempe <kempe@lysator.liu.se>:
> Den 2024-01-16 skrev BGB <cr88192@gmail.com>:
>> Things like CMake and Ninja seemed to work effectively in the past from
>> what little I had used them...
>>
>
> As a long time user of CMake, I think it works very well and I use it
> for most of my projects, even if they're small. The most simple for I
> use is usually
>
> cmake_minimum_required(VERSION $my_installed_version)
> project($project_name)
>
> add_executable($output_binay $source_files)
>
> Replace the $-variables with actual values. I like it even for simple
> things because it gives me make, make install and make clean or ninja
> equivalents with three lines.

A small correction. To get make install support a fourth line is
needed

install(TARGETS $output_binary)

>
> That said, CMake is extremely flexible so it's very easy to write
> shitty CMake that's very fragile and complex. I know some projects
> have replaced CMake with Meson for that reason.

Re: C and Make

<uo7802$1m0or$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31050&group=comp.lang.c#31050

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 00:45:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <uo7802$1m0or$1@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me>
<uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad>
<uo709b$1ksuv$2@dont-email.me> <%PDpN.125107$yEgf.91020@fx09.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 Jan 2024 00:45:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="71e924a53864396a82a319f1f0d5bb71";
logging-data="1770267"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181TWKvQ9k0rqP1vng6xXeN"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:XuNRuSsDSBSJIZAtLcwMq9iDvHQ=
 by: Lawrence D'Oliv - Wed, 17 Jan 2024 00:45 UTC

On Tue, 16 Jan 2024 22:55:55 GMT, Scott Lurndal wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>>Why, can’t your groff installation generate PDF directly?
>
> It couldn't when I first wrote this rule a couple of decades ago.

Here’s how I get a nicely typeset view of one of my own man pages:

groff -ktman -Tpdf «troff-file» | okular - &

Re: C and Make

<mu2k7k-4ci.ln1@paranoia.mcleod-schmidt.id.au>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31069&group=comp.lang.c#31069

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: grschm...@acm.org (Gary R. Schmidt)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 15:51:01 +1100
Lines: 57
Message-ID: <mu2k7k-4ci.ln1@paranoia.mcleod-schmidt.id.au>
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me>
<uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad>
<uo6bv7$1g4ih$1@dont-email.me> <87ply1drya.fsf@nosuchdomain.example.com>
<uo6knh$1g4ih$2@dont-email.me> <87le8pdquv.fsf@nosuchdomain.example.com>
<yjBpN.26872$SyNd.3740@fx33.iad>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net mOvImCVq5uAQ7dTGTH7hdgRrl6CrzrgAopMBD53kH3fuexd6c=
X-Orig-Path: paranoia.mcleod-schmidt.id.au!not-for-mail
Cancel-Lock: sha1:zmk7MP/AKWEGFssz75nM8qiI9Ws= sha256:pI0bNYa53Wxw5Ad8BzT60ocs6Sksop9iIKNkXGlvRTM=
User-Agent: Betterbird (Windows)
Content-Language: en-AU
In-Reply-To: <yjBpN.26872$SyNd.3740@fx33.iad>
X-Clacks-Overhead: GNU Terry Pratchett
 by: Gary R. Schmidt - Wed, 17 Jan 2024 04:51 UTC

On 17/01/2024 07:04, Scott Lurndal wrote:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>>> On Tue, 16 Jan 2024 11:00:13 -0800, Keith Thompson wrote:
>>>> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>>>> [...]
>>>>> Or, if you want to specify the section (given that some
>>>>> sections have man pages with names that you might find
>>>>> in other sections):
>>>>>
>>>>> man section manpage
>>>>>
>>>>> as in
>>>>> man 1 mktemp
>>>>> which describes the program "mktemp", vs
>>>>> man 3 mktemp
>>>>> which describes the library function "mktemp()"
>>>>
>>>> You can also type
>>>> man mktemp.1
>>>> or
>>>> man mktemp.3
>>>
>>> That only works if there's a file called "mktemp.1"
>>> (or "mktemp.3") in your local directory, at least
>>> for the version of man(1) that I have available.
>>
>> Interesting.
>>
>> I have man 2.20.1 on Ubuntu, provided by the "man-db" package.
>
> It doesn't work that way on my ancient Fedora 20 install (mandb-2.6.5-6)
>
> It does work that way on my Ubuntu 18 install (man-db-2.8.3)
>
Hmm, Solaris 11.4, the first few lines of "man man":

NAME
man - find and display reference manual pages

SYNOPSIS
man [-] [-adFlrt] [-M path] [-T macro-package] [-s section] name...

man [-M path] [-s section] -k query...

man [-M path] -f file...

man [-M path] [-s section] -K query...

Still very SysV, but it does use groff now. :-)

For those who want to see the full version:
<https://docs.oracle.com/cd/E88353_01/html/E37839/man-1.html>

Cheers,
Gary B-)

Re: C and Make

<uo8asp$1v1eq$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31080&group=comp.lang.c#31080

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 11:41:29 +0100
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <uo8asp$1v1eq$3@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 17 Jan 2024 10:41:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e5d003c4907c1c313df779ab33f575b8";
logging-data="2065882"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++Gm4B56UNj9fOIMNQNENaoqZXHAqTkyY="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:dfKZXY7nTrOUDdad9v5HtG9GwzA=
Content-Language: en-GB
In-Reply-To: <uo73na$2von$2@nyheter.lysator.liu.se>
 by: David Brown - Wed, 17 Jan 2024 10:41 UTC

On 17/01/2024 00:32, Andreas Kempe wrote:
> Den 2024-01-16 skrev BGB <cr88192@gmail.com>:
>> Things like CMake and Ninja seemed to work effectively in the past from
>> what little I had used them...
>>
>
> As a long time user of CMake, I think it works very well and I use it
> for most of my projects, even if they're small. The most simple for I
> use is usually
>
> cmake_minimum_required(VERSION $my_installed_version)
> project($project_name)
>
> add_executable($output_binay $source_files)
>
> Replace the $-variables with actual values. I like it even for simple
> things because it gives me make, make install and make clean or ninja
> equivalents with three lines.
>
> That said, CMake is extremely flexible so it's very easy to write
> shitty CMake that's very fragile and complex. I know some projects
> have replaced CMake with Meson for that reason.

I have no experience with CMake as yet, but will no doubt be required to
use it in the future - so I have a quick question for you.

In my makefiles for any non-trivial project, I find the source files by
wildcard searches, recursively through sub-directories. Basically, if a
..c or .cpp file exists somewhere in the project tree, it is part of the
project build. Can CMake do this with reasonable convenience, or would
I have to make a extra step with an external script?

Re: C and Make

<uo8gp2$ail$1@nyheter.lysator.liu.se>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31087&group=comp.lang.c#31087

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!news.neodome.net!news.samoylyk.net!nyheter.lysator.liu.se!.POSTED!not-for-mail
From: kem...@lysator.liu.se (Andreas Kempe)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 12:21:54 -0000 (UTC)
Organization: Lysator ACS
Message-ID: <uo8gp2$ail$1@nyheter.lysator.liu.se>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
<uo8asp$1v1eq$3@dont-email.me>
Injection-Date: Wed, 17 Jan 2024 12:21:54 -0000 (UTC)
Injection-Info: nyheter.lysator.liu.se; posting-account="kempe";
logging-data="10837"; mail-complaints-to="newsmaster@lysator.liu.se"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Andreas Kempe - Wed, 17 Jan 2024 12:21 UTC

Den 2024-01-17 skrev David Brown <david.brown@hesbynett.no>:
> On 17/01/2024 00:32, Andreas Kempe wrote:
>> Den 2024-01-16 skrev BGB <cr88192@gmail.com>:
>>> Things like CMake and Ninja seemed to work effectively in the past from
>>> what little I had used them...
>>>
>>
>> As a long time user of CMake, I think it works very well and I use it
>> for most of my projects, even if they're small. The most simple for I
>> use is usually
>>
>> cmake_minimum_required(VERSION $my_installed_version)
>> project($project_name)
>>
>> add_executable($output_binay $source_files)
>>
>> Replace the $-variables with actual values. I like it even for simple
>> things because it gives me make, make install and make clean or ninja
>> equivalents with three lines.
>>
>> That said, CMake is extremely flexible so it's very easy to write
>> shitty CMake that's very fragile and complex. I know some projects
>> have replaced CMake with Meson for that reason.
>
> I have no experience with CMake as yet, but will no doubt be required to
> use it in the future - so I have a quick question for you.
>
> In my makefiles for any non-trivial project, I find the source files by
> wildcard searches, recursively through sub-directories. Basically, if a
> .c or .cpp file exists somewhere in the project tree, it is part of the
> project build. Can CMake do this with reasonable convenience, or would
> I have to make a extra step with an external script?
>

CMake has support for it via globbing. You can for example do

file(GLOB_RECURSE SRCS "src/*.c")
add_executable(my_program ${SRCS})

file() searches recursively for all files ending in .c in the src
directory and puts them into the SRCS variable.

If you do this, I would suggest making sure to search from a
subdirectory in the top level CMake file, i.e. "subdir/*.c" instead of
"*.c", since if someone performs the build in a directory at the top
level, usually something like

cd my_project
mkdir build
cd build
cmake ..
make

it will cause CMake to recurse into the build directory and find
generated compiler test files.

Re: C and Make

<uo8jca$20hg6$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31090&group=comp.lang.c#31090

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!news.in-chemnitz.de!news2.arglkargh.de!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 14:06:18 +0100
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <uo8jca$20hg6$1@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
<uo8asp$1v1eq$3@dont-email.me> <uo8gp2$ail$1@nyheter.lysator.liu.se>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 17 Jan 2024 13:06:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e5d003c4907c1c313df779ab33f575b8";
logging-data="2115078"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jxAQAb8FFMV3FEiH+nAbOULs/4BtNndU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:ppdjN56iV40MTKUjZq0gaIxwtIY=
Content-Language: en-GB
In-Reply-To: <uo8gp2$ail$1@nyheter.lysator.liu.se>
 by: David Brown - Wed, 17 Jan 2024 13:06 UTC

On 17/01/2024 13:21, Andreas Kempe wrote:
> Den 2024-01-17 skrev David Brown <david.brown@hesbynett.no>:
>> On 17/01/2024 00:32, Andreas Kempe wrote:
>>> Den 2024-01-16 skrev BGB <cr88192@gmail.com>:
>>>> Things like CMake and Ninja seemed to work effectively in the past from
>>>> what little I had used them...
>>>>
>>>
>>> As a long time user of CMake, I think it works very well and I use it
>>> for most of my projects, even if they're small. The most simple for I
>>> use is usually
>>>
>>> cmake_minimum_required(VERSION $my_installed_version)
>>> project($project_name)
>>>
>>> add_executable($output_binay $source_files)
>>>
>>> Replace the $-variables with actual values. I like it even for simple
>>> things because it gives me make, make install and make clean or ninja
>>> equivalents with three lines.
>>>
>>> That said, CMake is extremely flexible so it's very easy to write
>>> shitty CMake that's very fragile and complex. I know some projects
>>> have replaced CMake with Meson for that reason.
>>
>> I have no experience with CMake as yet, but will no doubt be required to
>> use it in the future - so I have a quick question for you.
>>
>> In my makefiles for any non-trivial project, I find the source files by
>> wildcard searches, recursively through sub-directories. Basically, if a
>> .c or .cpp file exists somewhere in the project tree, it is part of the
>> project build. Can CMake do this with reasonable convenience, or would
>> I have to make a extra step with an external script?
>>
>
> CMake has support for it via globbing. You can for example do
>
> file(GLOB_RECURSE SRCS "src/*.c")
> add_executable(my_program ${SRCS})
>
> file() searches recursively for all files ending in .c in the src
> directory and puts them into the SRCS variable.
>
> If you do this, I would suggest making sure to search from a
> subdirectory in the top level CMake file, i.e. "subdir/*.c" instead of
> "*.c", since if someone performs the build in a directory at the top
> level, usually something like
>
> cd my_project
> mkdir build
> cd build
> cmake ..
> make
>
> it will cause CMake to recurse into the build directory and find
> generated compiler test files.

Thanks for that information - it looks like it will be convenient for
me. (And I do generally have various subdirectories - "src" for source
separate from "build" for builds, "docs", etc., according to the needs
of the project.)

Re: C and Make

<xTSpN.168165$vFZa.18232@fx13.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31100&group=comp.lang.c#31100

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx13.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: C and Make
Newsgroups: comp.lang.c,comp.unix.programmer
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me> <uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad> <uo709b$1ksuv$2@dont-email.me> <%PDpN.125107$yEgf.91020@fx09.iad> <uo7802$1m0or$1@dont-email.me>
Lines: 15
Message-ID: <xTSpN.168165$vFZa.18232@fx13.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 17 Jan 2024 16:03:41 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 17 Jan 2024 16:03:41 GMT
X-Received-Bytes: 1235
 by: Scott Lurndal - Wed, 17 Jan 2024 16:03 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On Tue, 16 Jan 2024 22:55:55 GMT, Scott Lurndal wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>>Why, can’t your groff installation generate PDF directly?
>>
>> It couldn't when I first wrote this rule a couple of decades ago.
>
>Here’s how I get a nicely typeset view of one of my own man pages:
>
> groff -ktman -Tpdf «troff-file» | okular - &

$ type okular
-ksh: whence: okular: not found

Re: C and Make

<uo8u0q$2156m$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31101&group=comp.lang.c#31101

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 16:07:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <uo8u0q$2156m$1@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me>
<uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad>
<uo709b$1ksuv$2@dont-email.me> <%PDpN.125107$yEgf.91020@fx09.iad>
<uo7802$1m0or$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 Jan 2024 16:07:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="97ff3109ae3dc249d961201b6c1680c8";
logging-data="2135254"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bApkUwf2CYs5XOVxrxnCrbJLIaT3Zkz4="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:wrmK0BkkSWvu4K9CQGHucmgtA10=
 by: Lew Pitcher - Wed, 17 Jan 2024 16:07 UTC

On Wed, 17 Jan 2024 00:45:54 +0000, Lawrence D'Oliveiro wrote:

> On Tue, 16 Jan 2024 22:55:55 GMT, Scott Lurndal wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>>Why, can’t your groff installation generate PDF directly?
>>
>> It couldn't when I first wrote this rule a couple of decades ago.
>
> Here’s how I get a nicely typeset view of one of my own man pages:
>
> groff -ktman -Tpdf «troff-file» | okular - &

man -t 3 mktemp >mktemp.ps

--
Lew Pitcher
"In Skills We Trust"

Re: C and Make

<uo8u2j$2156m$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31102&group=comp.lang.c#31102

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 16:08:51 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <uo8u2j$2156m$2@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me>
<uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad>
<uo709b$1ksuv$2@dont-email.me> <%PDpN.125107$yEgf.91020@fx09.iad>
<uo7802$1m0or$1@dont-email.me> <uo8u0q$2156m$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 Jan 2024 16:08:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="97ff3109ae3dc249d961201b6c1680c8";
logging-data="2135254"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NoRtOLdTNNbOfUqO/lDV3IzijzCFYDAs="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:IiV+XSOLvP6vExVFHf2+0gdJg1s=
 by: Lew Pitcher - Wed, 17 Jan 2024 16:08 UTC

On Wed, 17 Jan 2024 16:07:54 +0000, Lew Pitcher wrote:

> On Wed, 17 Jan 2024 00:45:54 +0000, Lawrence D'Oliveiro wrote:
>
>> On Tue, 16 Jan 2024 22:55:55 GMT, Scott Lurndal wrote:
>>
>>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>>
>>>>Why, can’t your groff installation generate PDF directly?
>>>
>>> It couldn't when I first wrote this rule a couple of decades ago.
>>
>> Here’s how I get a nicely typeset view of one of my own man pages:
>>
>> groff -ktman -Tpdf «troff-file» | okular - &
>
>
> man -t 3 mktemp >mktemp.ps

But you wanted a PDF, so
man -t 3 mktemp | ps2pdf - mktemp.pdf

--
Lew Pitcher
"In Skills We Trust"

Re: C and Make

<20240117095809.591@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31113&group=comp.lang.c#31113

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 18:11:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <20240117095809.591@kylheku.com>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
<uo8asp$1v1eq$3@dont-email.me>
Injection-Date: Wed, 17 Jan 2024 18:11:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="30353e714807d76ba68823a6307c7dd8";
logging-data="2266211"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194gh2pjJBiDYXcEhkrvuhnYW6OIQj10SU="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:hd1U8dvolqF0eMDC3h+1Ts2EUqA=
 by: Kaz Kylheku - Wed, 17 Jan 2024 18:11 UTC

On 2024-01-17, David Brown <david.brown@hesbynett.no> wrote:
> In my makefiles for any non-trivial project, I find the source files by
> wildcard searches, recursively through sub-directories. Basically, if a
> .c or .cpp file exists somewhere in the project tree, it is part of the
> project build. Can CMake do this with reasonable convenience, or would
> I have to make a extra step with an external script?

By the way, a useful idea, if you go that route, is to do that is with
git wildcard searches, like:

C_SRCS := $(shell git ls-files 'src/**/*.c')

so you are not picking up untracked local files into the build.
This means that a new file has to be git-added to be pulled in.

Of course, the practice assumes your project will be inseparable from
its git repository going forward. (Not unheard of nowadays, but
obviously a nonstarter for people who distribute tarball snapshots of
source.)

It's really better to assiduously list the files explicitly in the
Makefile. It's not like a daily chore, and can be done with the help
of wildcard searches for the initial population.

If I wanted wildcard-based population of OBJS, I'd put that into a
separate included makefile (that is checked into version control) and
have a "make objs" step.

When a new file is added, the developer has to run "make objs" to
reevaluate the wildcard search which will regenerate the "objs.mk" file.

If any stray files are pulled into "objs.mk" that shouldn't be,
that will be readily apparent in the diff. The file can list them
on separate lines like this, for easy diffing.

OBJS := \
src/parser.o \
src/lexer.o \
src/shouldnotbehere.o \
lib/buffer.o \
...

We can easily spot that src/shouldnotbehere.o should not be there
when reviewing the diff.

(Of course, OBJS is populated not by looking for .o files, but by
by looking for suffixes like .c, .cc and .S, which are then converted
to .o; the inference rules figure out the prerequisite source file
for each .o.)

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: C and Make

<uo96le$25cc4$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31115&group=comp.lang.c#31115

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 18:35:26 +0000
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <uo96le$25cc4$1@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
<uo8asp$1v1eq$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 Jan 2024 18:35:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6268282b8239d0a8c360e6001c42a605";
logging-data="2273668"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/TnlJCyLaximslKEsWZu3ODMAi4S0Plok="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:zWVRjqCiTaoylt1O2gHVxDVysJk=
Content-Language: en-GB
In-Reply-To: <uo8asp$1v1eq$3@dont-email.me>
 by: bart - Wed, 17 Jan 2024 18:35 UTC

On 17/01/2024 10:41, David Brown wrote:
> On 17/01/2024 00:32, Andreas Kempe wrote:
>> Den 2024-01-16 skrev BGB <cr88192@gmail.com>:
>>> Things like CMake and Ninja seemed to work effectively in the past from
>>> what little I had used them...
>>>
>>
>> As a long time user of CMake, I think it works very well and I use it
>> for most of my projects, even if they're small. The most simple for I
>> use is usually
>>
>>     cmake_minimum_required(VERSION $my_installed_version)
>>     project($project_name)
>>
>>     add_executable($output_binay $source_files)
>>
>> Replace the $-variables with actual values. I like it even for simple
>> things because it gives me make, make install and make clean or ninja
>> equivalents with three lines.
>>
>> That said, CMake is extremely flexible so it's very easy to write
>> shitty CMake that's very fragile and complex. I know some projects
>> have replaced CMake with Meson for that reason.
>
> I have no experience with CMake as yet, but will no doubt be required to
> use it in the future - so I have a quick question for you.
>
> In my makefiles for any non-trivial project, I find the source files by
> wildcard searches, recursively through sub-directories.  Basically, if a
> .c or .cpp file exists somewhere in the project tree, it is part of the
> project build.  Can CMake do this with reasonable convenience, or would
> I have to make a extra step with an external script?
>

I've recently become a fan of wildcard inputs like "*.c", at least for
programs that process multiple input files.

A compiler like gcc can be invoked using "gcc *.c", and now I can do the
same.

But on Windows, putting wildcards inside an @file then using 'gcc @file'
doesn't work; it will not expand those wildcard specs. (mcc @file will
work.)

I think this was specific to Windows, but I've just seen it fail on WSL too.

Does anyone know why this is?

It means that, where a project can be simply described by a sequence of
such filespecs, for example with this actual example:

*.c freetype/*.c samplerate/*.c

you can't have a lightweight makefile alternate by sticking them into an
@file. You need to enumerate every file, then maintain the file when the
list changes.

Re: C and Make

<uo98ol$25juu$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31123&group=comp.lang.c#31123

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 19:11:18 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <uo98ol$25juu$2@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me>
<uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad>
<uo709b$1ksuv$2@dont-email.me> <%PDpN.125107$yEgf.91020@fx09.iad>
<uo7802$1m0or$1@dont-email.me> <xTSpN.168165$vFZa.18232@fx13.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 Jan 2024 19:11:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="71e924a53864396a82a319f1f0d5bb71";
logging-data="2281438"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IoSg4MKS/ajL3g/dUq5CY"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:QGAVJPPOwbS2j9XGvQk09+F/j2I=
 by: Lawrence D'Oliv - Wed, 17 Jan 2024 19:11 UTC

On Wed, 17 Jan 2024 16:03:41 GMT, Scott Lurndal wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>>Here’s how I get a nicely typeset view of one of my own man pages:
>>
>> groff -ktman -Tpdf «troff-file» | okular - &
>
> $ type okular
> -ksh: whence: okular: not found

ldo@theon:~> apt-cache search okular
okular-backend-odp - Okular backend for ODP documents
okular-backend-odt - Okular backend for ODT documents
libokular5core11 - libraries for the Okular document viewer
okular - universal document viewer
okular-dev - development files for the Okular libraries
okular-extra-backends - additional document format support for Okular
okular-mobile - mobile support for Okular
qml-module-org-kde-okular - mobile support for Okular - QML modules

It helps to try the right command ...

Re: C and Make

<uo9f1i$26ll8$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31129&group=comp.lang.c#31129

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 21:58:26 +0100
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <uo9f1i$26ll8$1@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
<uo8asp$1v1eq$3@dont-email.me> <20240117095809.591@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 17 Jan 2024 20:58:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="58ccad12ca319904d81f1b1b4fe8057b";
logging-data="2315944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+g3Dz+I7BUA5wnyFD25o9NQJ9qk4ezi90="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:5ekWOK4f00RppiTwCCdiSCQVfBU=
In-Reply-To: <20240117095809.591@kylheku.com>
Content-Language: en-GB
 by: David Brown - Wed, 17 Jan 2024 20:58 UTC

On 17/01/2024 19:11, Kaz Kylheku wrote:
> On 2024-01-17, David Brown <david.brown@hesbynett.no> wrote:
>> In my makefiles for any non-trivial project, I find the source files by
>> wildcard searches, recursively through sub-directories. Basically, if a
>> .c or .cpp file exists somewhere in the project tree, it is part of the
>> project build. Can CMake do this with reasonable convenience, or would
>> I have to make a extra step with an external script?
>
> By the way, a useful idea, if you go that route, is to do that is with
> git wildcard searches, like:
>
> C_SRCS := $(shell git ls-files 'src/**/*.c')
>
> so you are not picking up untracked local files into the build.
> This means that a new file has to be git-added to be pulled in.
>

That's certainly a possibility, and could be a useful hint for some
people. But I am strict about all project source files, and nothing but
project source files, being in the src directory.

> Of course, the practice assumes your project will be inseparable from
> its git repository going forward. (Not unheard of nowadays, but
> obviously a nonstarter for people who distribute tarball snapshots of
> source.)
>
> It's really better to assiduously list the files explicitly in the
> Makefile. It's not like a daily chore, and can be done with the help
> of wildcard searches for the initial population.
>

I prefer not to, but I realise that's a matter of preference.

> If I wanted wildcard-based population of OBJS, I'd put that into a
> separate included makefile (that is checked into version control) and
> have a "make objs" step.
>

I make my "objs" from my "srcs" :

objfiles_src := $(cfiles:.c=.o) $(cppfiles:.cpp=.o)
objfiles := $(addprefix $(obj_dir),$(patsubst ../%,%,$(objfiles_src)))

> When a new file is added, the developer has to run "make objs" to
> reevaluate the wildcard search which will regenerate the "objs.mk" file.

It can certainly be done that way. I find the automatic generation is
fast enough that there is little benefit in doing it manually. But it
could be a different matter in a very big project.

>
> If any stray files are pulled into "objs.mk" that shouldn't be,
> that will be readily apparent in the diff. The file can list them
> on separate lines like this, for easy diffing.
>
> OBJS := \
> src/parser.o \
> src/lexer.o \
> src/shouldnotbehere.o \
> lib/buffer.o \
> ...
>
> We can easily spot that src/shouldnotbehere.o should not be there
> when reviewing the diff.
>
> (Of course, OBJS is populated not by looking for .o files, but by
> by looking for suffixes like .c, .cc and .S, which are then converted
> to .o; the inference rules figure out the prerequisite source file
> for each .o.)
>

Yes.

There are many possibilities here.

Re: C and Make

<878r4nekp7.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31131&group=comp.lang.c#31131

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 13:03:48 -0800
Organization: None to speak of
Lines: 31
Message-ID: <878r4nekp7.fsf@nosuchdomain.example.com>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
<uo8asp$1v1eq$3@dont-email.me> <20240117095809.591@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a57fd8d5796d691e205ff7bb2b8ad45e";
logging-data="2316385"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rh/UAEvhHbECL1OZ58CI1"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:M7Il8VHd3XQYcMGK8aV3JBSmJt8=
sha1:EQ/hTaPoAU3BdF0K9oC0x8Eed+Y=
 by: Keith Thompson - Wed, 17 Jan 2024 21:03 UTC

Kaz Kylheku <433-929-6894@kylheku.com> writes:
> On 2024-01-17, David Brown <david.brown@hesbynett.no> wrote:
>> In my makefiles for any non-trivial project, I find the source files by
>> wildcard searches, recursively through sub-directories. Basically, if a
>> .c or .cpp file exists somewhere in the project tree, it is part of the
>> project build. Can CMake do this with reasonable convenience, or would
>> I have to make a extra step with an external script?
>
> By the way, a useful idea, if you go that route, is to do that is with
> git wildcard searches, like:
>
> C_SRCS := $(shell git ls-files 'src/**/*.c')
>
> so you are not picking up untracked local files into the build.
> This means that a new file has to be git-added to be pulled in.

I haven't verified this in the documentation, but git wildcards appear
to be recursive (unlike most shell wildcards), so the above could be:

C_SRCS := $(shell git ls-files 'src/*.c')

(Which raises the question of how `git ls-files` can be told to list
only *.c files directly under the src directory. I don't know the
answer.)

[...]

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: C and Make

<tdYpN.354612$83n7.144246@fx18.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31135&group=comp.lang.c#31135

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: C and Make
Newsgroups: comp.lang.c,comp.unix.programmer
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me> <uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad> <uo709b$1ksuv$2@dont-email.me> <%PDpN.125107$yEgf.91020@fx09.iad> <uo7802$1m0or$1@dont-email.me> <xTSpN.168165$vFZa.18232@fx13.iad> <uo98ol$25juu$2@dont-email.me>
Lines: 30
Message-ID: <tdYpN.354612$83n7.144246@fx18.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 17 Jan 2024 22:08:25 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 17 Jan 2024 22:08:25 GMT
X-Received-Bytes: 2019
 by: Scott Lurndal - Wed, 17 Jan 2024 22:08 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On Wed, 17 Jan 2024 16:03:41 GMT, Scott Lurndal wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>>Here’s how I get a nicely typeset view of one of my own man pages:
>>>
>>> groff -ktman -Tpdf «troff-file» | okular - &
>>
>> $ type okular
>> -ksh: whence: okular: not found
>
> ldo@theon:~> apt-cache search okular
> okular-backend-odp - Okular backend for ODP documents
> okular-backend-odt - Okular backend for ODT documents
> libokular5core11 - libraries for the Okular document viewer
> okular - universal document viewer
> okular-dev - development files for the Okular libraries
> okular-extra-backends - additional document format support for Okular
> okular-mobile - mobile support for Okular
> qml-module-org-kde-okular - mobile support for Okular - QML modules
>
>It helps to try the right command ...

My Fedora install doesn't support apt-cache, apt or dpkg commands.

I'm perfectly aware that one can download pretty much any package
for any distribution, however:

xpdf is the best linux pdf viewer, in my opinion. I detest acroread, evince and similar ilk.

Re: C and Make

<20240117135955.634@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31138&group=comp.lang.c#31138

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 22:19:51 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <20240117135955.634@kylheku.com>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
<uo8asp$1v1eq$3@dont-email.me> <20240117095809.591@kylheku.com>
<878r4nekp7.fsf@nosuchdomain.example.com>
Injection-Date: Wed, 17 Jan 2024 22:19:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="30353e714807d76ba68823a6307c7dd8";
logging-data="2342355"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++c3y5i3/1Bu5/pzOGawglKdZ82HQHwcg="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:70w1nOCol853rdF1KVaKmG8cY28=
 by: Kaz Kylheku - Wed, 17 Jan 2024 22:19 UTC

On 2024-01-17, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> Kaz Kylheku <433-929-6894@kylheku.com> writes:
>> On 2024-01-17, David Brown <david.brown@hesbynett.no> wrote:
>>> In my makefiles for any non-trivial project, I find the source files by
>>> wildcard searches, recursively through sub-directories. Basically, if a
>>> .c or .cpp file exists somewhere in the project tree, it is part of the
>>> project build. Can CMake do this with reasonable convenience, or would
>>> I have to make a extra step with an external script?
>>
>> By the way, a useful idea, if you go that route, is to do that is with
>> git wildcard searches, like:
>>
>> C_SRCS := $(shell git ls-files 'src/**/*.c')
>>
>> so you are not picking up untracked local files into the build.
>> This means that a new file has to be git-added to be pulled in.
>
> I haven't verified this in the documentation, but git wildcards appear
> to be recursive (unlike most shell wildcards), so the above could be:
>
> C_SRCS := $(shell git ls-files 'src/*.c')

You are right; we don't need the double star glob in git ls-files,
(and it appears not to work, so we cannot use it)./

The ls-files man page doesn't document it the format.

For --exclude patterns, it says that they are gitignore patterns
and for that, there is detailed documentation. gitignore supports
double star patterns fro matching zero or more directory components.

So it looks as if ls-files doesn't use the same patterns as gitignore.

The behavior is similar to what would be obtained if we applied the
POSIX fnmatch function to each element of a list of the paths in the
git index, and omitted the FNM_PATHNAME bit which prevents * and ? from
matching across the / separators.

The shell does this kind of matching in some non-path contexts:

$ case a/b.c in *.c ) echo yes ;; esac
yes

For gitignore, the implemented glob-like matching, with the double
star extension (not in POSIX).

> (Which raises the question of how `git ls-files` can be told to list
> only *.c files directly under the src directory. I don't know the
> answer.)

Unfortunately, the answer seems to be to remove quotes to make the shell
do the expanding, so that git then receives the list of names to list
(possibly too large for the argument limit, needing xargs).

If any of the names refer to untracked files, those will be omitted,
so it will work out.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: C and Make

<uo9ngf$27uc5$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31141&group=comp.lang.c#31141

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 23:22:56 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <uo9ngf$27uc5$1@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
<uo8asp$1v1eq$3@dont-email.me> <20240117095809.591@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 Jan 2024 23:22:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7b7eb05269adaf47ad0e7a8103a3b8bb";
logging-data="2357637"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aTMRPzyxNtkyw1XnjcMxI"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:lsuMcycInefPNmVsOaA7thOEQuY=
 by: Lawrence D'Oliv - Wed, 17 Jan 2024 23:22 UTC

On Wed, 17 Jan 2024 18:11:55 -0000 (UTC), Kaz Kylheku wrote:

> It's really better to assiduously list the files explicitly in the
> Makefile.

I think I agree. And furthermore, you only want to list them once, not
in multiple places.

And how about writing CMake script to generate the list of names in
the form of C code? Some years ago I submitted a patch to the Blender
build process <https://developer.blender.org/T37228> to simplify the
management of the list of files for their “DNA” data-interface system.
They weren’t keen on it.

Re: C and Make

<uo9ni1$27uc5$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31142&group=comp.lang.c#31142

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 23:23:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <uo9ni1$27uc5$2@dont-email.me>
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me>
<uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad>
<uo709b$1ksuv$2@dont-email.me> <%PDpN.125107$yEgf.91020@fx09.iad>
<uo7802$1m0or$1@dont-email.me> <xTSpN.168165$vFZa.18232@fx13.iad>
<uo98ol$25juu$2@dont-email.me> <tdYpN.354612$83n7.144246@fx18.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 17 Jan 2024 23:23:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7b7eb05269adaf47ad0e7a8103a3b8bb";
logging-data="2357637"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Waia0ZAooXb0Ksjd9FcPL"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:UAjUoG9azIJlHoXpXSz2cIcUUuM=
 by: Lawrence D'Oliv - Wed, 17 Jan 2024 23:23 UTC

On Wed, 17 Jan 2024 22:08:25 GMT, Scott Lurndal wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> ldo@theon:~> apt-cache search okular
>> okular-backend-odp - Okular backend for ODP documents
>> okular-backend-odt - Okular backend for ODT documents
>> libokular5core11 - libraries for the Okular document viewer
>> okular - universal document viewer
>> okular-dev - development files for the Okular libraries
>> okular-extra-backends - additional document format support for Okular
>> okular-mobile - mobile support for Okular
>> qml-module-org-kde-okular - mobile support for Okular - QML modules
>
> My Fedora install doesn't support apt-cache, apt or dpkg commands.

Don’t you know what their equivalents are?

Re: C and Make

<874jfbedfd.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31143&group=comp.lang.c#31143

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: C and Make
Date: Wed, 17 Jan 2024 15:40:54 -0800
Organization: None to speak of
Lines: 38
Message-ID: <874jfbedfd.fsf@nosuchdomain.example.com>
References: <uo1dbu$img2$1@dont-email.me> <20240114114617.635@kylheku.com>
<pan$c5951$76a61747$d5f21447$4dcfca4a@invalid.invalid>
<uo489j$135hs$1@dont-email.me> <uo4dol$13tot$2@dont-email.me>
<uo4h05$14cnu$1@dont-email.me> <uo73na$2von$2@nyheter.lysator.liu.se>
<uo8asp$1v1eq$3@dont-email.me> <20240117095809.591@kylheku.com>
<878r4nekp7.fsf@nosuchdomain.example.com>
<20240117135955.634@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="8dfe176c794f193a384e5e1530412075";
logging-data="2364397"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ro5VG3i9o0d9xHCOR4VWJ"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:jEfq2j+RmZ5bGxNHsuI8EGaeg74=
sha1:VjmlIMgWLhq5Z1t7ooRBENpYmE8=
 by: Keith Thompson - Wed, 17 Jan 2024 23:40 UTC

Kaz Kylheku <433-929-6894@kylheku.com> writes:
> On 2024-01-17, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>> Kaz Kylheku <433-929-6894@kylheku.com> writes:
>>> On 2024-01-17, David Brown <david.brown@hesbynett.no> wrote:
>>>> In my makefiles for any non-trivial project, I find the source files by
>>>> wildcard searches, recursively through sub-directories. Basically, if a
>>>> .c or .cpp file exists somewhere in the project tree, it is part of the
>>>> project build. Can CMake do this with reasonable convenience, or would
>>>> I have to make a extra step with an external script?
>>>
>>> By the way, a useful idea, if you go that route, is to do that is with
>>> git wildcard searches, like:
>>>
>>> C_SRCS := $(shell git ls-files 'src/**/*.c')
>>>
>>> so you are not picking up untracked local files into the build.
>>> This means that a new file has to be git-added to be pulled in.
>>
>> I haven't verified this in the documentation, but git wildcards appear
>> to be recursive (unlike most shell wildcards), so the above could be:
>>
>> C_SRCS := $(shell git ls-files 'src/*.c')
>
> You are right; we don't need the double star glob in git ls-files,
> (and it appears not to work, so we cannot use it)./
>
> The ls-files man page doesn't document it the format.

This is odd. As far as I can tell, git's behavior (as of 2.43.0)
doesn't match either its documentation or the behavior of '**' wildcards
in bash with "globstar" enabled.

I suggest this isn't the place to discuss the details.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: C and Make

<lRZpN.70215$CYpe.44709@fx40.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=31145&group=comp.lang.c#31145

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx40.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: C and Make
Newsgroups: comp.lang.c,comp.unix.programmer
References: <uo1dbu$img2$1@dont-email.me> <uo47qu$12l9o$3@dont-email.me> <uo4ght$14are$1@dont-email.me> <QWxpN.207477$PuZ9.188607@fx11.iad> <uo709b$1ksuv$2@dont-email.me> <%PDpN.125107$yEgf.91020@fx09.iad> <uo7802$1m0or$1@dont-email.me> <xTSpN.168165$vFZa.18232@fx13.iad> <uo98ol$25juu$2@dont-email.me> <tdYpN.354612$83n7.144246@fx18.iad> <uo9ni1$27uc5$2@dont-email.me>
Lines: 22
Message-ID: <lRZpN.70215$CYpe.44709@fx40.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 17 Jan 2024 23:59:13 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 17 Jan 2024 23:59:13 GMT
X-Received-Bytes: 1890
 by: Scott Lurndal - Wed, 17 Jan 2024 23:59 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On Wed, 17 Jan 2024 22:08:25 GMT, Scott Lurndal wrote:
>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> ldo@theon:~> apt-cache search okular
>>> okular-backend-odp - Okular backend for ODP documents
>>> okular-backend-odt - Okular backend for ODT documents
>>> libokular5core11 - libraries for the Okular document viewer
>>> okular - universal document viewer
>>> okular-dev - development files for the Okular libraries
>>> okular-extra-backends - additional document format support for Okular
>>> okular-mobile - mobile support for Okular
>>> qml-module-org-kde-okular - mobile support for Okular - QML modules
>>
>> My Fedora install doesn't support apt-cache, apt or dpkg commands.
>
>Don’t you know what their equivalents are?

Of course. rpm and/or yum. I'm not interested in changing PDF readers, however.

Ah, a google search shows that Okular is like evince and acroread. No thanks.


devel / comp.lang.c / Re: C and Make

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor