Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

They can always run stderr through uniq. :-) -- Larry Wall in <199704012331.PAA16535@wall.org>


devel / comp.lang.c / Re: Experimental C Build System

SubjectAuthor
* Experimental C Build Systembart
+* Re: Experimental C Build SystemLawrence D'Oliveiro
|+* Re: Experimental C Build SystemChris M. Thomasson
||`* Re: Experimental C Build SystemDavid Brown
|| +* Re: Experimental C Build SystemChris M. Thomasson
|| |`* Re: Experimental C Build SystemDavid Brown
|| | `- Re: Experimental C Build SystemChris M. Thomasson
|| `- Re: Experimental C Build Systembart
|`* Re: Experimental C Build Systembart
| +* Re: Experimental C Build SystemMalcolm McLean
| |`* Re: Experimental C Build Systembart
| | `* Re: Experimental C Build SystemMalcolm McLean
| |  +- Re: Experimental C Build Systembart
| |  `* Re: Experimental C Build SystemRichard Harnden
| |   `* Re: Experimental C Build Systemvallor
| |    +- Re: Experimental C Build Systemvallor
| |    +* Re: Experimental C Build Systembart
| |    |+* Re: Experimental C Build SystemDavid Brown
| |    ||+* Re: Experimental C Build Systembart
| |    |||`* Re: Experimental C Build SystemDavid Brown
| |    ||| +- Re: Experimental C Build SystemMalcolm McLean
| |    ||| `* Re: Experimental C Build Systembart
| |    |||  +* Re: Experimental C Build SystemMichael S
| |    |||  |+* Re: Experimental C Build SystemScott Lurndal
| |    |||  ||`- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |`* Re: Experimental C Build SystemDavid Brown
| |    |||  | `* Re: Experimental C Build SystemMichael S
| |    |||  |  +- Re: Experimental C Build SystemLawrence D'Oliveiro
| |    |||  |  +- Re: Experimental C Build SystemScott Lurndal
| |    |||  |  `* Re: Experimental C Build SystemDavid Brown
| |    |||  |   +* Re: Experimental C Build SystemMichael S
| |    |||  |   |`* Re: Experimental C Build SystemDavid Brown
| |    |||  |   | `* Re: Experimental C Build SystemMichael S
| |    |||  |   |  `* Stu Feldman (Was: Experimental C Build System)Kenny McCormack
| |    |||  |   |   `* Re: Stu Feldman (Was: Experimental C Build System)Kaz Kylheku
| |    |||  |   |    `- Re: Stu Feldman (Was: Experimental C Build System)Janis Papanagnou
| |    |||  |   `* Re: Experimental C Build Systembart
| |    |||  |    +- Re: Experimental C Build SystemDavid Brown
| |    |||  |    +* Re: Experimental C Build SystemScott Lurndal
| |    |||  |    |+* Re: Experimental C Build Systembart
| |    |||  |    ||`* Re: Experimental C Build SystemScott Lurndal
| |    |||  |    || `* Re: Experimental C Build SystemMalcolm McLean
| |    |||  |    ||  `- Re: Experimental C Build SystemScott Lurndal
| |    |||  |    |`- Re: Experimental C Build SystemJanis Papanagnou
| |    |||  |    `* Re: Experimental C Build SystemLawrence D'Oliveiro
| |    |||  |     `* Re: Experimental C Build Systembart
| |    |||  |      +* Re: Experimental C Build SystemLawrence D'Oliveiro
| |    |||  |      |`* Re: Experimental C Build Systembart
| |    |||  |      | +- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      | `* Re: Experimental C Build SystemLawrence D'Oliveiro
| |    |||  |      |  +- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      |  `- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      +* Re: Experimental C Build SystemMalcolm McLean
| |    |||  |      |+* Re: Experimental C Build SystemDavid Brown
| |    |||  |      ||+* Re: Experimental C Build Systembart
| |    |||  |      |||`* Re: Experimental C Build SystemLawrence D'Oliveiro
| |    |||  |      ||| `- Re: Experimental C Build Systembart
| |    |||  |      ||`* Re: Experimental C Build SystemMalcolm McLean
| |    |||  |      || +* Re: Experimental C Build Systembart
| |    |||  |      || |+* Re: Experimental C Build SystemMalcolm McLean
| |    |||  |      || ||`- Re: Experimental C Build SystemDavid Brown
| |    |||  |      || |`* Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      || | `* Re: Experimental C Build Systembart
| |    |||  |      || |  `* Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      || |   `* Re: Experimental C Build Systembart
| |    |||  |      || |    +- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      || |    +* Re: Experimental C Build SystemGary R. Schmidt
| |    |||  |      || |    |`- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      || |    +* Re: Experimental C Build SystemMalcolm McLean
| |    |||  |      || |    |+* Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      || |    ||`- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      || |    |`* Re: Experimental C Build SystemDavid Brown
| |    |||  |      || |    | `* Re: Experimental C Build SystemMalcolm McLean
| |    |||  |      || |    |  `* Re: Experimental C Build SystemDavid Brown
| |    |||  |      || |    |   `- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      || |    `* Re: Experimental C Build SystemKees Nuyt
| |    |||  |      || |     +- Re: Experimental C Build SystemKeith Thompson
| |    |||  |      || |     `- Re: Experimental C Build SystemScott Lurndal
| |    |||  |      || +- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      || `* Re: Experimental C Build SystemLawrence D'Oliveiro
| |    |||  |      ||  `- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |      |+- Re: Experimental C Build SystemScott Lurndal
| |    |||  |      |`- Re: Experimental C Build SystemLawrence D'Oliveiro
| |    |||  |      `* Re: Experimental C Build SystemJanis Papanagnou
| |    |||  |       +- Re: Experimental C Build SystemMalcolm McLean
| |    |||  |       `* Re: Experimental C Build Systembart
| |    |||  |        +* Re: Experimental C Build SystemKaz Kylheku
| |    |||  |        |`* Re: Experimental C Build Systembart
| |    |||  |        | +* Re: Experimental C Build SystemJim Jackson
| |    |||  |        | |`- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |        | `- Re: Experimental C Build SystemKaz Kylheku
| |    |||  |        `* Re: Experimental C Build SystemDavid Brown
| |    |||  |         `* Re: Experimental C Build Systembart
| |    |||  |          +- Re: Experimental C Build SystemDavid Brown
| |    |||  |          `* Re: Experimental C Build SystemLawrence D'Oliveiro
| |    |||  |           +* Re: Experimental C Build Systembart
| |    |||  |           |+- Re: Experimental C Build SystemChris M. Thomasson
| |    |||  |           |`* Re: Experimental C Build SystemJim Jackson
| |    |||  |           | `* Re: Experimental C Build SystemMalcolm McLean
| |    |||  |           |  +* Re: Experimental C Build Systembart
| |    |||  |           |  |+* Re: Experimental C Build SystemKeith Thompson
| |    |||  |           |  |`* Re: Experimental C Build SystemKaz Kylheku
| |    |||  |           |  `- Re: Experimental C Build SystemScott Lurndal
| |    |||  |           `* Re: Experimental C Build SystemMalcolm McLean
| |    |||  `* Re: Experimental C Build SystemDavid Brown
| |    ||+- Re: Experimental C Build SystemKaz Kylheku
| |    ||`- Re: Experimental C Build SystemLawrence D'Oliveiro
| |    |`* Re: Experimental C Build SystemRichard Harnden
| |    `* Re: Experimental C Build SystemLawrence D'Oliveiro
| `* Re: Experimental C Build SystemDavid Brown
+* Re: Experimental C Build SystemTim Rentsch
+- Re: Experimental C Build Systembart
+* Re: Experimental C Build Systemthiago
+- Re: Experimental C Build Systemthiago
`- Re: Experimental C Build Systembart

Pages:1234567891011121314151617
Re: Experimental C Build System

<20240201081857.753@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!paganini.bofh.team!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,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 16:20:24 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <20240201081857.753@kylheku.com>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
Injection-Date: Thu, 1 Feb 2024 16:20:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5a0ac715860476fe0387f500eaa77814";
logging-data="2255823"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JWMhd6d1Rh9eCs4+Mc7rofQDuz6u/3HE="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:R27m3WRGO8gFMxdMi2DoEgY4GFs=
 by: Kaz Kylheku - Thu, 1 Feb 2024 16:20 UTC

On 2024-02-01, David Brown <david.brown@hesbynett.no> wrote:
> 5. Modules provide encapsulation of data, code and namespaces.

Case study: C++ originally had only classes which provie this. Then it
acquired the namespace construct which also provides it.. In spite of
that, someone decided it needs modules also.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Experimental C Build System

<upgkij$25lpj$1@dont-email.me>

  copy mid

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

  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: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 17:32:01 +0000
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <upgkij$25lpj$1@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upgfog$24m0s$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 1 Feb 2024 17:32:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19d35866713dfba03207e755d1c79dd1";
logging-data="2283315"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+B9RVCGxLmEmMTWFmrGdYcgfS/XyvW/zw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JYY1IOqBE0why3zlV3E+ajhalLQ=
Content-Language: en-GB
In-Reply-To: <upgfog$24m0s$1@dont-email.me>
 by: bart - Thu, 1 Feb 2024 17:32 UTC

On 01/02/2024 16:09, Richard Harnden wrote:
> On 31/01/2024 20:25, bart wrote:
>> BTW that 'make' only works on my machine because it happens to be part
>> of mingw; none of my other C compilers have make.
>>
>> And as written, it only works for 'cc' which comes with 'gcc'
>
> Doesn't dos/windows have nmake and cl?

No.

Re: Experimental C Build System

<upgklr$25mca$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm....@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 17:33:46 +0000
Organization: A noiseless patient Spider
Lines: 137
Message-ID: <upgklr$25mca$1@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me> <upgcbm$246u1$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 17:33:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3d91f7d22e9d38720ad34c1d4d57f922";
logging-data="2283914"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UG2ZrQLB3aAIBEdHNJW8gSvRo8CGS9GU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:DNijPOc/ap0e6evrc0Aafxx81x0=
Content-Language: en-GB
In-Reply-To: <upgcbm$246u1$1@dont-email.me>
 by: Malcolm McLean - Thu, 1 Feb 2024 17:33 UTC

On 01/02/2024 15:11, David Brown wrote:
> On 01/02/2024 12:31, bart wrote:
>> On 01/02/2024 08:39, David Brown wrote:
>>> On 31/01/2024 21:25, bart wrote:
>>>> On 31/01/2024 16:41, vallor wrote:
>>>>> On Tue, 30 Jan 2024 19:22:00 +0000, Richard Harnden
>>>>> <richard.nospam@gmail.invalid> wrote in
>>>>> <upbi8o$14443$1@dont-email.me>:
>>>>>
>>>>>> On 30/01/2024 16:50, Malcolm McLean wrote:
>>>>>>>
>>>>>>> But I'm wondering about one file which contains all the sources
>>>>>>> for the
>>>>>>> program. Like an IDE project file but lighter weight.
>>>>>>>
>>>>>>>
>>>>>> In other words: a Makefile
>>>>>
>>>>> Agreed; it's a solution looking for a problem.
>>>>
>>>> Why do you think languages come with modules? That allows them to
>>>> discover their own modules, rather than rely on external apps where
>>>> the details are buried under appalling syntax and mixed up with a
>>>> hundred other matters.
>>>>
>>>
>>> No, that is not at all the purpose of modules in programming.  Note
>>> that there is no specific meaning of "module", and different
>>> languages use different for similar concepts.  There are many
>>> features that a language's "module" system might have - some have
>>> all, some have few:
>>>
>>> 1. It lets you split the program into separate parts - generally
>>> separate files.  This is essential for scalability for large programs.
>>>
>>> 2. You can compile modules independently to allow partial builds.
>>>
>>> 3. Modules generally have some way to specify exported symbols and
>>> facilities that can be used by other modules.
>>>
>>> 4. Modules can "import" other modules, gaining access to those
>>> modules' exported symbols.
>>>
>>> 5. Modules provide encapsulation of data, code and namespaces.
>>>
>>> 6. Modules can be used in a hierarchical system, building big modules
>>> from smaller ones to support larger libraries with many files.
>>>
>>> 7. Modules provide a higher level concept that can be used by
>>> language tools to see how the whole program fits together or interact
>>> with package managers and librarian tools.
>>>
>>>
>>> C provides 1, 2, 3, and 4 if you use a "file.c/file.h" organisation.
>>> It provides a limited form of 5 (everything that is not exported is
>>> "static"), but scaling to larger systems is dependent on identifier
>>> prefixes.
>>>
>>> You seem to be thinking purely about item 7 above.  This is, I think,
>>> common in interpreted languages (where modules have to be found at
>>> run-time, where the user is there but the developer is not).
>> I've been implementing languages with language-supported modules for
>> about 12 years.
>>
>> They generally provide 1, 2, 4, 5, and 7 from your list, and partial
>> support of 6.
>
> Sure.  Programming languages need that if they are to scale at all.
>
>>
>> They don't provide 2 (compiling individual modules) because the aim is
>> a very fast, whole-program compler.
>
> Okay.
>
>
> But what you are talking about to add to C is item 7, nothing more. That
> is not adding "modules" to C.  Your suggestion might be useful to some
> people for some projects, but that doesn't make it "modules" in any real
> sense.
>
>
>>
>> While for 6, there is only a hierarchy between groups of modules, each
>> forming an independent sub-program or library. I tried a strict full
>> per-module hierarchy early on, mixed up with independent compilation;
>> it worked poorly.
>>
>> The two levels allow you to assemble one binary out of groups of
>> modules that each represent an independent component or library.
>>
>>  > Compiled
>>  > languages don't usually have such a thing, because developers (as
>>  > distinct from users) have build tools available that do a better job.
>>
>> Given a module scheme, the tool needed to build a whole program should
>> not need to be told about the names and location of every constituent
>> module; it should be able to determine that from what's already in the
>> source code, given only a start point.
>
> Why?
>
> You can't just take some idea that you like, and that is suitable for
> the projects you use, and assume it applies to everyone else.
>
> I have no problem telling my build system, or compilers, where the files
> are.  In fact, I'd have a lot of problems if I couldn't do that.  It is
> not normal development practice to have the source files in the same
> directory that you use for building the object code and binaries.
>

Our system is that we've got two types of source generated by us, the
libraries which are used by all the programs, and the code specific to
each program. The library source code is placed on a central server and
then downloaded by conan (a package manager) which keeps it in a private
directory in the local machine not intended for viewing. The source
specific to the program is placed in a git project and synchronised with
git's remote repository facilities. Then IDE project files are built
with CMake. These with various other derived bits and bobs are placed in
a build folder, which is always under the git repository, but placed in
the ignore file and so not under git source control. The IDE is then
invoked on the project file in the build directory, and the executables
also go into the build directory. They then need to be moved to a
different location to be run.
CMake is set up so that it recursively crawls the source directories and
places every single source file into the IDE project file. This isn't
really recommended but it means you don't have to maintain CMakeLists files.
So it's an out of tree build. But we can't just place source in some
random location on the local machine and tell the system to pull it in.
Technically you could modify the CMake script to do that. But it would
break the whole system.

--
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm

Re: Experimental C Build System

<upgo72$26abt$1@dont-email.me>

  copy mid

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

  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: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 18:34:08 +0000
Organization: A noiseless patient Spider
Lines: 174
Message-ID: <upgo72$26abt$1@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me> <upgcbm$246u1$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 18:34:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19d35866713dfba03207e755d1c79dd1";
logging-data="2304381"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197IyxFysZpYs5zq2tNP+IwNUP65gonQmg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:/hqPC7Mn+VNxlYEgWpHwDcnR75s=
In-Reply-To: <upgcbm$246u1$1@dont-email.me>
Content-Language: en-GB
 by: bart - Thu, 1 Feb 2024 18:34 UTC

On 01/02/2024 15:11, David Brown wrote:

>>> 1. It lets you split the program into separate parts - generally
>>> separate files.  This is essential for scalability for large programs.
>>>
>>> 2. You can compile modules independently to allow partial builds.
>>>
>>> 3. Modules generally have some way to specify exported symbols and
>>> facilities that can be used by other modules.
>>>
>>> 4. Modules can "import" other modules, gaining access to those
>>> modules' exported symbols.
>>>
>>> 5. Modules provide encapsulation of data, code and namespaces.
>>>
>>> 6. Modules can be used in a hierarchical system, building big modules
>>> from smaller ones to support larger libraries with many files.
>>>
>>> 7. Modules provide a higher level concept that can be used by
>>> language tools to see how the whole program fits together or interact
>>> with package managers and librarian tools.
>>>
>>>
>>> C provides 1, 2, 3, and 4 if you use a "file.c/file.h" organisation.
>>> It provides a limited form of 5 (everything that is not exported is
>>> "static"), but scaling to larger systems is dependent on identifier
>>> prefixes.
>>>
>>> You seem to be thinking purely about item 7 above.  This is, I think,
>>> common in interpreted languages (where modules have to be found at
>>> run-time, where the user is there but the developer is not).
>> I've been implementing languages with language-supported modules for
>> about 12 years.
>>
>> They generally provide 1, 2, 4, 5, and 7 from your list, and partial
>> support of 6.
>
> Sure.  Programming languages need that if they are to scale at all.
>
>>
>> They don't provide 2 (compiling individual modules) because the aim is
>> a very fast, whole-program compler.
>
> Okay.
>
>
> But what you are talking about to add to C is item 7, nothing more. That
> is not adding "modules" to C.  Your suggestion might be useful to some
> people for some projects, but that doesn't make it "modules" in any real
> sense.

Item 7 is my biggest stumbling to building open source C projects.

While the developer (say you), knows the necessary info, and can somehow
import into the build system, my job is trying to get it out.

I can't use the intended build system because for one reason or another
it doesn't work, or requires complex dependencies (MSYS, CMake, MSTOOLS,
..configure), or I want to run mcc on it.

That info could trivially be added to the C source code. Nobody actually
needs to use my #pragma scheme; it could simply be a block comment on
one of the modules.

I'm sure with all your complicated tools, they could surely dump some
text that looks like:

// List of source files to build the binary cipher.c:
// cipher.c
// hmac.c
// sha2.c

and prepend it to one of the files. Even a README will do.

That wouldn't hurt would it?

>> Given a module scheme, the tool needed to build a whole program should
>> not need to be told about the names and location of every constituent
>> module; it should be able to determine that from what's already in the
>> source code, given only a start point.
>
> Why?
>
> You can't just take some idea that you like, and that is suitable for
> the projects you use, and assume it applies to everyone else.
>
> I have no problem telling my build system, or compilers, where the files
> are.  In fact, I'd have a lot of problems if I couldn't do that.  It is
> not normal development practice to have the source files in the same
> directory that you use for building the object code and binaries.
>
>>
>> Even with independent compilation, you might be able to use that info
>> to determine dependencies, but you will need that module hierarchy if
>> you want to compile individual modules.
>
> I already have tools for determining dependencies.  What can your
> methods do that mine can't?
>
> (And don't bother saying that you can do it without extra tools -
> everyone who wants "make" and "gcc" has them on hand.  And those who
> want an IDE that figures out dependencies for them have a dozen free
> options there too.  These are all standard tools available to everyone.)

So, if C were to acquire modules, so that a C compiler could determine
that all for it itself (maybe even work out for itself which need
recompiling), would you just ignore that feature and use the same
auxiliary methods you have always done?

You don't see that the language taking over task (1) of the things that
makefiles do, and possibly (2) (of the list I posted; repeated below),
can streamline makefiles to make them shorter, simpler, easier to write
and to read, and with fewer opportunities to get stuff wrong?

That was a rhetorical question. Obviously not.

> Perhaps I would find your tools worked for a "Hello, world" project.
> Maybe they were still okay as it got slightly bigger.  Then I'd have
> something that they could not handle, and I'd reach for make.  What
> would be the point of using "make" to automate - for example -
> post-processing of a binary to add a CRC check, but using your tools to
> handle the build?  It's much easier just to use "make" for the whole thing.

Because building one binary is a process should be the job of a
compiler, not some random external tool that knows nothing of the
language or compiler.

Maybe you think makefiles should individually list all the 1000s of
functions of a project too?

> You are offering me a fish.  I am offering to teach you to fish,
> including where to go to catch different kinds of fish.  This is really
> a no-brainer choice.

That analogy makes no sense.

Let me try and explain what I do: I write whole-program compilers. That
means that, each time you do a new build, it will reprocess each file
from source. They use the language's module scheme to know which files
to process.

I tend to build C programs by recompiling all modules too. So I want to
introduce the same convenience I have elsewhere.

It works for me, and I'm sure could work for others if they didn't have
makefiles forced down their throats and hardwired into their brains.

----------------------------
(Repost)

I've already covered this in many posts on the subject. But 'make' deals
with three kinds of requirements:

(1) Specifying what the modules are to be compiled and combined into one
binary file

(2) Specifying dependences between all files to allow rebuilding of that
one file with minimal recompilation

(3) Everything else needed in a complex project: running processes to
generate files file config.h, creating multiple binaries, specifying
dependencies between binaries, installation etc

My proposal tackles only (1), which is something that many languages now
have the means to deal with themselves. I already stated that (2) is not
covered.

But you may still need makefiles to deal with (3).

If your main requirement /is/ only (1), then my idea is to move the
necessary info into the source code, and tackle it with the C compiler.

Re: Experimental C Build System

<seSuN.420645$83n7.76941@fx18.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.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: Experimental C Build System
Newsgroups: comp.lang.c,comp.unix.programmer
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me> <up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me> <upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me> <upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me> <upeab3$1m2f4$1@dont-email.me> <upgfog$24m0s$1@dont-email.me> <upgkij$25lpj$1@dont-email.me>
Lines: 14
Message-ID: <seSuN.420645$83n7.76941@fx18.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 01 Feb 2024 19:25:12 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 01 Feb 2024 19:25:12 GMT
X-Received-Bytes: 1371
 by: Scott Lurndal - Thu, 1 Feb 2024 19:25 UTC

bart <bc@freeuk.com> writes:
>On 01/02/2024 16:09, Richard Harnden wrote:
>> On 31/01/2024 20:25, bart wrote:
>>> BTW that 'make' only works on my machine because it happens to be part
>>> of mingw; none of my other C compilers have make.
>>>
>>> And as written, it only works for 'cc' which comes with 'gcc'
>>
>> Doesn't dos/windows have nmake and cl?
>
>No.

You sure about that? They sure used to have them
as an add-on. IIRC, they're still part of visual studio.

Re: Experimental C Build System

<87cytgq81b.fsf@nosuchdomain.example.com>

  copy mid

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

  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: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 01 Feb 2024 11:49:36 -0800
Organization: None to speak of
Lines: 12
Message-ID: <87cytgq81b.fsf@nosuchdomain.example.com>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeddh$1mjib$2@dont-email.me> <upfltd$2051d$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="637459c0b3f26f70a97e9a2f25534b92";
logging-data="2329865"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KFQChgQz5OAfq/Hq8N2P+"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:aWNCRPBC/9fKcf4Y7kdHIgJC0rU=
sha1:Uuwz9Zjw5xPecLkEHRSHTGkxuvI=
 by: Keith Thompson - Thu, 1 Feb 2024 19:49 UTC

David Brown <david.brown@hesbynett.no> writes:
[...]
> I'd rather "make -j" (without a number) defaulted to using the number
> of cpu cores, as that is a reasonable guess for most compilations.

Agreed, but there might not be a sufficiently portable way to determine
that number.

--
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: Experimental C Build System

<upgsoq$274ph$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 19:51:53 +0000
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <upgsoq$274ph$1@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upgfog$24m0s$1@dont-email.me>
<upgkij$25lpj$1@dont-email.me> <seSuN.420645$83n7.76941@fx18.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 1 Feb 2024 19:51:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19d35866713dfba03207e755d1c79dd1";
logging-data="2331441"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Dei1wPecGtq6IIEZkeJHL6tXe52ae7cU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:tIQgs5aWbzjnRNUzaIN7w7yoewM=
Content-Language: en-GB
In-Reply-To: <seSuN.420645$83n7.76941@fx18.iad>
 by: bart - Thu, 1 Feb 2024 19:51 UTC

On 01/02/2024 19:25, Scott Lurndal wrote:
> bart <bc@freeuk.com> writes:
>> On 01/02/2024 16:09, Richard Harnden wrote:
>>> On 31/01/2024 20:25, bart wrote:
>>>> BTW that 'make' only works on my machine because it happens to be part
>>>> of mingw; none of my other C compilers have make.
>>>>
>>>> And as written, it only works for 'cc' which comes with 'gcc'
>>>
>>> Doesn't dos/windows have nmake and cl?
>>
>> No.
>
> You sure about that? They sure used to have them
> as an add-on. IIRC, they're still part of visual studio.

Visual Studio is a 10,000MB monster. It might well have it around, but
it's so complex, it's been years since I've even seen discrete cl.exe
and link.exe programs, despite scouring massive, 11-deep directory
structures.

Meanwhile my everyday compilers are 0.4MB for my language and 0.3MB for C.

I like to keep things simple. Everybody else likes to keep things
complicated, and the more the better.

Anyway, acquiring VS just to build one small program would be like just
a giant sledgehammer, 1000 times normal size, to crack a tiny nut.

Re: Experimental C Build System

<upgu0a$278rd$2@dont-email.me>

  copy mid

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

  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: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 12:12:59 -0800
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <upgu0a$278rd$2@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upgfog$24m0s$1@dont-email.me>
<upgkij$25lpj$1@dont-email.me> <seSuN.420645$83n7.76941@fx18.iad>
<upgsoq$274ph$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 20:12:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e5db24bf58349e0f24b4ca76196085dd";
logging-data="2335597"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+yWVpXQLqiQ9T0EmsQ3OfMP7QyBer60gs="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:mOrlhl7EFEt6P5HgNk0Q1qTSNFU=
Content-Language: en-US
In-Reply-To: <upgsoq$274ph$1@dont-email.me>
 by: Chris M. Thomasson - Thu, 1 Feb 2024 20:12 UTC

On 2/1/2024 11:51 AM, bart wrote:
> On 01/02/2024 19:25, Scott Lurndal wrote:
>> bart <bc@freeuk.com> writes:
>>> On 01/02/2024 16:09, Richard Harnden wrote:
>>>> On 31/01/2024 20:25, bart wrote:
>>>>> BTW that 'make' only works on my machine because it happens to be part
>>>>> of mingw; none of my other C compilers have make.
>>>>>
>>>>> And as written, it only works for 'cc' which comes with 'gcc'
>>>>
>>>> Doesn't dos/windows have nmake and cl?
>>>
>>> No.
>>
>> You sure about that?  They sure used to have them
>> as an add-on.  IIRC, they're still part of visual studio.
>
> Visual Studio is a 10,000MB monster.

Shit happens. I still use MSVC, quite a lot actually. I install
everything! ;^) Have the space, so, well, okay. ;^)

> It might well have it around, but
> it's so complex, it's been years since I've even seen discrete cl.exe
> and link.exe programs, despite scouring massive, 11-deep directory
> structures.
>
> Meanwhile my everyday compilers are 0.4MB for my language and 0.3MB for C.
>
> I like to keep things simple. Everybody else likes to keep things
> complicated, and the more the better.
>
> Anyway, acquiring VS just to build one small program would be like just
> a giant sledgehammer, 1000 times normal size, to crack a tiny nut.

Re: Experimental C Build System

<20240201222328.00006859@yahoo.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.chmurka.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 22:23:28 +0200
Organization: A noiseless patient Spider
Lines: 202
Message-ID: <20240201222328.00006859@yahoo.com>
References: <up8i91$h6iu$1@dont-email.me>
<up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me>
<up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me>
<upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me>
<updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me>
<upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me>
<upgcbm$246u1$1@dont-email.me>
<upgo72$26abt$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Injection-Info: dont-email.me; posting-host="7a85e3d856cad5f664ebd31b1a9bf2dc";
logging-data="2341367"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LV7RVyWqLgnC+lnKKn2KaeYQVIzGrbDk="
Cancel-Lock: sha1:lnGbGSCgCuiwdL8ZLS5Z6pNdhMk=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Thu, 1 Feb 2024 20:23 UTC

On Thu, 1 Feb 2024 18:34:08 +0000
bart <bc@freeuk.com> wrote:

> On 01/02/2024 15:11, David Brown wrote:
>
> >>> 1. It lets you split the program into separate parts - generally
> >>> separate files.  This is essential for scalability for large
> >>> programs.
> >>>
> >>> 2. You can compile modules independently to allow partial builds.
> >>>
> >>> 3. Modules generally have some way to specify exported symbols
> >>> and facilities that can be used by other modules.
> >>>
> >>> 4. Modules can "import" other modules, gaining access to those
> >>> modules' exported symbols.
> >>>
> >>> 5. Modules provide encapsulation of data, code and namespaces.
> >>>
> >>> 6. Modules can be used in a hierarchical system, building big
> >>> modules from smaller ones to support larger libraries with many
> >>> files.
> >>>
> >>> 7. Modules provide a higher level concept that can be used by
> >>> language tools to see how the whole program fits together or
> >>> interact with package managers and librarian tools.
> >>>
> >>>
> >>> C provides 1, 2, 3, and 4 if you use a "file.c/file.h"
> >>> organisation. It provides a limited form of 5 (everything that is
> >>> not exported is "static"), but scaling to larger systems is
> >>> dependent on identifier prefixes.
> >>>
> >>> You seem to be thinking purely about item 7 above.  This is, I
> >>> think, common in interpreted languages (where modules have to be
> >>> found at run-time, where the user is there but the developer is
> >>> not).
> >> I've been implementing languages with language-supported modules
> >> for about 12 years.
> >>
> >> They generally provide 1, 2, 4, 5, and 7 from your list, and
> >> partial support of 6.
> >
> > Sure.  Programming languages need that if they are to scale at all.
> >
> >>
> >> They don't provide 2 (compiling individual modules) because the
> >> aim is a very fast, whole-program compler.
> >
> > Okay.
> >
> >
> > But what you are talking about to add to C is item 7, nothing more.
> > That is not adding "modules" to C.  Your suggestion might be useful
> > to some people for some projects, but that doesn't make it
> > "modules" in any real sense.
>
> Item 7 is my biggest stumbling to building open source C projects.
>
> While the developer (say you), knows the necessary info, and can
> somehow import into the build system, my job is trying to get it out.
>
> I can't use the intended build system because for one reason or
> another it doesn't work, or requires complex dependencies (MSYS,
> CMake, MSTOOLS, .configure), or I want to run mcc on it.
>
> That info could trivially be added to the C source code. Nobody
> actually needs to use my #pragma scheme; it could simply be a block
> comment on one of the modules.
>
> I'm sure with all your complicated tools, they could surely dump some
> text that looks like:
>
> // List of source files to build the binary cipher.c:
> // cipher.c
> // hmac.c
> // sha2.c
>
> and prepend it to one of the files. Even a README will do.
>
> That wouldn't hurt would it?
>
> >> Given a module scheme, the tool needed to build a whole program
> >> should not need to be told about the names and location of every
> >> constituent module; it should be able to determine that from
> >> what's already in the source code, given only a start point.
> >
> > Why?
> >
> > You can't just take some idea that you like, and that is suitable
> > for the projects you use, and assume it applies to everyone else.
> >
> > I have no problem telling my build system, or compilers, where the
> > files are.  In fact, I'd have a lot of problems if I couldn't do
> > that.  It is not normal development practice to have the source
> > files in the same directory that you use for building the object
> > code and binaries.
> >>
> >> Even with independent compilation, you might be able to use that
> >> info to determine dependencies, but you will need that module
> >> hierarchy if you want to compile individual modules.
> >
> > I already have tools for determining dependencies.  What can your
> > methods do that mine can't?
> >
> > (And don't bother saying that you can do it without extra tools -
> > everyone who wants "make" and "gcc" has them on hand.  And those
> > who want an IDE that figures out dependencies for them have a dozen
> > free options there too.  These are all standard tools available to
> > everyone.)
>
> So, if C were to acquire modules, so that a C compiler could
> determine that all for it itself (maybe even work out for itself
> which need recompiling), would you just ignore that feature and use
> the same auxiliary methods you have always done?
>
> You don't see that the language taking over task (1) of the things
> that makefiles do, and possibly (2) (of the list I posted; repeated
> below), can streamline makefiles to make them shorter, simpler,
> easier to write and to read, and with fewer opportunities to get
> stuff wrong?
>
> That was a rhetorical question. Obviously not.
>
>
> > Perhaps I would find your tools worked for a "Hello, world"
> > project. Maybe they were still okay as it got slightly bigger.
> > Then I'd have something that they could not handle, and I'd reach
> > for make.  What would be the point of using "make" to automate -
> > for example - post-processing of a binary to add a CRC check, but
> > using your tools to handle the build?  It's much easier just to use
> > "make" for the whole thing.
>
>
> Because building one binary is a process should be the job of a
> compiler, not some random external tool that knows nothing of the
> language or compiler.
>
> Maybe you think makefiles should individually list all the 1000s of
> functions of a project too?
>
> > You are offering me a fish.  I am offering to teach you to fish,
> > including where to go to catch different kinds of fish.  This is
> > really a no-brainer choice.
>
> That analogy makes no sense.
>
> Let me try and explain what I do: I write whole-program compilers.
> That means that, each time you do a new build, it will reprocess each
> file from source. They use the language's module scheme to know which
> files to process.
>
> I tend to build C programs by recompiling all modules too. So I want
> to introduce the same convenience I have elsewhere.
>
> It works for me, and I'm sure could work for others if they didn't
> have makefiles forced down their throats and hardwired into their
> brains.
>
> ----------------------------
> (Repost)
>
> I've already covered this in many posts on the subject. But 'make'
> deals with three kinds of requirements:
>
> (1) Specifying what the modules are to be compiled and combined into
> one binary file
>
> (2) Specifying dependences between all files to allow rebuilding of
> that one file with minimal recompilation
>
> (3) Everything else needed in a complex project: running processes to
> generate files file config.h, creating multiple binaries,
> specifying dependencies between binaries, installation etc
>
> My proposal tackles only (1), which is something that many languages
> now have the means to deal with themselves. I already stated that (2)
> is not covered.
>
> But you may still need makefiles to deal with (3).
>
> If your main requirement /is/ only (1), then my idea is to move the
> necessary info into the source code, and tackle it with the C
> compiler.
>

You proposal and needs of David Brown are not necessarily
contradictory.
All you need to do to satisfy him is to add to your compiler an option
for export of dependencies in make-compatible format, i.e. something
very similar to -MD option of gcc.

Then David could write in his makefile:

out/foo.elf : main_foo.c
mcc -MD $< -o $@

-include out/foo.d


Click here to read the complete article
Re: Experimental C Build System

<20240201223647.00002006@yahoo.com>

  copy mid

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

  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: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 22:36:47 +0200
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <20240201223647.00002006@yahoo.com>
References: <up8i91$h6iu$1@dont-email.me>
<up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me>
<up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me>
<upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me>
<updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me>
<upgfog$24m0s$1@dont-email.me>
<upgkij$25lpj$1@dont-email.me>
<seSuN.420645$83n7.76941@fx18.iad>
<upgsoq$274ph$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="7a85e3d856cad5f664ebd31b1a9bf2dc";
logging-data="2341367"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18m/ZH4n1BrTRWTgiiMvSPESpk7xAAIbcw="
Cancel-Lock: sha1:GEOipWYHMyMiZyK0qKc2fwF2qUM=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Thu, 1 Feb 2024 20:36 UTC

On Thu, 1 Feb 2024 19:51:53 +0000
bart <bc@freeuk.com> wrote:

> On 01/02/2024 19:25, Scott Lurndal wrote:
> > bart <bc@freeuk.com> writes:
> >> On 01/02/2024 16:09, Richard Harnden wrote:
> >>> On 31/01/2024 20:25, bart wrote:
> >>>> BTW that 'make' only works on my machine because it happens to
> >>>> be part of mingw; none of my other C compilers have make.
> >>>>
> >>>> And as written, it only works for 'cc' which comes with 'gcc'
> >>>
> >>> Doesn't dos/windows have nmake and cl?
> >>
> >> No.
> >
> > You sure about that? They sure used to have them
> > as an add-on. IIRC, they're still part of visual studio.
>
> Visual Studio is a 10,000MB monster. It might well have it around,
> but it's so complex, it's been years since I've even seen discrete
> cl.exe and link.exe programs, despite scouring massive, 11-deep
> directory structures.
>

If you only download command-line build tools then it's somewhat less
huge.
2022 version is 3,152,365,436 bytes.
I don't know the size of installation package. It looks like on my home
PC I used online installer.

> Meanwhile my everyday compilers are 0.4MB for my language and 0.3MB
> for C.
>
> I like to keep things simple. Everybody else likes to keep things
> complicated, and the more the better.
>
> Anyway, acquiring VS just to build one small program would be like
> just a giant sledgehammer, 1000 times normal size, to crack a tiny
> nut.

Re: Experimental C Build System

<upgvq7$27kba$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 12:43:51 -0800
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <upgvq7$27kba$1@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upgfog$24m0s$1@dont-email.me>
<upgkij$25lpj$1@dont-email.me> <seSuN.420645$83n7.76941@fx18.iad>
<upgsoq$274ph$1@dont-email.me> <upgu0a$278rd$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 20:43:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e5db24bf58349e0f24b4ca76196085dd";
logging-data="2347370"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gln6qm/GC1643t7kxDNhe3oSIkEo9tYY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:3djO2zFtlbGf1T/77yjPTqjNd4I=
In-Reply-To: <upgu0a$278rd$2@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Thu, 1 Feb 2024 20:43 UTC

On 2/1/2024 12:12 PM, Chris M. Thomasson wrote:
> On 2/1/2024 11:51 AM, bart wrote:
>> On 01/02/2024 19:25, Scott Lurndal wrote:
>>> bart <bc@freeuk.com> writes:
>>>> On 01/02/2024 16:09, Richard Harnden wrote:
>>>>> On 31/01/2024 20:25, bart wrote:
>>>>>> BTW that 'make' only works on my machine because it happens to be
>>>>>> part
>>>>>> of mingw; none of my other C compilers have make.
>>>>>>
>>>>>> And as written, it only works for 'cc' which comes with 'gcc'
>>>>>
>>>>> Doesn't dos/windows have nmake and cl?
>>>>
>>>> No.
>>>
>>> You sure about that?  They sure used to have them
>>> as an add-on.  IIRC, they're still part of visual studio.
>>
>> Visual Studio is a 10,000MB monster.
>
> Shit happens. I still use MSVC, quite a lot actually. I install
> everything! ;^) Have the space, so, well, okay. ;^)

The fat bastard wants me to update to version (17.8.6). I currently have
(17.8.5):

:^)

https://youtu.be/t2mU6USTBRE?t=94

Ham On! LOL! ;^)

>
>
>
>> It might well have it around, but it's so complex, it's been years
>> since I've even seen discrete cl.exe and link.exe programs, despite
>> scouring massive, 11-deep directory structures.
>>
>> Meanwhile my everyday compilers are 0.4MB for my language and 0.3MB
>> for C.
>>
>> I like to keep things simple. Everybody else likes to keep things
>> complicated, and the more the better.
>>
>> Anyway, acquiring VS just to build one small program would be like
>> just a giant sledgehammer, 1000 times normal size, to crack a tiny nut.
>

Re: Experimental C Build System

<tzTuN.104491$JLvf.66783@fx44.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx44.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: Experimental C Build System
Newsgroups: comp.lang.c,comp.unix.programmer
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me> <up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me> <upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me> <upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me> <upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me> <upfve3$21uv7$1@dont-email.me> <upgcbm$246u1$1@dont-email.me> <upgo72$26abt$1@dont-email.me> <20240201222328.00006859@yahoo.com>
Lines: 29
Message-ID: <tzTuN.104491$JLvf.66783@fx44.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 01 Feb 2024 20:55:53 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 01 Feb 2024 20:55:53 GMT
X-Received-Bytes: 1904
 by: Scott Lurndal - Thu, 1 Feb 2024 20:55 UTC

Michael S <already5chosen@yahoo.com> writes:
>On Thu, 1 Feb 2024 18:34:08 +0000
>bart <bc@freeuk.com> wrote:
>
>> On 01/02/2024 15:11, David Brown wrote:

>> But you may still need makefiles to deal with (3).
>>=20
>> If your main requirement /is/ only (1), then my idea is to move the=20
>> necessary info into the source code, and tackle it with the C
>> compiler.
>>=20
>
>
>You proposal and needs of David Brown are not necessarily
>contradictory.=20

Although David (and I) aren't particularly interested in
changing something that already works quite well.

>All you need to do to satisfy him is to add to your compiler an option
>for export of dependencies in make-compatible format, i.e. something
>very similar to -MD option of gcc.

I suspect he may be much more difficult to satisfy on this topic.

Nobody is going to switch production software to a one-off
unsupported compiler.

Re: Experimental C Build System

<uph1bl$27tkp$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.chmurka.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 13:10:14 -0800
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <uph1bl$27tkp$1@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me> <upgcbm$246u1$1@dont-email.me>
<upgo72$26abt$1@dont-email.me> <20240201222328.00006859@yahoo.com>
<tzTuN.104491$JLvf.66783@fx44.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 1 Feb 2024 21:10:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e5db24bf58349e0f24b4ca76196085dd";
logging-data="2356889"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BuWZV91aAtBjOX8Y+CTzpa7fu9jKSpgw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:zikM2VOnCvjhgcxxzxYm9xpjuoQ=
In-Reply-To: <tzTuN.104491$JLvf.66783@fx44.iad>
Content-Language: en-US
 by: Chris M. Thomasson - Thu, 1 Feb 2024 21:10 UTC

On 2/1/2024 12:55 PM, Scott Lurndal wrote:
> Michael S <already5chosen@yahoo.com> writes:
>> On Thu, 1 Feb 2024 18:34:08 +0000
>> bart <bc@freeuk.com> wrote:
>>
>>> On 01/02/2024 15:11, David Brown wrote:
>
>>> But you may still need makefiles to deal with (3).
>>> =20
>>> If your main requirement /is/ only (1), then my idea is to move the=20
>>> necessary info into the source code, and tackle it with the C
>>> compiler.
>>> =20
>>
>>
>> You proposal and needs of David Brown are not necessarily
>> contradictory.=20
>
> Although David (and I) aren't particularly interested in
> changing something that already works quite well.
>
>> All you need to do to satisfy him is to add to your compiler an option
>> for export of dependencies in make-compatible format, i.e. something
>> very similar to -MD option of gcc.
>
> I suspect he may be much more difficult to satisfy on this topic.
>
> Nobody is going to switch production software to a one-off
> unsupported compiler.
>

No shit. Even then, he would have to test drive it, make sure it passes
all unit tests, ect... How fun... ;^)

Re: Experimental C Build System

<uph2p7$27uq1$4@dont-email.me>

  copy mid

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

  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: Experimental C Build System
Date: Thu, 1 Feb 2024 21:34:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <uph2p7$27uq1$4@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 21:34:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="292505b1016833b26c02e42290db7d4f";
logging-data="2358081"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195s9lEP2a+YsJ0yBTVTk3G"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:YsIm07PPGEsChPGUUSWjE2gaY7M=
 by: Lawrence D'Oliv - Thu, 1 Feb 2024 21:34 UTC

On Thu, 1 Feb 2024 09:39:15 +0100, David Brown wrote:

> 2. You can compile modules independently to allow partial builds.

In our Comp Sci classes we were careful to draw a distinction between
“separate” and “independent” compilation. The latter is exemplified by
(old-style) Fortran and C, where the same name may be declared in multiple
units, and the linker will happily tie them together, but without any
actual checking that the declarations match.

“Separate” compilation, on the other hand, means that there is some
consistency checking done between the declarations, and the program will
fail to build if there are mismatches. Ada has this. And it looks like
Fortran has acquired it, too, since the Fortran 90 spec.

Re: Experimental C Build System

<uph2pd$2867k$1@dont-email.me>

  copy mid

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

  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: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 22:34:36 +0100
Organization: A noiseless patient Spider
Lines: 209
Message-ID: <uph2pd$2867k$1@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me> <upgcbm$246u1$1@dont-email.me>
<upgo72$26abt$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 21:34:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="fec5a488f4a3c468717d7ef6da7a5412";
logging-data="2365684"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+xxw9j5aDuNcFWvk2RV0PoioIQygRk+Gs="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:HcO7HlIc0FjPPPuEwcfZ7DE5Jms=
Content-Language: en-GB
In-Reply-To: <upgo72$26abt$1@dont-email.me>
 by: David Brown - Thu, 1 Feb 2024 21:34 UTC

On 01/02/2024 19:34, bart wrote:
> On 01/02/2024 15:11, David Brown wrote:
>
>>>> 1. It lets you split the program into separate parts - generally
>>>> separate files.  This is essential for scalability for large programs.
>>>>
>>>> 2. You can compile modules independently to allow partial builds.
>>>>
>>>> 3. Modules generally have some way to specify exported symbols and
>>>> facilities that can be used by other modules.
>>>>
>>>> 4. Modules can "import" other modules, gaining access to those
>>>> modules' exported symbols.
>>>>
>>>> 5. Modules provide encapsulation of data, code and namespaces.
>>>>
>>>> 6. Modules can be used in a hierarchical system, building big
>>>> modules from smaller ones to support larger libraries with many files.
>>>>
>>>> 7. Modules provide a higher level concept that can be used by
>>>> language tools to see how the whole program fits together or
>>>> interact with package managers and librarian tools.
>>>>
>>>>
>>>> C provides 1, 2, 3, and 4 if you use a "file.c/file.h" organisation.
>>>> It provides a limited form of 5 (everything that is not exported is
>>>> "static"), but scaling to larger systems is dependent on identifier
>>>> prefixes.
>>>>
>>>> You seem to be thinking purely about item 7 above.  This is, I
>>>> think, common in interpreted languages (where modules have to be
>>>> found at run-time, where the user is there but the developer is not).
>>> I've been implementing languages with language-supported modules for
>>> about 12 years.
>>>
>>> They generally provide 1, 2, 4, 5, and 7 from your list, and partial
>>> support of 6.
>>
>> Sure.  Programming languages need that if they are to scale at all.
>>
>>>
>>> They don't provide 2 (compiling individual modules) because the aim
>>> is a very fast, whole-program compler.
>>
>> Okay.
>>
>>
>> But what you are talking about to add to C is item 7, nothing more.
>> That is not adding "modules" to C.  Your suggestion might be useful to
>> some people for some projects, but that doesn't make it "modules" in
>> any real sense.
>
> Item 7 is my biggest stumbling to building open source C projects.
>
> While the developer (say you), knows the necessary info, and can somehow
> import into the build system, my job is trying to get it out.
>
> I can't use the intended build system because for one reason or another
> it doesn't work, or requires complex dependencies (MSYS, CMake, MSTOOLS,
> .configure), or I want to run mcc on it.
>
> That info could trivially be added to the C source code. Nobody actually
> needs to use my #pragma scheme; it could simply be a block comment on
> one of the modules.
>
> I'm sure with all your complicated tools, they could surely dump some
> text that looks like:
>
>    // List of source files to build the binary cipher.c:
>    // cipher.c
>    // hmac.c
>    // sha2.c
>
> and prepend it to one of the files.  Even a README will do.
>
> That wouldn't hurt would it?

Complain to the people that made that open source software, not me. But
don't be surprised if they tell you "There's a makefile. It works for
everyone else." Or maybe they will say they can't cater for every
little problem with everyone's unusual computer setup. Maybe they will
try to be helpful, maybe they will be rude and arrogant. Maybe they
will point out that their makefile /is/ just a list of the files needed,
along with the compiler options. Usually projects of any size /do/ have
readme's and build instructions - but some won't.

No matter what, it is not the fault of anyone here, it is not the fault
of "make" or Linux or C, and there is nothing that any of us can do to
help you. (And $DEITY knows, we have tried.)

>>
>> I already have tools for determining dependencies.  What can your
>> methods do that mine can't?
>>
>> (And don't bother saying that you can do it without extra tools -
>> everyone who wants "make" and "gcc" has them on hand.  And those who
>> want an IDE that figures out dependencies for them have a dozen free
>> options there too.  These are all standard tools available to everyone.)
>
> So, if C were to acquire modules, so that a C compiler could determine
> that all for it itself (maybe even work out for itself which need
> recompiling), would you just ignore that feature and use the same
> auxiliary methods you have always done?

That's not unlikely. Why would I change? You still haven't given any
reasons why your tools would be /better/. Even if they could do all I
needed to do for a particular project, "just as good" is not "better",
and does not encourage change.

I would still need "make" for everything else. I would, however, be
quite happy if there were some standard way to get the list of include
files needed by a C file, rather than using gcc-specific flags.

>
> You don't see that the language taking over task (1) of the things that
> makefiles do, and possibly (2) (of the list I posted; repeated below),
> can streamline makefiles to make them shorter, simpler, easier to write
> and to read, and with fewer opportunities to get stuff wrong?
>
> That was a rhetorical question. Obviously not.

I've nothing against shorter or simpler makefiles. But as far as I can
see, you are just moving the same information from a makefile into the C
files.

Indeed, you are duplicating things - now your C files have to have
"#pragma module this, #pragma module that" in addition to having
"#include this.h, #include that.h". With my makefiles, all the "this"
and "that" is found automatically - writing the includes in the C code
is sufficient.

>
>
>> Perhaps I would find your tools worked for a "Hello, world" project.
>> Maybe they were still okay as it got slightly bigger.  Then I'd have
>> something that they could not handle, and I'd reach for make.  What
>> would be the point of using "make" to automate - for example -
>> post-processing of a binary to add a CRC check, but using your tools
>> to handle the build?  It's much easier just to use "make" for the
>> whole thing.
>
>
> Because building one binary is a process should be the job of a
> compiler, not some random external tool that knows nothing of the
> language or compiler.

No, it is the job of the linker. Compiling is the job of the compiler.
Controlling the build is the job of the build system. I don't see
monolithic applications as an advantage.

>
> Maybe you think makefiles should individually list all the 1000s of
> functions of a project too?
>
>> You are offering me a fish.  I am offering to teach you to fish,
>> including where to go to catch different kinds of fish.  This is
>> really a no-brainer choice.
>
> That analogy makes no sense.
>
> Let me try and explain what I do: I write whole-program compilers. That
> means that, each time you do a new build, it will reprocess each file
> from source. They use the language's module scheme to know which files
> to process.

Surely most sensibly organised projects could then be built with :

bcc *.c -o prog.exe

I mean, that's what I can do with gcc if I had something that doesn't
need other flags (which is utterly impractical for my work).

Or if I had lots of files, each with their own c file :

for f in *.c; do gcc $i -o ${f%.c}; done

>
> It works for me, and I'm sure could work for others if they didn't have
> makefiles forced down their throats and hardwired into their brains.

/Nobody/ has makefiles forced on them. People use "make" because it is
convenient, and it works. If something better comes along, and it is
better enough to overcome the familiarity momentum, people will use that.

I do a round of checking the state of the art of build tools on a
regular basis - perhaps every year or so. I look at what's popular and
what's new, to see if there's anything that would work for me and be a
step up from what I have. So far, I've not found anything that comes
very close to "make" for my needs. There's some tools that are pretty
good in many ways, but none that I can see as being a better choice for
me than "make". I am, however, considering CMake (which works at a
higher level, and outputs makefiles, ninja files or other project
files). It appears to have some disadvantages compared to my makefiles,
such as needed to be run as an extra step when files are added or
removed to a project or dependencies are changed, but that doesn't
happen too often, and it's integration with other tools and projects
might make it an overall win. I'll need some time to investigate and
study it.


Click here to read the complete article
Re: Experimental C Build System

<uph305$2867k$2@dont-email.me>

  copy mid

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

  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: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 22:38:13 +0100
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <uph305$2867k$2@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me> <upgcbm$246u1$1@dont-email.me>
<upgo72$26abt$1@dont-email.me> <20240201222328.00006859@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 1 Feb 2024 21:38:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="fec5a488f4a3c468717d7ef6da7a5412";
logging-data="2365684"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/p82UmPh3tI0mWvbEcrbUAJGnsrOi/s4A="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:gPo8VRG2WtRG8VnToFC3siXtBog=
Content-Language: en-GB
In-Reply-To: <20240201222328.00006859@yahoo.com>
 by: David Brown - Thu, 1 Feb 2024 21:38 UTC

On 01/02/2024 21:23, Michael S wrote:
> On Thu, 1 Feb 2024 18:34:08 +0000

>> I've already covered this in many posts on the subject. But 'make'
>> deals with three kinds of requirements:
>>
>> (1) Specifying what the modules are to be compiled and combined into
>> one binary file
>>
>> (2) Specifying dependences between all files to allow rebuilding of
>> that one file with minimal recompilation
>>
>> (3) Everything else needed in a complex project: running processes to
>> generate files file config.h, creating multiple binaries,
>> specifying dependencies between binaries, installation etc
>>
>> My proposal tackles only (1), which is something that many languages
>> now have the means to deal with themselves. I already stated that (2)
>> is not covered.
>>
>> But you may still need makefiles to deal with (3).
>>
>> If your main requirement /is/ only (1), then my idea is to move the
>> necessary info into the source code, and tackle it with the C
>> compiler.
>>
>
>
> You proposal and needs of David Brown are not necessarily
> contradictory.
> All you need to do to satisfy him is to add to your compiler an option
> for export of dependencies in make-compatible format, i.e. something
> very similar to -MD option of gcc.
>
> Then David could write in his makefile:
>
> out/foo.elf : main_foo.c
> mcc -MD $< -o $@
>
> -include out/foo.d
>
> And then to proceed with automatiion of his pre and post-processing needs.
>

But then I'd still be using "make", and Bart would not be happy.

And "gcc -MD" does not need any extra #pragmas, so presumably neither
would an implementation of that feature in bcc (or mcc or whatever). So
Bart's new system would disappear entirely.

Re: Experimental C Build System

<uph32s$27uq1$5@dont-email.me>

  copy mid

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

  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: Experimental C Build System
Date: Thu, 1 Feb 2024 21:39:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <uph32s$27uq1$5@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeddh$1mjib$2@dont-email.me> <upfltd$2051d$1@dont-email.me>
<87cytgq81b.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 21:39:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="292505b1016833b26c02e42290db7d4f";
logging-data="2358081"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TUjKUkWG9BYF1noAO7yxS"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:Vc+EC5MPTAzP6npvIriiRaB3qV0=
 by: Lawrence D'Oliv - Thu, 1 Feb 2024 21:39 UTC

On Thu, 01 Feb 2024 11:49:36 -0800, Keith Thompson wrote:

> David Brown <david.brown@hesbynett.no> writes:
>
>> I'd rather "make -j" (without a number) defaulted to using the number
>> of cpu cores, as that is a reasonable guess for most compilations.
>
> Agreed, but there might not be a sufficiently portable way to determine
> that number.

nproc(1) is part of the GNU Core Utilities
<manpages.debian.org/1/nproc.1.html>.

Re: Experimental C Build System

<uph4rc$28ebd$3@dont-email.me>

  copy mid

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

  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: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 23:09:48 +0100
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <uph4rc$28ebd$3@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upgfog$24m0s$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 1 Feb 2024 22:09:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="fec5a488f4a3c468717d7ef6da7a5412";
logging-data="2373997"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18k7TnpxK2VnQe3lhC5fQa/K8fL0V7Bdsg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:qC3ugdz1AL8dsPWGfKpLXIjutS4=
In-Reply-To: <upgfog$24m0s$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Thu, 1 Feb 2024 22:09 UTC

On 01/02/2024 17:09, Richard Harnden wrote:
> On 31/01/2024 20:25, bart wrote:
>> BTW that 'make' only works on my machine because it happens to be part
>> of mingw; none of my other C compilers have make.
>>
>> And as written, it only works for 'cc' which comes with 'gcc'
>
> Doesn't dos/windows have nmake and cl?

Those are part of MSVC, which runs on Windows but does not come with it.
"nmake" is MS's version of "make", and has been shipped with most MS
development tools for many decades.

Re: Experimental C Build System

<uph53d$28ebd$4@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!nntp.comgw.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,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 23:14:05 +0100
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <uph53d$28ebd$4@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeddh$1mjib$2@dont-email.me> <upfltd$2051d$1@dont-email.me>
<87cytgq81b.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 1 Feb 2024 22:14:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="fec5a488f4a3c468717d7ef6da7a5412";
logging-data="2373997"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19sRW586f0m3TTnbrV0yJjyn3uJ3PzABg4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:QlN3iA95Qnhr9bs/9VMd5oaRV4s=
In-Reply-To: <87cytgq81b.fsf@nosuchdomain.example.com>
Content-Language: en-GB
 by: David Brown - Thu, 1 Feb 2024 22:14 UTC

On 01/02/2024 20:49, Keith Thompson wrote:
> David Brown <david.brown@hesbynett.no> writes:
> [...]
>> I'd rather "make -j" (without a number) defaulted to using the number
>> of cpu cores, as that is a reasonable guess for most compilations.
>
> Agreed, but there might not be a sufficiently portable way to determine
> that number.
>

gcc manages to figure it out for parallel tasks, such as LTO linking. I
think it would be reasonable enough to have it use the number of cores
when it was able to figure it out, and a default (say, 4) when it could not.

Re: Experimental C Build System

<uph5vq$28mbj$1@dont-email.me>

  copy mid

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

  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: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 1 Feb 2024 22:29:13 +0000
Organization: A noiseless patient Spider
Lines: 176
Message-ID: <uph5vq$28mbj$1@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me> <upgcbm$246u1$1@dont-email.me>
<upgo72$26abt$1@dont-email.me> <uph2pd$2867k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 22:29:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19d35866713dfba03207e755d1c79dd1";
logging-data="2382195"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vpbRJkIxQwcyqpUTcypP95+zvKTQCaLI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:pg4v8/znfl1L+PkPT00fwSgbOOA=
In-Reply-To: <uph2pd$2867k$1@dont-email.me>
Content-Language: en-GB
 by: bart - Thu, 1 Feb 2024 22:29 UTC

On 01/02/2024 21:34, David Brown wrote:
> On 01/02/2024 19:34, bart wrote:

>> You don't see that the language taking over task (1) of the things
>> that makefiles do, and possibly (2) (of the list I posted; repeated
>> below), can streamline makefiles to make them shorter, simpler, easier
>> to write and to read, and with fewer opportunities to get stuff wrong?
>>
>> That was a rhetorical question. Obviously not.
>
> I've nothing against shorter or simpler makefiles.  But as far as I can
> see, you are just moving the same information from a makefile into the C
> files.
>
> Indeed, you are duplicating things - now your C files have to have
> "#pragma module this, #pragma module that" in addition to having
> "#include this.h, #include that.h".  With my makefiles, all the "this"
> and "that" is found automatically - writing the includes in the C code
> is sufficient.

I don't think so. Seeing:

#include "file.h"

doesn't necessarily mean there is a matching "file.c". It might not
exist, or the header might be for some external library, or maybe it
does exist but in a different location.

Or maybe some code may use a file "fred.c", which needs to be submitted
to the compiler, but for which there is either no header used, or uses a
header file with a different name.

As I said, C's uses of .h and .c files are chaotic.

Did you have in mind using gcc's -MM option? For my 'cipher.c' demo,
that only gives a set of header names. Missing are hmac.c and sha2.c.

If I try it on lua.c, it gives me only 5 header files; the project
comprises 33 .c files and 27 .h files.

>>
>>
>>> Perhaps I would find your tools worked for a "Hello, world" project.
>>> Maybe they were still okay as it got slightly bigger.  Then I'd have
>>> something that they could not handle, and I'd reach for make.  What
>>> would be the point of using "make" to automate - for example -
>>> post-processing of a binary to add a CRC check, but using your tools
>>> to handle the build?  It's much easier just to use "make" for the
>>> whole thing.
>>
>>
>> Because building one binary is a process should be the job of a
>> compiler, not some random external tool that knows nothing of the
>> language or compiler.
>
> No, it is the job of the linker.

There is where you're still stuck in the past.

I first got rid of a formal 'linker' about 40 years ago. I got rid of
the notion of combining independently compiled modules into an
executable a decade ago.

Linking would only come up for me if I wanted to statically combine the
outputs of several languages. Since I can't process object files, I need
to generate an object file (in my case, it represents ALL my modules),
and a traditional linker. That would be someone else's job.

>  Compiling is the job of the compiler.
> Controlling the build is the job of the build system.  I don't see
> monolithic applications as an advantage.

I do. You type:

cc prog

without knowing or caring whether the contains that one module, or there
are 99 more.

In any case, your linker will generate a monolithic binary whether you
like it or not.

But I suspect you don't understand what a 'whole-program compiler' does:

* It means that for each binary, all sources are recompiled at the same
time to create it

* It doesn't mean that an application can only comprise one binary

* It moves the compilation unit granularity from a module to a single
EXE or DLL file

* Interfaces (in the case of a lower level language), are moved inter-
module to inter-program. The boundaries are between one program or
library and another, not between modules.

A language which claims to have a module system, but still compiles a
module at a time, will probably still have discrete inter-module
interfaces, although they may be handled automatically.

>>
>> Maybe you think makefiles should individually list all the 1000s of
>> functions of a project too?
>>
>>> You are offering me a fish.  I am offering to teach you to fish,
>>> including where to go to catch different kinds of fish.  This is
>>> really a no-brainer choice.
>>
>> That analogy makes no sense.
>>
>> Let me try and explain what I do: I write whole-program compilers.
>> That means that, each time you do a new build, it will reprocess each
>> file from source. They use the language's module scheme to know which
>> files to process.
>
> Surely most sensibly organised projects could then be built with :
>
>     bcc *.c -o prog.exe
>
> I mean, that's what I can do with gcc if I had something that doesn't
> need other flags (which is utterly impractical for my work).

Yes, that's one technique that can be used. But few projects are like
that one. One or two, you can try *.c and it will work.

Malcolm's resource compiler is like that, but it still benefits from a
file like this:

#pragma module "*.c"
#pragma module "freetype/*.c"
#pragma module "samplerate/*.c"

here called bbx.c. I can build it like this:

c:\bbx\src>mcc bbx
Compiling bbx.c to bbx.exe

> /Nobody/ has makefiles forced on them.  People use "make" because it is
> convenient, and it works.

BUT IT DOESN'T. It fails a lot of the time on Windows, but they are too
complicated to figure out why. From a recent thread I made about trying
to build piet.c, it failed on extra programs that weren't needed (that
was on Linux; it didn't work at all on Windows).

This is a program which actually only needed:

cc piet.c

(Here cc *.c wouldn't work.) This mirrors pretty much what I see in most
C projects; needless complexity that muddies the waters and creates
failures.

ALL I WANT IS A LIST OF FILES. Why doesn't anybody get that? And why is
it so hard?

Apparently makefiles are superior because you don't even need to know
the name of the program (and will have to hunt for where it put the
executable because it won't tell you!).

> But I have no interest in changing to something vastly more limited and
> which adds nothing at all.

That's right; it adds nothing, but it takes a lot away! Like a lot of
failure points.

(Look at the Monty Hall problem, but instead of 3 doors, try it with
100, of which 98 will be opened. Then it will easy to make the right
decision because nearly all the wrong ones have been eliminated.)

Re: Experimental C Build System

<20240202005538.000054ff@yahoo.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Fri, 2 Feb 2024 00:55:38 +0200
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <20240202005538.000054ff@yahoo.com>
References: <up8i91$h6iu$1@dont-email.me>
<up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me>
<up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me>
<upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me>
<updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me>
<upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me>
<upgcbm$246u1$1@dont-email.me>
<upgo72$26abt$1@dont-email.me>
<20240201222328.00006859@yahoo.com>
<uph305$2867k$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="7a85e3d856cad5f664ebd31b1a9bf2dc";
logging-data="2383792"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3TCjfJuNKrk0NBBv6yKNO8d0W4gvJX7M="
Cancel-Lock: sha1:gJlGR/XeJTvor43QAwnmgbN2R2k=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Thu, 1 Feb 2024 22:55 UTC

On Thu, 1 Feb 2024 22:38:13 +0100
David Brown <david.brown@hesbynett.no> wrote:

> On 01/02/2024 21:23, Michael S wrote:
> > On Thu, 1 Feb 2024 18:34:08 +0000
>
> >> I've already covered this in many posts on the subject. But 'make'
> >> deals with three kinds of requirements:
> >>
> >> (1) Specifying what the modules are to be compiled and combined
> >> into one binary file
> >>
> >> (2) Specifying dependences between all files to allow rebuilding of
> >> that one file with minimal recompilation
> >>
> >> (3) Everything else needed in a complex project: running processes
> >> to generate files file config.h, creating multiple binaries,
> >> specifying dependencies between binaries, installation etc
> >>
> >> My proposal tackles only (1), which is something that many
> >> languages now have the means to deal with themselves. I already
> >> stated that (2) is not covered.
> >>
> >> But you may still need makefiles to deal with (3).
> >>
> >> If your main requirement /is/ only (1), then my idea is to move the
> >> necessary info into the source code, and tackle it with the C
> >> compiler.
> >>
> >
> >
> > You proposal and needs of David Brown are not necessarily
> > contradictory.
> > All you need to do to satisfy him is to add to your compiler an
> > option for export of dependencies in make-compatible format, i.e.
> > something very similar to -MD option of gcc.
> >
> > Then David could write in his makefile:
> >
> > out/foo.elf : main_foo.c
> > mcc -MD $< -o $@
> >
> > -include out/foo.d
> >
> > And then to proceed with automatiion of his pre and post-processing
> > needs.
>
> But then I'd still be using "make", and Bart would not be happy.
>
> And "gcc -MD" does not need any extra #pragmas, so presumably neither
> would an implementation of that feature in bcc (or mcc or whatever).
> So Bart's new system would disappear entirely.
>
>
>

Bart spares you from managing list(s) of objects in your makefile and
from writing arcan helper macros.
Yes, I know, you copy&past arcan macros from project to project, but
you had to write them n years ago and that surely was not easy.

Re: Experimental C Build System

<87v877py3z.fsf@nosuchdomain.example.com>

  copy mid

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

  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: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 01 Feb 2024 15:24:00 -0800
Organization: None to speak of
Lines: 24
Message-ID: <87v877py3z.fsf@nosuchdomain.example.com>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeddh$1mjib$2@dont-email.me> <upfltd$2051d$1@dont-email.me>
<87cytgq81b.fsf@nosuchdomain.example.com>
<uph32s$27uq1$5@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a25c07b6296b5291e04aff5e5cd7fea7";
logging-data="2399041"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Y/KxC4wKdjZFpF4RqgvXI"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:xtW/pGhe/E5WRkrya0tbabu7Tgc=
sha1:jMKCWUoSm1kagYIcz0kcTOWa+Ek=
 by: Keith Thompson - Thu, 1 Feb 2024 23:24 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Thu, 01 Feb 2024 11:49:36 -0800, Keith Thompson wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>>> I'd rather "make -j" (without a number) defaulted to using the number
>>> of cpu cores, as that is a reasonable guess for most compilations.
>>
>> Agreed, but there might not be a sufficiently portable way to determine
>> that number.
>
> nproc(1) is part of the GNU Core Utilities
> <manpages.debian.org/1/nproc.1.html>.

And GNU make is not, so it's possible that a system might have make but
not nproc. Also, nproc was added to GNU Coreutils in 2009, and the
current meaning of "make -j" with no numeric argument was defined before
that.

A new "-J" option that means "-j $(nproc)" might be useful, but it's
easy enough to use "make -j $(nproc)".

--
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: Experimental C Build System

<87r0hvpxx8.fsf@nosuchdomain.example.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.chmurka.net!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,comp.unix.programmer
Subject: Re: Experimental C Build System
Date: Thu, 01 Feb 2024 15:28:03 -0800
Organization: None to speak of
Lines: 20
Message-ID: <87r0hvpxx8.fsf@nosuchdomain.example.com>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me> <upgcbm$246u1$1@dont-email.me>
<upgo72$26abt$1@dont-email.me> <uph2pd$2867k$1@dont-email.me>
<uph5vq$28mbj$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a25c07b6296b5291e04aff5e5cd7fea7";
logging-data="2399041"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fLB4DYQ8/HLd/5V/Jm7RS"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:3CUgM3yKc6LLTjgoSx/56zHbMag=
sha1:c6XVj36mJ2UaQObqFCRuq9MAnoA=
 by: Keith Thompson - Thu, 1 Feb 2024 23:28 UTC

bart <bc@freeuk.com> writes:
[...]
> As I said, C's uses of .h and .c files are chaotic.

C doesn't use .h and .c files. The C standard doesn't specify file
extensions, either for source files or for files included with #include.

It's fairly straightforward to implement something similar to "modules"
in C, using matching *.h and *.c files, include guards, and so forth,
but it requires a bit of discipline. It's a mechanism built on top of
the language, not a feature of the language itself (though of course the
language definition intentionally supports that usage).

Some projects might use .h and .c files in a chaotic manner. Most, in
my experience, do not.

--
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: Experimental C Build System

<uph9i5$2916e$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.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: Experimental C Build System
Date: Thu, 1 Feb 2024 23:30:14 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <uph9i5$2916e$2@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me> <upgcbm$246u1$1@dont-email.me>
<upgo72$26abt$1@dont-email.me> <uph2pd$2867k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 23:30:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2132941f276938b37dd44911619c6d41";
logging-data="2393294"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186RoQPEHiSBkWfJE6bM7Mo"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:FJ0HWcpxn3AHeQsp6PqyarnfTJg=
 by: Lawrence D'Oliv - Thu, 1 Feb 2024 23:30 UTC

On Thu, 1 Feb 2024 22:34:36 +0100, David Brown wrote:

> I am, however, considering CMake (which works at a
> higher level, and outputs makefiles, ninja files or other project
> files).

Ninja was created as an alternative to Make. Basically, if your Makefiles
are going to be generated by a meta-build system like CMake or Meson, then
they don’t need to support the kinds of niceties that facilitate writing
them by hand. So you strip it write down to the bare-bones functionality,
which makes your builds fast while consuming minimal resources, and that
is Ninja.

> It appears to have some disadvantages compared to my makefiles,
> such as needed to be run as an extra step when files are added or
> removed to a project or dependencies are changed, but that doesn't
> happen too often, and it's integration with other tools and projects
> might make it an overall win.

Some are proposing Meson as an alternative to CMake. I think they are
saying that the fact that its scripting language is not fully Turing-
equivalent is an advantage.

Me, while I think the CMake language can be a little clunky in places, I
still think having Turing-equivalence is better than not having it. ;)

Re: Experimental C Build System

<uph9ko$2916e$3@dont-email.me>

  copy mid

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

  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: Experimental C Build System
Date: Thu, 1 Feb 2024 23:31:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <uph9ko$2916e$3@dont-email.me>
References: <up8i91$h6iu$1@dont-email.me> <up9hh3$m75n$3@dont-email.me>
<up9kc7$mkt1$2@dont-email.me> <up9uuj$rmmf$2@dont-email.me>
<upanta$vkgm$1@dont-email.me> <upb9ca$12je5$1@dont-email.me>
<upbi8o$14443$1@dont-email.me> <updt7h$1jc8a$1@dont-email.me>
<upeab3$1m2f4$1@dont-email.me> <upflbj$202rb$1@dont-email.me>
<upfve3$21uv7$1@dont-email.me> <upgcbm$246u1$1@dont-email.me>
<upgo72$26abt$1@dont-email.me> <20240201222328.00006859@yahoo.com>
<uph305$2867k$2@dont-email.me> <20240202005538.000054ff@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 1 Feb 2024 23:31:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2132941f276938b37dd44911619c6d41";
logging-data="2393294"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JhRvMWtGIxSFgCuHCdiXM"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:mKGjZQLpTJA4sI+oRJ2eTl6amQ4=
 by: Lawrence D'Oliv - Thu, 1 Feb 2024 23:31 UTC

On Fri, 2 Feb 2024 00:55:38 +0200, Michael S wrote:

> Yes, I know, you copy&past arcan macros from project to project, but you
> had to write them n years ago and that surely was not easy.

And maybe you discover bugs in them in certain situations, and have to
track down all the places you copied/pasted them and fix them.

My code-reuse OCD reflex is twitching at this point.


devel / comp.lang.c / Re: Experimental C Build System

Pages:1234567891011121314151617
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor