Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

I have not yet begun to byte!


devel / comp.lang.c / Re: Universal Build System for C

SubjectAuthor
* Universal Build System for CThiago Adams
+- Re: Universal Build System for CBranimir Maksimovic
+* Re: Universal Build System for Cfir
|`* Re: Universal Build System for Cfir
| `* Re: Universal Build System for Cfir
|  `- Re: Universal Build System for Cfir
+* Re: Universal Build System for CGuillaume
|`- Re: Universal Build System for CThiago Adams
+* Re: Universal Build System for CBart
|`* Re: Universal Build System for CThiago Adams
| `* Re: Universal Build System for CThiago Adams
|  `* Re: Universal Build System for CKeith Thompson
|   `* Re: Universal Build System for CThiago Adams
|    +* Re: Universal Build System for CKeith Thompson
|    |+* Re: Universal Build System for CThiago Adams
|    ||`* Re: Universal Build System for CBen Bacarisse
|    || `- Re: Universal Build System for CThiago Adams
|    |+* Re: Universal Build System for CBart
|    ||`* Re: Universal Build System for CMalcolm McLean
|    || `- Re: Universal Build System for CBart
|    |`* Re: Universal Build System for CScott Lurndal
|    | `- 8-bit ASCII (was Re: Universal Build System for C)Scott Lurndal
|    +* Re: Universal Build System for CBart
|    |`* Re: Universal Build System for CThiago Adams
|    | `* Re: Universal Build System for CThiago Adams
|    |  `* Re: Universal Build System for CKeith Thompson
|    |   `* Re: Universal Build System for CDavid Brown
|    |    `* Re: Universal Build System for CThiago Adams
|    |     `- Re: Universal Build System for CDavid Brown
|    `* Re: Universal Build System for CLew Pitcher
|     `- Re: Universal Build System for CThiago Adams
`* Re: Universal Build System for CThiago Adams
 `* Re: Universal Build System for CBen Bacarisse
  +* Re: Universal Build System for CKeith Thompson
  |+* Re: Universal Build System for CBart
  ||`* Re: Universal Build System for CScott Lurndal
  || `* Re: Universal Build System for CBart
  ||  `* Re: Universal Build System for CThiago Adams
  ||   +* Re: Universal Build System for CLew Pitcher
  ||   |`* Re: Universal Build System for CKenny McCormack
  ||   | +* Re: Universal Build System for CKaz Kylheku
  ||   | |+- Re: Universal Build System for CChris M. Thomasson
  ||   | |`* Re: Universal Build System for CBart
  ||   | | +- Re: Universal Build System for CChris M. Thomasson
  ||   | | +- Re: Universal Build System for CChris M. Thomasson
  ||   | | `- Re: Universal Build System for CIl Dottore
  ||   | `* Re: Universal Build System for CLew Pitcher
  ||   |  `- ASCII art (Was: Universal Build System for C)Kenny McCormack
  ||   `- Re: Universal Build System for CThiago Adams
  |`- Re: Universal Build System for CScott Lurndal
  `* Re: Universal Build System for CThiago Adams
   `- Re: Universal Build System for CBen Bacarisse

Pages:123
Universal Build System for C

<933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:4744:: with SMTP id k4mr12721389qtp.247.1633350836181;
Mon, 04 Oct 2021 05:33:56 -0700 (PDT)
X-Received: by 2002:a37:48c:: with SMTP id 134mr9194756qke.233.1633350835901;
Mon, 04 Oct 2021 05:33:55 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 4 Oct 2021 05:33:55 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=189.6.249.78; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 189.6.249.78
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
Subject: Universal Build System for C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Mon, 04 Oct 2021 12:33:56 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 141
 by: Thiago Adams - Mon, 4 Oct 2021 12:33 UTC

In 2020 we had a topic here talking about build systems.
https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ

The idea of having a standard way to generate the executable/lib
was in my mind since the previous topics like the one we talked about
"#pragma source" being a way to find source code needed for compilation
in a standard way.

My idea was split the problem in two

1) Generate code from source (something standard in all compilers, descriptive)
2) Everything else (script to sign code, publish, generate installer etc)
some imperative script language.

At some point Bart said:

"Since this is for C, why not use C itself for the 'script' language? At
least it will be portable to the same targets as the program that is
being built. And since a C compiler is already needed, it won't
introduce another dependency."

This was a great advice!
Bart also posted a sample
(https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/6k501ZBzBwAJ)
where he created a build for lua concatenating strings and options and
them calling the compiler using system.

I have been using a "build script in C" for some months now I am really
happy with it!

The main idea still the same but I am not using dynamic string concatenation
and I auto detect the compiler/platform when I use the same compiler that
generates the build script and target.
This is very handy! I don't need/want anymore any "standard way to compile"
or any universal script. I am pretty happy with the way we can do this today.

This is the basic build script

#define SOURCE_FILES " file1.c " \
" file2.c "

int main()
{

#if defined(_WIN32) && defined(_MSC_VER) && !defined(__clang__)

#define VC_DEBUG_OPTIONS " /Od /MDd /RTC1 "
#define VC_RELEASE_OPTIONS " /GL /Gy /O2 /MD "
#define VC_COMMON_OPTIONS " /permissive- /GS /Zc:preprocessor- /std:c17 /W4 /Zc:wchar_t /Zi /Gm- /sdl /Zc:inline /fp:precise /errorReport:prompt /WX /Zc:forScope /Gd /Oy- /FC /EHsc /nologo /diagnostics:column "

/*
* cl build.c & build
*/

if (system("cl "
SOURCE_FILES
VC_RELEASE_OPTIONS
" -D_CRT_SECURE_NO_WARNINGS "
" -o output_file.exe") != 0) exit(1);

#elif defined(_WIN32) && defined(__clang__)

/*
* clang build.c -o build.exe & build
*/

system("clang "
SOURCE_FILES
" -D_CRT_SECURE_NO_WARNINGS "
" -std=c17 "
" -D_MT "
" -Xlinker /NODEFAULTLIB "
" -lucrt.lib -lvcruntime.lib -lmsvcrt.lib "
" -lKernel32.lib -lUser32.lib -lAdvapi32.lib"
" -luuid.lib -lWs2_32.lib -lRpcrt4.lib -lBcrypt.lib "
" -o output_file.exe");

#elif defined(__linux__) && defined(__clang__)

/*
* clang build.c -o build ; ./build
*/
system("clang "
SOURCE_FILES
" -D_CRT_SECURE_NO_WARNINGS "
" -std=c17 "
" -Wall "
" -o output_file");

#elif defined(__linux__) && defined(__GNUC__)

/*
* gcc build.c -o build ; ./build
*/
system("gcc -Wall"
SOURCE_FILES
" -DNDEBUG"
" -o output_file");

#else
#error Unknown Platform/Compiler
#endif

}

Let's say I want to publish a lib/executable with source.

This are the instructions:

For windows:

Open VC++ command prompt and type.

cl build.c & build

or (if you want clang)

clang build.c -o build.exe & build

for linux:

gcc build.c -o build ; ./build

or

clang build.c -o build ; ./build

- Nothing extra to install
- Multiplatform
- We can debug or create complex logic using C
- etc..

I am still using normal VC++ build during the development
but I am using this script to create the final executable
to create/rum unit tests etc..

I recommend this approach.

Re: Universal Build System for C

<XsF6J.144278$rl3.130460@fx45.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!news.uzoreto.com!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx45.iad.POSTED!not-for-mail
Newsgroups: comp.lang.c
From: branimir...@icloud.com (Branimir Maksimovic)
Subject: Re: Universal Build System for C
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
User-Agent: slrn/1.0.3 (Darwin)
Lines: 20
Message-ID: <XsF6J.144278$rl3.130460@fx45.iad>
X-Complaints-To: abuse@usenet-news.net
NNTP-Posting-Date: Mon, 04 Oct 2021 15:54:31 UTC
Organization: usenet-news.net
Date: Mon, 04 Oct 2021 15:54:31 GMT
X-Received-Bytes: 1215
 by: Branimir Maksimovic - Mon, 4 Oct 2021 15:54 UTC

On 2021-10-04, Thiago Adams <thiago.adams@gmail.com> wrote:
>
> In 2020 we had a topic here talking about build systems.
> https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
>
> The idea of having a standard way to generate the executable/lib
> was in my mind since the previous topics like the one we talked about
> "#pragma source" being a way to find source code needed for compilation
> in a standard way.
>
> I recommend this approach.
Thanks, I'll try.>

--

7-77-777
Evil Sinner!
to weak you should be meek, and you should brainfuck stronger
https://github.com/rofl0r/chaos-pp

Re: Universal Build System for C

<bb3abf59-2772-4317-b970-a2653f8be291n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:4111:: with SMTP id q17mr9906784qtl.407.1633364782363; Mon, 04 Oct 2021 09:26:22 -0700 (PDT)
X-Received: by 2002:a05:622a:1a1a:: with SMTP id f26mr14268383qtb.119.1633364782147; Mon, 04 Oct 2021 09:26:22 -0700 (PDT)
Path: rocksolid2!news.neodome.net!feeder.usenet.ee!2.eu.feeder.erje.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 4 Oct 2021 09:26:21 -0700 (PDT)
In-Reply-To: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.121; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.121
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bb3abf59-2772-4317-b970-a2653f8be291n@googlegroups.com>
Subject: Re: Universal Build System for C
From: profesor...@gmail.com (fir)
Injection-Date: Mon, 04 Oct 2021 16:26:22 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 16
 by: fir - Mon, 4 Oct 2021 16:26 UTC

poniedziałek, 4 października 2021 o 14:34:03 UTC+2 Thiago Adams napisał(a):
> In 2020 we had a topic here talking about build systems.
> https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
>
> The idea of having a standard way to generate the executable/lib
> was in my mind since the previous topics like the one we talked about
> "#pragma source" being a way to find source code needed for compilation
> in a standard way.
>
many make build systems and many, i guess, would like to see them universal

c is language that dont support itself a clean building and it is another flaw of this great language.. i think if i could gather myself to say few words on this..

Re: Universal Build System for C

<7a04d30c-49de-4100-8b39-1595ef090a43n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:7778:: with SMTP id h24mr14529435qtu.265.1633366056566;
Mon, 04 Oct 2021 09:47:36 -0700 (PDT)
X-Received: by 2002:a37:a64b:: with SMTP id p72mr10779379qke.459.1633366056404;
Mon, 04 Oct 2021 09:47:36 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 4 Oct 2021 09:47:36 -0700 (PDT)
In-Reply-To: <bb3abf59-2772-4317-b970-a2653f8be291n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.158; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.158
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com> <bb3abf59-2772-4317-b970-a2653f8be291n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7a04d30c-49de-4100-8b39-1595ef090a43n@googlegroups.com>
Subject: Re: Universal Build System for C
From: profesor...@gmail.com (fir)
Injection-Date: Mon, 04 Oct 2021 16:47:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Mon, 4 Oct 2021 16:47 UTC

poniedziałek, 4 października 2021 o 18:26:29 UTC+2 fir napisał(a):
> poniedziałek, 4 października 2021 o 14:34:03 UTC+2 Thiago Adams napisał(a):
> > In 2020 we had a topic here talking about build systems.
> > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
> >
> > The idea of having a standard way to generate the executable/lib
> > was in my mind since the previous topics like the one we talked about
> > "#pragma source" being a way to find source code needed for compilation
> > in a standard way.
> >
> many make build systems and many, i guess, would like to see them universal
>
> c is language that dont support itself a clean building and it is another flaw of this great language.. i think if i could gather myself to say few words on this..

may say soem in short

c has a flaw which is it dont support the way of expresing of cohesion of its code pieces which can be used to build monolitic outcome piece... i mean there is a need to express this cohesion on source pieces and another express the cohesion to non source pieces which may be redistrubuables or expected to be present

i think best way (at least in some way) would be to add it on source level amking no another kind of blot is to be needed..i think this should work like that that if you press enter on code pieces its gets compiled and if you press somethink like alt+enter there is a check of integrity - if all dependant pieces are present (yawn)

Re: Universal Build System for C

<6043173d-920a-43f3-a64f-82f722f6f383n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:9586:: with SMTP id x128mr11363389qkd.49.1633367617056;
Mon, 04 Oct 2021 10:13:37 -0700 (PDT)
X-Received: by 2002:a05:622a:1993:: with SMTP id u19mr14695970qtc.168.1633367616871;
Mon, 04 Oct 2021 10:13:36 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 4 Oct 2021 10:13:36 -0700 (PDT)
In-Reply-To: <7a04d30c-49de-4100-8b39-1595ef090a43n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.158; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.158
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<bb3abf59-2772-4317-b970-a2653f8be291n@googlegroups.com> <7a04d30c-49de-4100-8b39-1595ef090a43n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6043173d-920a-43f3-a64f-82f722f6f383n@googlegroups.com>
Subject: Re: Universal Build System for C
From: profesor...@gmail.com (fir)
Injection-Date: Mon, 04 Oct 2021 17:13:37 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Mon, 4 Oct 2021 17:13 UTC

poniedziałek, 4 października 2021 o 18:47:45 UTC+2 fir napisał(a):
> poniedziałek, 4 października 2021 o 18:26:29 UTC+2 fir napisał(a):
> > poniedziałek, 4 października 2021 o 14:34:03 UTC+2 Thiago Adams napisał(a):
> > > In 2020 we had a topic here talking about build systems.
> > > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
> > >
> > > The idea of having a standard way to generate the executable/lib
> > > was in my mind since the previous topics like the one we talked about
> > > "#pragma source" being a way to find source code needed for compilation
> > > in a standard way.
> > >
> > many make build systems and many, i guess, would like to see them universal
> >
> > c is language that dont support itself a clean building and it is another flaw of this great language.. i think if i could gather myself to say few words on this..
> may say soem in short
>
> c has a flaw which is it dont support the way of expresing of cohesion of its code pieces which can be used to build monolitic outcome piece... i mean there is a need to express this cohesion on source pieces and another express the cohesion to non source pieces which may be redistrubuables or expected to be present
>
> i think best way (at least in some way) would be to add it on source level amking no another kind of blot is to be needed..i think this should work like that that if you press enter on code pieces its gets compiled and if you press somethink like alt+enter there is a check of integrity - if all dependant pieces are present (yawn)

im not quite sure but possibly one keyword or one pragma is needed, there is just need to put expected/needed pieces in that keyword or pragma and that is all

main.c:

uses add.c, kernel.dll, some.bmp

int main()
{ //...........
}

not to say that it looks good but and should be like that, more as illustration how to include this cohesion data - and probably that is all needed as build system ...im not 100 % sure though

Re: Universal Build System for C

<sjfeqo$i0c$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!i2pn.org!aioe.org!PEYapGefI5ARqVZFhFUmuA.user.46.165.242.75.POSTED!not-for-mail
From: mess...@bottle.org (Guillaume)
Newsgroups: comp.lang.c
Subject: Re: Universal Build System for C
Date: Mon, 4 Oct 2021 19:49:11 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sjfeqo$i0c$1@gioia.aioe.org>
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="18444"; posting-host="PEYapGefI5ARqVZFhFUmuA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: fr
 by: Guillaume - Mon, 4 Oct 2021 17:49 UTC

Le 04/10/2021 à 14:33, Thiago Adams a écrit :
>
> In 2020 we had a topic here talking about build systems.
> https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
>
> The idea of having a standard way to generate the executable/lib
> was in my mind since the previous topics like the one we talked about
> "#pragma source" being a way to find source code needed for compilation
> in a standard way.

There are more build tools these days that you can think of.
Why yet another one?

Re: Universal Build System for C

<f177c17c-3742-4785-b4ba-57dbdc2fb9d6n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:6889:: with SMTP id m9mr14955609qtq.138.1633370455511;
Mon, 04 Oct 2021 11:00:55 -0700 (PDT)
X-Received: by 2002:ad4:4aa2:: with SMTP id i2mr23597065qvx.0.1633370455205;
Mon, 04 Oct 2021 11:00:55 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 4 Oct 2021 11:00:55 -0700 (PDT)
In-Reply-To: <sjfeqo$i0c$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=189.6.249.78; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 189.6.249.78
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com> <sjfeqo$i0c$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f177c17c-3742-4785-b4ba-57dbdc2fb9d6n@googlegroups.com>
Subject: Re: Universal Build System for C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Mon, 04 Oct 2021 18:00:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Thiago Adams - Mon, 4 Oct 2021 18:00 UTC

On Monday, October 4, 2021 at 2:49:25 PM UTC-3, Guillaume wrote:
> Le 04/10/2021 à 14:33, Thiago Adams a écrit :
> >
> > In 2020 we had a topic here talking about build systems.
> > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
> >
> > The idea of having a standard way to generate the executable/lib
> > was in my mind since the previous topics like the one we talked about
> > "#pragma source" being a way to find source code needed for compilation
> > in a standard way.
> There are more build tools these days that you can think of.
> Why yet another one?

- Zero dependencies
- Zero learning curve (if you use command line compiler)
- Can debug
- Powerful
- Has preprocessor included (you can pass flags in your build)
- Can detects platform and compiler automatically (including compiler version and flags)
- Multiplatform
- Well established platform
- Simple instructions to build
- ...

Re: Universal Build System for C

<995e0cea-079f-4afc-9edf-101d8170acd3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ad4:5554:: with SMTP id v20mr26966814qvy.16.1633432328083;
Tue, 05 Oct 2021 04:12:08 -0700 (PDT)
X-Received: by 2002:a37:747:: with SMTP id 68mr14138127qkh.526.1633432327930;
Tue, 05 Oct 2021 04:12:07 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 5 Oct 2021 04:12:07 -0700 (PDT)
In-Reply-To: <6043173d-920a-43f3-a64f-82f722f6f383n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.9; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.9
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<bb3abf59-2772-4317-b970-a2653f8be291n@googlegroups.com> <7a04d30c-49de-4100-8b39-1595ef090a43n@googlegroups.com>
<6043173d-920a-43f3-a64f-82f722f6f383n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <995e0cea-079f-4afc-9edf-101d8170acd3n@googlegroups.com>
Subject: Re: Universal Build System for C
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 05 Oct 2021 11:12:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Tue, 5 Oct 2021 11:12 UTC

poniedziałek, 4 października 2021 o 19:13:44 UTC+2 fir napisał(a):
> poniedziałek, 4 października 2021 o 18:47:45 UTC+2 fir napisał(a):
> > poniedziałek, 4 października 2021 o 18:26:29 UTC+2 fir napisał(a):
> > > poniedziałek, 4 października 2021 o 14:34:03 UTC+2 Thiago Adams napisał(a):
> > > > In 2020 we had a topic here talking about build systems.
> > > > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
> > > >
> > > > The idea of having a standard way to generate the executable/lib
> > > > was in my mind since the previous topics like the one we talked about
> > > > "#pragma source" being a way to find source code needed for compilation
> > > > in a standard way.
> > > >
> > > many make build systems and many, i guess, would like to see them universal
> > >
> > > c is language that dont support itself a clean building and it is another flaw of this great language.. i think if i could gather myself to say few words on this..
> > may say soem in short
> >
> > c has a flaw which is it dont support the way of expresing of cohesion of its code pieces which can be used to build monolitic outcome piece... i mean there is a need to express this cohesion on source pieces and another express the cohesion to non source pieces which may be redistrubuables or expected to be present
> >
> > i think best way (at least in some way) would be to add it on source level amking no another kind of blot is to be needed..i think this should work like that that if you press enter on code pieces its gets compiled and if you press somethink like alt+enter there is a check of integrity - if all dependant pieces are present (yawn)
> im not quite sure but possibly one keyword or one pragma is needed, there is just need to put expected/needed pieces in that keyword or pragma and that is all
>
> main.c:
>
> uses add.c, kernel.dll, some.bmp
>
> int main()
> {
> //...........
> }
>
> not to say that it looks good but and should be like that, more as illustration how to include this cohesion data - and probably that is all needed as build system ...im not 100 % sure though

some could say i could change the word uses on attach etc but the problem is it probably looks to much 'modern' and the stylistical form of old c is kinda broken

Re: Universal Build System for C

<sjktuo$p7l$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: Universal Build System for C
Date: Wed, 6 Oct 2021 20:37:49 +0100
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <sjktuo$p7l$1@dont-email.me>
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 6 Oct 2021 19:38:00 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ef4426918b0574881e26e2d0e11e98d0";
logging-data="25845"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xtpxgDFzILL/2lXyJq04oPU7eVNuoFFU="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:O0MLRdIEFFkwJBSITyRdKiDsu2k=
In-Reply-To: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
X-Antivirus-Status: Clean
Content-Language: en-GB
X-Antivirus: AVG (VPS 211006-4, 6/10/2021), Outbound message
 by: Bart - Wed, 6 Oct 2021 19:37 UTC

On 04/10/2021 13:33, Thiago Adams wrote:
>
> In 2020 we had a topic here talking about build systems.
> https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
>

> Let's say I want to publish a lib/executable with source.
>
> This are the instructions:
>
> For windows:
>
> Open VC++ command prompt and type.
>
> cl build.c & build

This is even neater than I thought it would be.

However, shouldn't & be &&? (&& won't run build if the compile fails; &
might still do so.)

Re: Universal Build System for C

<32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:12:: with SMTP id a18mr4778461qtg.157.1633612681944;
Thu, 07 Oct 2021 06:18:01 -0700 (PDT)
X-Received: by 2002:a0c:e80b:: with SMTP id y11mr3727983qvn.21.1633612681675;
Thu, 07 Oct 2021 06:18:01 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 7 Oct 2021 06:18:01 -0700 (PDT)
In-Reply-To: <sjktuo$p7l$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=189.6.249.78; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 189.6.249.78
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com> <sjktuo$p7l$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
Subject: Re: Universal Build System for C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Thu, 07 Oct 2021 13:18:01 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 23
 by: Thiago Adams - Thu, 7 Oct 2021 13:18 UTC

On Wednesday, October 6, 2021 at 4:38:07 PM UTC-3, Bart wrote:
> On 04/10/2021 13:33, Thiago Adams wrote:
> >
> > In 2020 we had a topic here talking about build systems.
> > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
> >
> > Let's say I want to publish a lib/executable with source.
> >
> > This are the instructions:
> >
> > For windows:
> >
> > Open VC++ command prompt and type.
> >
> > cl build.c & build
> This is even neater than I thought it would be.
>
> However, shouldn't & be &&? (&& won't run build if the compile fails; &
> might still do so.)

&& is much better thanks!
and && works in Linux and Windows in the same way.

Re: Universal Build System for C

<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ae9:ed82:: with SMTP id c124mr3301692qkg.275.1633613119811;
Thu, 07 Oct 2021 06:25:19 -0700 (PDT)
X-Received: by 2002:ac8:42dd:: with SMTP id g29mr4893658qtm.168.1633613119617;
Thu, 07 Oct 2021 06:25:19 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 7 Oct 2021 06:25:19 -0700 (PDT)
In-Reply-To: <32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=189.6.249.78; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 189.6.249.78
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me> <32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com>
Subject: Re: Universal Build System for C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Thu, 07 Oct 2021 13:25:19 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 30
 by: Thiago Adams - Thu, 7 Oct 2021 13:25 UTC

On Thursday, October 7, 2021 at 10:18:13 AM UTC-3, Thiago Adams wrote:
> On Wednesday, October 6, 2021 at 4:38:07 PM UTC-3, Bart wrote:
> > On 04/10/2021 13:33, Thiago Adams wrote:
> > >
> > > In 2020 we had a topic here talking about build systems.
> > > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
> > >
> > > Let's say I want to publish a lib/executable with source.
> > >
> > > This are the instructions:
> > >
> > > For windows:
> > >
> > > Open VC++ command prompt and type.
> > >
> > > cl build.c & build
> > This is even neater than I thought it would be.
> >
> > However, shouldn't & be &&? (&& won't run build if the compile fails; &
> > might still do so.)
> && is much better thanks!
> and && works in Linux and Windows in the same way.

We can also delete the build executable at the end like this

WINDOWS:
cl build.c && build.exe || del build.exe

LINUX
gcc build.c -o build && ./build || rm build

Re: Universal Build System for C

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

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: Universal Build System for C
Date: Thu, 07 Oct 2021 07:41:21 -0700
Organization: None to speak of
Lines: 41
Message-ID: <87h7ds7v8u.fsf@nosuchdomain.example.com>
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me>
<32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="0101718fcd2a42c8d4c22baec500ecab";
logging-data="11727"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tMhaa+2HBjt63zYb6dh7J"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:ZEe1NminKRA85WH0aiBkZQpjGaM=
sha1:pVB1GLu52i4VzdlCgklSnxojL0w=
 by: Keith Thompson - Thu, 7 Oct 2021 14:41 UTC

Thiago Adams <thiago.adams@gmail.com> writes:
> On Thursday, October 7, 2021 at 10:18:13 AM UTC-3, Thiago Adams wrote:
>> On Wednesday, October 6, 2021 at 4:38:07 PM UTC-3, Bart wrote:
>> > On 04/10/2021 13:33, Thiago Adams wrote:
>> > >
>> > > In 2020 we had a topic here talking about build systems.
>> > > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
>> > >
>> > > Let's say I want to publish a lib/executable with source.
>> > >
>> > > This are the instructions:
>> > >
>> > > For windows:
>> > >
>> > > Open VC++ command prompt and type.
>> > >
>> > > cl build.c & build
>> > This is even neater than I thought it would be.
>> >
>> > However, shouldn't & be &&? (&& won't run build if the compile fails; &
>> > might still do so.)
>> && is much better thanks!
>> and && works in Linux and Windows in the same way.
>
> We can also delete the build executable at the end like this
>
> WINDOWS:
> cl build.c && build.exe || del build.exe
>
> LINUX
> gcc build.c -o build && ./build || rm build

Normally if the compilation fails the executable won't be created. If
you're concerned about a pre-existing executable, you can remove it
before compiling. (And consider the behavior of the del or rm command
if it's asked to delete a file that doesn't exist.)

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

Re: Universal Build System for C

<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:b087:: with SMTP id z129mr4777965qke.357.1633727117770;
Fri, 08 Oct 2021 14:05:17 -0700 (PDT)
X-Received: by 2002:a37:be83:: with SMTP id o125mr4807508qkf.161.1633727117458;
Fri, 08 Oct 2021 14:05:17 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 8 Oct 2021 14:05:17 -0700 (PDT)
In-Reply-To: <87h7ds7v8u.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=189.6.249.78; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 189.6.249.78
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me> <32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com> <87h7ds7v8u.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com>
Subject: Re: Universal Build System for C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Fri, 08 Oct 2021 21:05:17 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 55
 by: Thiago Adams - Fri, 8 Oct 2021 21:05 UTC

On Thursday, October 7, 2021 at 11:41:30 AM UTC-3, Keith Thompson wrote:
> Thiago Adams <thiago...@gmail.com> writes:
> > On Thursday, October 7, 2021 at 10:18:13 AM UTC-3, Thiago Adams wrote:
> >> On Wednesday, October 6, 2021 at 4:38:07 PM UTC-3, Bart wrote:
> >> > On 04/10/2021 13:33, Thiago Adams wrote:
> >> > >
> >> > > In 2020 we had a topic here talking about build systems.
> >> > > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
> >> > >
> >> > > Let's say I want to publish a lib/executable with source.
> >> > >
> >> > > This are the instructions:
> >> > >
> >> > > For windows:
> >> > >
> >> > > Open VC++ command prompt and type.
> >> > >
> >> > > cl build.c & build
> >> > This is even neater than I thought it would be.
> >> >
> >> > However, shouldn't & be &&? (&& won't run build if the compile fails; &
> >> > might still do so.)
> >> && is much better thanks!
> >> and && works in Linux and Windows in the same way.
> >
> > We can also delete the build executable at the end like this
> >
> > WINDOWS:
> > cl build.c && build.exe || del build.exe
> >
> > LINUX
> > gcc build.c -o build && ./build || rm build
> Normally if the compilation fails the executable won't be created. If
> you're concerned about a pre-existing executable, you can remove it
> before compiling. (And consider the behavior of the del or rm command
> if it's asked to delete a file that doesn't exist.)
>

We can use:

WINDOWS
cl build.c && build & del /q build.exe

LINUX
gcc build.c -o build && ./build ; rm -f build

In this case, at end the build, the executable is always deleted
if present and no error printed.

temporary files like build.obj can be deleted inside
build.exe.
But it cannot delete itself at the end. Right?

I found this "Here is the code in C which will delete the executable after execution."
https://unix.stackexchange.com/questions/280067/have-rm-not-report-when-a-file-is-missing

Re: Universal Build System for C

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

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: Universal Build System for C
Date: Fri, 08 Oct 2021 14:22:55 -0700
Organization: None to speak of
Lines: 75
Message-ID: <87wnmn5hzk.fsf@nosuchdomain.example.com>
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me>
<32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com>
<87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="41139519b557a828e82b1a9dc12922fd";
logging-data="15138"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DUxZRuaBHE4JwqBacjlen"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:0Od/2VdbvJThOoSGpl4xRQbfKTw=
sha1:gw0sldAnH/mcayGSs4Knji9pL1A=
 by: Keith Thompson - Fri, 8 Oct 2021 21:22 UTC

Thiago Adams <thiago.adams@gmail.com> writes:
> On Thursday, October 7, 2021 at 11:41:30 AM UTC-3, Keith Thompson wrote:
>> Thiago Adams <thiago...@gmail.com> writes:
>> > On Thursday, October 7, 2021 at 10:18:13 AM UTC-3, Thiago Adams wrote:
>> >> On Wednesday, October 6, 2021 at 4:38:07 PM UTC-3, Bart wrote:
>> >> > On 04/10/2021 13:33, Thiago Adams wrote:
>> >> > >
>> >> > > In 2020 we had a topic here talking about build systems.
>> >> > > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
>> >> > >
>> >> > > Let's say I want to publish a lib/executable with source.
>> >> > >
>> >> > > This are the instructions:
>> >> > >
>> >> > > For windows:
>> >> > >
>> >> > > Open VC++ command prompt and type.
>> >> > >
>> >> > > cl build.c & build
>> >> > This is even neater than I thought it would be.
>> >> >
>> >> > However, shouldn't & be &&? (&& won't run build if the compile fails; &
>> >> > might still do so.)
>> >> && is much better thanks!
>> >> and && works in Linux and Windows in the same way.
>> >
>> > We can also delete the build executable at the end like this
>> >
>> > WINDOWS:
>> > cl build.c && build.exe || del build.exe
>> >
>> > LINUX
>> > gcc build.c -o build && ./build || rm build
>> Normally if the compilation fails the executable won't be created. If
>> you're concerned about a pre-existing executable, you can remove it
>> before compiling. (And consider the behavior of the del or rm command
>> if it's asked to delete a file that doesn't exist.)
>>
>
> We can use:
>
> WINDOWS
> cl build.c && build & del /q build.exe
>
> LINUX
> gcc build.c -o build && ./build ; rm -f build
>
> In this case, at end the build, the executable is always deleted
> if present and no error printed.
>
> temporary files like build.obj can be deleted inside
> build.exe.
> But it cannot delete itself at the end. Right?
>
> I found this "Here is the code in C which will delete the executable after execution."
> https://unix.stackexchange.com/questions/280067/have-rm-not-report-when-a-file-is-missing

Deleting the executable after running it once is certainly valid, but
not something you'd usually want to do.

If you use a Makefile rather than a hypothetical "universal build
system", typing "make clean" will delete any files that can be
regenerated, and "make build" will recreate the file "build" only if it
doesn't exist or has been invalidated (for example if "build.c" has been
modified more recently than "build"). (Determining what depends on what
can be tricky.)

A universal build system should at least provide most of the
functionality provided by existing ones. If it can only build from
scratch, it's less useful.

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

Re: Universal Build System for C

<020f64ee-7a5f-4de5-a5ed-2bb482086887n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:1269:: with SMTP id b9mr4952101qkl.273.1633729473753;
Fri, 08 Oct 2021 14:44:33 -0700 (PDT)
X-Received: by 2002:ac8:59ca:: with SMTP id f10mr873412qtf.334.1633729473528;
Fri, 08 Oct 2021 14:44:33 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 8 Oct 2021 14:44:33 -0700 (PDT)
In-Reply-To: <87wnmn5hzk.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=189.6.249.78; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 189.6.249.78
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me> <32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com> <87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com> <87wnmn5hzk.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <020f64ee-7a5f-4de5-a5ed-2bb482086887n@googlegroups.com>
Subject: Re: Universal Build System for C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Fri, 08 Oct 2021 21:44:33 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 121
 by: Thiago Adams - Fri, 8 Oct 2021 21:44 UTC

On Friday, October 8, 2021 at 6:23:05 PM UTC-3, Keith Thompson wrote:
> Thiago Adams <thiago...@gmail.com> writes:
> > On Thursday, October 7, 2021 at 11:41:30 AM UTC-3, Keith Thompson wrote:
> >> Thiago Adams <thiago...@gmail.com> writes:
> >> > On Thursday, October 7, 2021 at 10:18:13 AM UTC-3, Thiago Adams wrote:
> >> >> On Wednesday, October 6, 2021 at 4:38:07 PM UTC-3, Bart wrote:
> >> >> > On 04/10/2021 13:33, Thiago Adams wrote:
> >> >> > >
> >> >> > > In 2020 we had a topic here talking about build systems.
> >> >> > > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
> >> >> > >
> >> >> > > Let's say I want to publish a lib/executable with source.
> >> >> > >
> >> >> > > This are the instructions:
> >> >> > >
> >> >> > > For windows:
> >> >> > >
> >> >> > > Open VC++ command prompt and type.
> >> >> > >
> >> >> > > cl build.c & build
> >> >> > This is even neater than I thought it would be.
> >> >> >
> >> >> > However, shouldn't & be &&? (&& won't run build if the compile fails; &
> >> >> > might still do so.)
> >> >> && is much better thanks!
> >> >> and && works in Linux and Windows in the same way.
> >> >
> >> > We can also delete the build executable at the end like this
> >> >
> >> > WINDOWS:
> >> > cl build.c && build.exe || del build.exe
> >> >
> >> > LINUX
> >> > gcc build.c -o build && ./build || rm build
> >> Normally if the compilation fails the executable won't be created. If
> >> you're concerned about a pre-existing executable, you can remove it
> >> before compiling. (And consider the behavior of the del or rm command
> >> if it's asked to delete a file that doesn't exist.)
> >>
> >
> > We can use:
> >
> > WINDOWS
> > cl build.c && build & del /q build.exe
> >
> > LINUX
> > gcc build.c -o build && ./build ; rm -f build
> >
> > In this case, at end the build, the executable is always deleted
> > if present and no error printed.
> >
> > temporary files like build.obj can be deleted inside
> > build.exe.
> > But it cannot delete itself at the end. Right?
> >
> > I found this "Here is the code in C which will delete the executable after execution."
> > https://unix.stackexchange.com/questions/280067/have-rm-not-report-when-a-file-is-missing
> Deleting the executable after running it once is certainly valid, but
> not something you'd usually want to do.
>
> If you use a Makefile rather than a hypothetical "universal build
> system", typing "make clean" will delete any files that can be
> regenerated, and "make build" will recreate the file "build" only if it
> doesn't exist or has been invalidated (for example if "build.c" has been
> modified more recently than "build"). (Determining what depends on what
> can be tricky.)
>
> A universal build system should at least provide most of the
> functionality provided by existing ones. If it can only build from
> scratch, it's less useful.

Something I may have a complete wrong view is that I am not
debugging at Linux. I don't know how others do this process?
IDE? I may try visual studio code in the future for this.

I can say how I do on Windows...I still use VC++ project/solution files
and building inside Visual Studio because this is the way I press F5 and
debug all the time. (This is not full build like run unit test all the time)

To create a multiplatform build script, to check all compilers
clang gcc cl this build.c is very handy and working very well with
no dependencies.

-----------

This code can be used to self delete file on linux and windows.
(linux remove works)

#ifdef _WIN32
int get_self_path(char* buffer, int maxsize)
{ DWORD r = GetModuleFileNameA(NULL, buffer, maxsize);
return r;
} #else
int get_self_path(char* buffer, int maxsize)
{ memset(buffer, 0, maxsize); // readlink does not null terminate!
return readlink("/proc/self/exe", buffer, maxsize);
} #endif

int main()
{ char szModuleName[200];
get_self_path(szModuleName, sizeof szModuleName);

#ifdef _WIN32
char szCmd[2 * MAX_PATH];
STARTUPINFO si = { 0 };
PROCESS_INFORMATION pi = { 0 };
StringCbPrintfA(szCmd, 2 * MAX_PATH, "cmd.exe /C timeout /t 3 && del /f /q \"%s\"", szModuleName);
CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
#else
remove(szModuleName);
#endif
}

Re: Universal Build System for C

<sjqeid$vbu$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!i2pn.org!aioe.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: Universal Build System for C
Date: Fri, 8 Oct 2021 22:51:57 +0100
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <sjqeid$vbu$1@dont-email.me>
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me>
<32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com>
<87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com>
<87wnmn5hzk.fsf@nosuchdomain.example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Oct 2021 21:52:13 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="80c0160efe17b9a25fc3c4bbfdb84724";
logging-data="32126"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zoc6m9gUh/PtC1b/RxljPuLxNoxm5PMA="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:4Le7kfSW7HUnWF6El82QbyVG7Xc=
In-Reply-To: <87wnmn5hzk.fsf@nosuchdomain.example.com>
X-Antivirus-Status: Clean
Content-Language: en-GB
X-Antivirus: AVG (VPS 211008-14, 8/10/2021), Outbound message
 by: Bart - Fri, 8 Oct 2021 21:51 UTC

On 08/10/2021 22:22, Keith Thompson wrote:
> Thiago Adams <thiago.adams@gmail.com> writes:

>> temporary files like build.obj can be deleted inside
>> build.exe.
>> But it cannot delete itself at the end. Right?
>>
>> I found this "Here is the code in C which will delete the executable after execution."
>> https://unix.stackexchange.com/questions/280067/have-rm-not-report-when-a-file-is-missing
>
> Deleting the executable after running it once is certainly valid, but
> not something you'd usually want to do.
>
> If you use a Makefile rather than a hypothetical "universal build
> system", typing "make clean" will delete any files that can be
> regenerated, and "make build" will recreate the file "build" only if it
> doesn't exist or has been invalidated (for example if "build.c" has been
> modified more recently than "build"). (Determining what depends on what
> can be tricky.)
>
> A universal build system should at least provide most of the
> functionality provided by existing ones. If it can only build from
> scratch, it's less useful.
>

It depends on what its for. It you're developing an application then you
will need to build it 100 times a day or more. You might the ability to
do incremental compilation.

But for a one-off build of some downloaded project, it will have to
compile everything from scratch anyway. Then it can be done much more
simply.

Re: Universal Build System for C

<sjqfc5$63b$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: Universal Build System for C
Date: Fri, 8 Oct 2021 23:05:42 +0100
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <sjqfc5$63b$1@dont-email.me>
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me>
<32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com>
<87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Oct 2021 22:05:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6f975997f6490d0d7f46740da3f80847";
logging-data="6251"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Yst8lHDa5iOiCFVs8yrGOG0b8tODBcUQ="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:2L7IPXCDhkd+9Lj9bkFNGOBQOII=
In-Reply-To: <18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com>
X-Antivirus-Status: Clean
Content-Language: en-GB
X-Antivirus: AVG (VPS 211008-14, 8/10/2021), Outbound message
 by: Bart - Fri, 8 Oct 2021 22:05 UTC

On 08/10/2021 22:05, Thiago Adams wrote:
> On Thursday, October 7, 2021 at 11:41:30 AM UTC-3, Keith Thompson wrote:
>> Thiago Adams <thiago...@gmail.com> writes:
>>> On Thursday, October 7, 2021 at 10:18:13 AM UTC-3, Thiago Adams wrote:
>>>> On Wednesday, October 6, 2021 at 4:38:07 PM UTC-3, Bart wrote:
>>>>> On 04/10/2021 13:33, Thiago Adams wrote:
>>>>>>
>>>>>> In 2020 we had a topic here talking about build systems.
>>>>>> https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
>>>>>>
>>>>>> Let's say I want to publish a lib/executable with source.
>>>>>>
>>>>>> This are the instructions:
>>>>>>
>>>>>> For windows:
>>>>>>
>>>>>> Open VC++ command prompt and type.
>>>>>>
>>>>>> cl build.c & build
>>>>> This is even neater than I thought it would be.
>>>>>
>>>>> However, shouldn't & be &&? (&& won't run build if the compile fails; &
>>>>> might still do so.)
>>>> && is much better thanks!
>>>> and && works in Linux and Windows in the same way.
>>>
>>> We can also delete the build executable at the end like this
>>>
>>> WINDOWS:
>>> cl build.c && build.exe || del build.exe
>>>
>>> LINUX
>>> gcc build.c -o build && ./build || rm build
>> Normally if the compilation fails the executable won't be created. If
>> you're concerned about a pre-existing executable, you can remove it
>> before compiling. (And consider the behavior of the del or rm command
>> if it's asked to delete a file that doesn't exist.)
>>
>
> We can use:
>
> WINDOWS
> cl build.c && build & del /q build.exe
>
> LINUX
> gcc build.c -o build && ./build ; rm -f build
>
> In this case, at end the build, the executable is always deleted
> if present and no error printed.

If you put too much on one line, it will starts to be more of a script.
You examples also repeat 'build' 3-4 times which is a bad sign.

However you don't need to provide such a script yourself. Any programmer
will know how to create their own scripts if they want, if they know
that the build process is:

Compile build.c to an executable using their compiler of choice
Run that executable
Optionally delete the build program if they want

Your example command lines also assume a certain compiler, but I got the
impression that build.c would pick up the compiler used, and use the
same one for the application.

Re: Universal Build System for C

<87o87zb1cp.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Universal Build System for C
Date: Fri, 08 Oct 2021 23:25:42 +0100
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <87o87zb1cp.fsf@bsb.me.uk>
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me>
<32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com>
<87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com>
<87wnmn5hzk.fsf@nosuchdomain.example.com>
<020f64ee-7a5f-4de5-a5ed-2bb482086887n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="0d926931488b87084c16998faf9d3b5f";
logging-data="14147"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zGsGCem4tWUxLinIePtyPAojoJxg4WSc="
Cancel-Lock: sha1:3a2F2VdqwlOaNa9z/uqjUXjed8Q=
sha1:0EgTjAxYLadig5Dk38wzLnAzklk=
X-BSB-Auth: 1.835376ce9d24d57366ef.20211008232542BST.87o87zb1cp.fsf@bsb.me.uk
 by: Ben Bacarisse - Fri, 8 Oct 2021 22:25 UTC

Thiago Adams <thiago.adams@gmail.com> writes:

> This code can be used to self delete file on linux and windows.
> (linux remove works)

Does remove (a standard C function) not work in this situation on
Windows?

> #ifdef _WIN32
> int get_self_path(char* buffer, int maxsize)
> {
> DWORD r = GetModuleFileNameA(NULL, buffer, maxsize);

According to online sources, GetModuleFileNameA does not always null
terminate the string on some versions of Windows. Maybe you know you
are not running this code on old versions.

You don't check (in either version) for the result being too long for
the buffer. This is a serious concern, since you go right ahead and
delete the resulting named file, even if it is not the one you should be
deleting!

> return r;
> }
> #else
> int get_self_path(char* buffer, int maxsize)
> {
> memset(buffer, 0, maxsize); // readlink does not null terminate!

There is no need to zero the buffer. readlink returns the number of
characters written so you can use that to know where to write a null.
And if you pass maxsize and the return is maxsize you know that there
was not enough room in the buffer for the path name to be written.

> return readlink("/proc/self/exe", buffer, maxsize);
> }
> #endif
>
> int main()
> {
> char szModuleName[200];
> get_self_path(szModuleName, sizeof szModuleName);
>
> #ifdef _WIN32
> char szCmd[2 * MAX_PATH];
> STARTUPINFO si = { 0 };
> PROCESS_INFORMATION pi = { 0 };
> StringCbPrintfA(szCmd, 2 * MAX_PATH, "cmd.exe /C timeout /t 3 && del /f /q \"%s\"", szModuleName);

For this purpose, I don't see a problem, but just in case someone
decides to copy this code for other uses, I'll point out how dangerous
it is to run commands on string that might not be properly quoted. And,
anyway, it's an excuse to post my favourite XKCD strip:

https://xkcd.com/327/

> CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
> CloseHandle(pi.hThread);
> CloseHandle(pi.hProcess);

That's a lot of work, so I presume just calling remove does not work.

> #else
> remove(szModuleName);
> #endif
> }
>

--
Ben.

Re: Universal Build System for C

<c18afb66-66dd-496b-b57a-3f09de87cdc7n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1882:: with SMTP id v2mr1058936qtc.130.1633732218505;
Fri, 08 Oct 2021 15:30:18 -0700 (PDT)
X-Received: by 2002:a05:622a:1652:: with SMTP id y18mr1071923qtj.226.1633732218233;
Fri, 08 Oct 2021 15:30:18 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 8 Oct 2021 15:30:18 -0700 (PDT)
In-Reply-To: <sjqfc5$63b$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=189.6.249.78; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 189.6.249.78
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me> <32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com> <87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com> <sjqfc5$63b$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c18afb66-66dd-496b-b57a-3f09de87cdc7n@googlegroups.com>
Subject: Re: Universal Build System for C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Fri, 08 Oct 2021 22:30:18 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 82
 by: Thiago Adams - Fri, 8 Oct 2021 22:30 UTC

On Friday, October 8, 2021 at 7:06:04 PM UTC-3, Bart wrote:
> On 08/10/2021 22:05, Thiago Adams wrote:
> > On Thursday, October 7, 2021 at 11:41:30 AM UTC-3, Keith Thompson wrote:
> >> Thiago Adams <thiago...@gmail.com> writes:
> >>> On Thursday, October 7, 2021 at 10:18:13 AM UTC-3, Thiago Adams wrote:
> >>>> On Wednesday, October 6, 2021 at 4:38:07 PM UTC-3, Bart wrote:
> >>>>> On 04/10/2021 13:33, Thiago Adams wrote:
> >>>>>>
> >>>>>> In 2020 we had a topic here talking about build systems.
> >>>>>> https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/m/0Cn_oqi5BgAJ
> >>>>>>
> >>>>>> Let's say I want to publish a lib/executable with source.
> >>>>>>
> >>>>>> This are the instructions:
> >>>>>>
> >>>>>> For windows:
> >>>>>>
> >>>>>> Open VC++ command prompt and type.
> >>>>>>
> >>>>>> cl build.c & build
> >>>>> This is even neater than I thought it would be.
> >>>>>
> >>>>> However, shouldn't & be &&? (&& won't run build if the compile fails; &
> >>>>> might still do so.)
> >>>> && is much better thanks!
> >>>> and && works in Linux and Windows in the same way.
> >>>
> >>> We can also delete the build executable at the end like this
> >>>
> >>> WINDOWS:
> >>> cl build.c && build.exe || del build.exe
> >>>
> >>> LINUX
> >>> gcc build.c -o build && ./build || rm build
> >> Normally if the compilation fails the executable won't be created. If
> >> you're concerned about a pre-existing executable, you can remove it
> >> before compiling. (And consider the behavior of the del or rm command
> >> if it's asked to delete a file that doesn't exist.)
> >>
> >
> > We can use:
> >
> > WINDOWS
> > cl build.c && build & del /q build.exe
> >
> > LINUX
> > gcc build.c -o build && ./build ; rm -f build
> >
> > In this case, at end the build, the executable is always deleted
> > if present and no error printed.
> If you put too much on one line, it will starts to be more of a script.
> You examples also repeat 'build' 3-4 times which is a bad sign.
Yes.
> However you don't need to provide such a script yourself. Any programmer
> will know how to create their own scripts if they want, if they know
> that the build process is:
Sure.

> Compile build.c to an executable using their compiler of choice
> Run that executable
> Optionally delete the build program if they want
>
> Your example command lines also assume a certain compiler, but I got the
> impression that build.c would pick up the compiler used, and use the
> same one for the application.

I already had a situation where the compiler that creates the build is not
the same of the target. I have a build that uses emscripten to generate
javascript or wasm.

I put a define
cl -DWEB build.c && build
and hardcoded the emscripten optons.
But I also had other problems that emscripten needs environment variables ..etc..

In windows the compiler is defined my the VC command prompt. You select
the one you want.

For Linux it is using default but I guess it could auto select as well, or show
some options..

Re: Universal Build System for C

<3d18efae-f44e-4eae-ad61-e6b636b01d9en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:6194:: with SMTP id v142mr5274791qkb.351.1633732628236;
Fri, 08 Oct 2021 15:37:08 -0700 (PDT)
X-Received: by 2002:ad4:574c:: with SMTP id q12mr12731292qvx.47.1633732628047;
Fri, 08 Oct 2021 15:37:08 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 8 Oct 2021 15:37:07 -0700 (PDT)
In-Reply-To: <87o87zb1cp.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=189.6.249.78; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 189.6.249.78
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me> <32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com> <87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com> <87wnmn5hzk.fsf@nosuchdomain.example.com>
<020f64ee-7a5f-4de5-a5ed-2bb482086887n@googlegroups.com> <87o87zb1cp.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3d18efae-f44e-4eae-ad61-e6b636b01d9en@googlegroups.com>
Subject: Re: Universal Build System for C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Fri, 08 Oct 2021 22:37:08 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 73
 by: Thiago Adams - Fri, 8 Oct 2021 22:37 UTC

On Friday, October 8, 2021 at 7:25:49 PM UTC-3, Ben Bacarisse wrote:
> Thiago Adams <thiago...@gmail.com> writes:
>
> > This code can be used to self delete file on linux and windows.
> > (linux remove works)
> Does remove (a standard C function) not work in this situation on
> Windows?

It works in linux and windows it gives access error.

> > #ifdef _WIN32
> > int get_self_path(char* buffer, int maxsize)
> > {
> > DWORD r = GetModuleFileNameA(NULL, buffer, maxsize);
> According to online sources, GetModuleFileNameA does not always null
> terminate the string on some versions of Windows. Maybe you know you
> are not running this code on old versions.
>
> You don't check (in either version) for the result being too long for
> the buffer. This is a serious concern, since you go right ahead and
> delete the resulting named file, even if it is not the one you should be
> deleting!
> > return r;
> > }
> > #else
> > int get_self_path(char* buffer, int maxsize)
> > {
> > memset(buffer, 0, maxsize); // readlink does not null terminate!
> There is no need to zero the buffer. readlink returns the number of
> characters written so you can use that to know where to write a null.
> And if you pass maxsize and the return is maxsize you know that there
> was not enough room in the buffer for the path name to be written.
> > return readlink("/proc/self/exe", buffer, maxsize);
> > }
> > #endif
> >
> > int main()
> > {
> > char szModuleName[200];
> > get_self_path(szModuleName, sizeof szModuleName);
> >
> > #ifdef _WIN32
> > char szCmd[2 * MAX_PATH];
> > STARTUPINFO si = { 0 };
> > PROCESS_INFORMATION pi = { 0 };
> > StringCbPrintfA(szCmd, 2 * MAX_PATH, "cmd.exe /C timeout /t 3 && del /f /q \"%s\"", szModuleName);
> For this purpose, I don't see a problem, but just in case someone
> decides to copy this code for other uses, I'll point out how dangerous
> it is to run commands on string that might not be properly quoted. And,
> anyway, it's an excuse to post my favourite XKCD strip:
>
> https://xkcd.com/327/
> > CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
> > CloseHandle(pi.hThread);
> > CloseHandle(pi.hProcess);
> That's a lot of work, so I presume just calling remove does not work.

Thanks for the tips..
This auto clean is not so important for the build script, as Bart also
have pointed out.
But I will use this technique to create the "uninstall.exe" that is also created by
the "build.c script".

I wish something like "update" that:

- download installer.exe from web (maybe a http client that downloads from github)
- run installer.exe
- installer runs previous uninstall.exe (if exist)
- previous uninstall.exe deletes the correct version and then itself
(useful in case not called by update)
- installer copies files to destination
- done!

Re: Universal Build System for C

<sjqkqp$vvb$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.lang.c
Subject: Re: Universal Build System for C
Date: Fri, 8 Oct 2021 23:39:05 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <sjqkqp$vvb$1@dont-email.me>
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me>
<32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com>
<87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 8 Oct 2021 23:39:05 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a1746a55e21e4d0f20a6a893bea77850";
logging-data="32747"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PISEWjYRE8ZpnHtFjoWr6rzpxw2+e6gg="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:Cjay43utgmLRATfOepRJq85xVz8=
 by: Lew Pitcher - Fri, 8 Oct 2021 23:39 UTC

On Fri, 08 Oct 2021 14:05:17 -0700, Thiago Adams wrote:

> On Thursday, October 7, 2021 at 11:41:30 AM UTC-3, Keith Thompson wrote:
>> Thiago Adams <thiago...@gmail.com> writes:
>> > On Thursday, October 7, 2021 at 10:18:13 AM UTC-3, Thiago Adams
>> > wrote:
>> >> On Wednesday, October 6, 2021 at 4:38:07 PM UTC-3, Bart wrote:
>> >> > On 04/10/2021 13:33, Thiago Adams wrote:
>> >> > >
>> >> > > In 2020 we had a topic here talking about build systems.
>> >> > > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/
m/0Cn_oqi5BgAJ
>> >> > >
>> >> > > Let's say I want to publish a lib/executable with source.
>> >> > >
>> >> > > This are the instructions:
>> >> > >
>> >> > > For windows:
>> >> > >
>> >> > > Open VC++ command prompt and type.
>> >> > >
>> >> > > cl build.c & build
>> >> > This is even neater than I thought it would be.
>> >> >
>> >> > However, shouldn't & be &&? (&& won't run build if the compile
>> >> > fails; &
>> >> > might still do so.)
>> >> && is much better thanks!
>> >> and && works in Linux and Windows in the same way.
>> >
>> > We can also delete the build executable at the end like this
>> >
>> > WINDOWS:
>> > cl build.c && build.exe || del build.exe
>> >
>> > LINUX gcc build.c -o build && ./build || rm build
>> Normally if the compilation fails the executable won't be created. If
>> you're concerned about a pre-existing executable, you can remove it
>> before compiling. (And consider the behavior of the del or rm command
>> if it's asked to delete a file that doesn't exist.)
>>
>>
> We can use:
>
> WINDOWS cl build.c && build & del /q build.exe
>
> LINUX gcc build.c -o build && ./build ; rm -f build
>
> In this case, at end the build, the executable is always deleted if
> present and no error printed.
>
> temporary files like build.obj can be deleted inside build.exe.
> But it cannot delete itself at the end. Right?

I'm amused that you think that the /only/ platforms that a "Universal
Build System for C" must support are Microsoft Windows, and Linux.

To paraphrase Hamlet, "There are more platforms in current use and
planning, Thiago, then are dreamt of in your philosophy."

And, FWIW, many of those /other/ platforms (that this "Universal
Build System" neglects or ignores) would not permit a "build system"
that arbitrarily, and without audit, deletes files and programs.

[snip]
--
Lew Pitcher
"In Skills, We Trust"

Re: Universal Build System for C

<43ad5a6b-6927-4e0d-b6b8-2f33c7d01c61n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:4044:: with SMTP id i4mr4025435qko.301.1633740653183;
Fri, 08 Oct 2021 17:50:53 -0700 (PDT)
X-Received: by 2002:a05:620a:3c4:: with SMTP id r4mr5838892qkm.480.1633740652906;
Fri, 08 Oct 2021 17:50:52 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 8 Oct 2021 17:50:52 -0700 (PDT)
In-Reply-To: <sjqkqp$vvb$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=189.6.249.78; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 189.6.249.78
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me> <32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com> <87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com> <sjqkqp$vvb$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <43ad5a6b-6927-4e0d-b6b8-2f33c7d01c61n@googlegroups.com>
Subject: Re: Universal Build System for C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Sat, 09 Oct 2021 00:50:53 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 82
 by: Thiago Adams - Sat, 9 Oct 2021 00:50 UTC

On Friday, October 8, 2021 at 8:39:14 PM UTC-3, Lew Pitcher wrote:
> On Fri, 08 Oct 2021 14:05:17 -0700, Thiago Adams wrote:
>
> > On Thursday, October 7, 2021 at 11:41:30 AM UTC-3, Keith Thompson wrote:
> >> Thiago Adams <thiago...@gmail.com> writes:
> >> > On Thursday, October 7, 2021 at 10:18:13 AM UTC-3, Thiago Adams
> >> > wrote:
> >> >> On Wednesday, October 6, 2021 at 4:38:07 PM UTC-3, Bart wrote:
> >> >> > On 04/10/2021 13:33, Thiago Adams wrote:
> >> >> > >
> >> >> > > In 2020 we had a topic here talking about build systems.
> >> >> > > https://groups.google.com/g/comp.lang.c/c/pkn6Iw3V0pc/
> m/0Cn_oqi5BgAJ
> >> >> > >
> >> >> > > Let's say I want to publish a lib/executable with source.
> >> >> > >
> >> >> > > This are the instructions:
> >> >> > >
> >> >> > > For windows:
> >> >> > >
> >> >> > > Open VC++ command prompt and type.
> >> >> > >
> >> >> > > cl build.c & build
> >> >> > This is even neater than I thought it would be.
> >> >> >
> >> >> > However, shouldn't & be &&? (&& won't run build if the compile
> >> >> > fails; &
> >> >> > might still do so.)
> >> >> && is much better thanks!
> >> >> and && works in Linux and Windows in the same way.
> >> >
> >> > We can also delete the build executable at the end like this
> >> >
> >> > WINDOWS:
> >> > cl build.c && build.exe || del build.exe
> >> >
> >> > LINUX gcc build.c -o build && ./build || rm build
> >> Normally if the compilation fails the executable won't be created. If
> >> you're concerned about a pre-existing executable, you can remove it
> >> before compiling. (And consider the behavior of the del or rm command
> >> if it's asked to delete a file that doesn't exist.)
> >>
> >>
> > We can use:
> >
> > WINDOWS cl build.c && build & del /q build.exe
> >
> > LINUX gcc build.c -o build && ./build ; rm -f build
> >
> > In this case, at end the build, the executable is always deleted if
> > present and no error printed.
> >
> > temporary files like build.obj can be deleted inside build.exe.
> > But it cannot delete itself at the end. Right?
> I'm amused that you think that the /only/ platforms that a "Universal
> Build System for C" must support are Microsoft Windows, and Linux.

I gave a basic sample. The idea is more universal than
the sample itself.
"#else
#error Unknown Platform/Compiler
#endif
"
when you have this error you can add another platform compiler.

Basically the requirements are:

- C compiler (the platform already have)
- Standard function system from <stdlib.h>.

(Of course we can build for Arduino, but the compiler is
not inside it)

> To paraphrase Hamlet, "There are more platforms in current use and
> planning, Thiago, then are dreamt of in your philosophy."
>
> And, FWIW, many of those /other/ platforms (that this "Universal
> Build System" neglects or ignores) would not permit a "build system"
> that arbitrarily, and without audit, deletes files and programs.

This is optional.

Re: Universal Build System for C

<2f5ffa4f-052d-45d8-a610-c36743ab1c22n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1116:: with SMTP id e22mr1743297qty.78.1633741925530;
Fri, 08 Oct 2021 18:12:05 -0700 (PDT)
X-Received: by 2002:ac8:3e82:: with SMTP id y2mr1724930qtf.284.1633741925292;
Fri, 08 Oct 2021 18:12:05 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 8 Oct 2021 18:12:05 -0700 (PDT)
In-Reply-To: <c18afb66-66dd-496b-b57a-3f09de87cdc7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=189.6.249.78; posting-account=xFcAQAoAAAAoWlfpQ6Hz2n-MU9fthxbY
NNTP-Posting-Host: 189.6.249.78
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me> <32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com> <87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com> <sjqfc5$63b$1@dont-email.me>
<c18afb66-66dd-496b-b57a-3f09de87cdc7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2f5ffa4f-052d-45d8-a610-c36743ab1c22n@googlegroups.com>
Subject: Re: Universal Build System for C
From: thiago.a...@gmail.com (Thiago Adams)
Injection-Date: Sat, 09 Oct 2021 01:12:05 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 26
 by: Thiago Adams - Sat, 9 Oct 2021 01:12 UTC

On Friday, October 8, 2021 at 7:30:24 PM UTC-3, Thiago Adams wrote:
....
> For Linux it is using default but I guess it could auto select as well, or show
> some options..

This is what I found how to change default gcc (because build script has hardcoded gcc)

"
1. Open the terminal window in LINUX and execute the command:
$ which gcc
This will provide the symbolic link (softlink) to the default version of GCC.
2. Navigate to the directory which has this softlink.
Change the softlink to point to the version of GCC that you want to use.
For example, for a standard GCC version 4.7 installed (where the compiler command is put at /usr/bin/gcc-4.7),
this can be done using the following command:
$ sudo ln -f -s /usr/bin/gcc-4.7 gcc
"
from
https://www.mathworks.com/matlabcentral/answers/454659-how-can-i-change-my-current-gcc-g-version-to-a-supported-one

also added
system(""gcc --version") inside the build script to know
what version is being used.

this is an extra step , however I guess all linux programmers
must know about this.

Re: Universal Build System for C

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

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: Universal Build System for C
Date: Fri, 08 Oct 2021 20:51:28 -0700
Organization: None to speak of
Lines: 50
Message-ID: <87sfxa6ekf.fsf@nosuchdomain.example.com>
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me>
<32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com>
<87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com>
<sjqfc5$63b$1@dont-email.me>
<c18afb66-66dd-496b-b57a-3f09de87cdc7n@googlegroups.com>
<2f5ffa4f-052d-45d8-a610-c36743ab1c22n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="7e8bdc203eb18db33af681d8600aa123";
logging-data="7106"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/LGqnY09DSJA2COqCZhXLa"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:6ybddKlmPxhJ2JgyIlo3wRlkths=
sha1:3szuDCeHroLl6UbISzevZtLWGOI=
 by: Keith Thompson - Sat, 9 Oct 2021 03:51 UTC

Thiago Adams <thiago.adams@gmail.com> writes:
> On Friday, October 8, 2021 at 7:30:24 PM UTC-3, Thiago Adams wrote:
> ...
>> For Linux it is using default but I guess it could auto select as well, or show
>> some options..
>
> This is what I found how to change default gcc (because build script has hardcoded gcc)
>
> "
> 1. Open the terminal window in LINUX and execute the command:
> $ which gcc
> This will provide the symbolic link (softlink) to the default version of GCC.
> 2. Navigate to the directory which has this softlink.
> Change the softlink to point to the version of GCC that you want to use.
> For example, for a standard GCC version 4.7 installed (where the compiler command is put at /usr/bin/gcc-4.7),
> this can be done using the following command:
> $ sudo ln -f -s /usr/bin/gcc-4.7 gcc
> "
> from
> https://www.mathworks.com/matlabcentral/answers/454659-how-can-i-change-my-current-gcc-g-version-to-a-supported-one
>
>
> also added
> system(""gcc --version") inside the build script to know
> what version is being used.
>
> this is an extra step , however I guess all linux programmers
> must know about this.

That's bad advice. Telling users to mess around with system-owned
directories like /usr/bin is dangerous. I know Linux pretty well, and I
don't do that myself.

On my system, for example, /usr/bin/gcc is a symbolic link to "gcc-9",
which is provided by the "gcc-9" package. That package provides 55
files; the compiler executable is just one of them. If I manually
change just the /usr/bin/gcc symlink, I'm likely to leave my system in
an inconsistent state.

And g++ (the C++ compiler) is provided by another package "g++9", which
should normally be kept in synch with the gcc package.

On Ubuntu, the "update-alternatives" command can be used to safely
change the default version of a command. Other systems are likely to
have something similar.

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

Re: Universal Build System for C

<72a008aa-11e3-439f-aadb-63a9e0732f67n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a0c:dc81:: with SMTP id n1mr14540004qvk.36.1633768748437;
Sat, 09 Oct 2021 01:39:08 -0700 (PDT)
X-Received: by 2002:a37:9202:: with SMTP id u2mr6580476qkd.454.1633768748282;
Sat, 09 Oct 2021 01:39:08 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 9 Oct 2021 01:39:08 -0700 (PDT)
In-Reply-To: <sjqeid$vbu$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:3528:f401:af53:d5d4;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:3528:f401:af53:d5d4
References: <933b95c1-8c8c-48dc-ae58-d49806746b2fn@googlegroups.com>
<sjktuo$p7l$1@dont-email.me> <32f93050-eff2-4960-b4c8-d3dd3075b31en@googlegroups.com>
<4a46c648-4897-4b28-a3fc-242583460506n@googlegroups.com> <87h7ds7v8u.fsf@nosuchdomain.example.com>
<18a56158-6c16-4c04-807e-74dfde2fd15an@googlegroups.com> <87wnmn5hzk.fsf@nosuchdomain.example.com>
<sjqeid$vbu$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <72a008aa-11e3-439f-aadb-63a9e0732f67n@googlegroups.com>
Subject: Re: Universal Build System for C
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Sat, 09 Oct 2021 08:39:08 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 18
 by: Malcolm McLean - Sat, 9 Oct 2021 08:39 UTC

On Friday, 8 October 2021 at 22:52:21 UTC+1, Bart wrote:
>
> It depends on what its for. It you're developing an application then you
> will need to build it 100 times a day or more. You might the ability to
> do incremental compilation.
>
> But for a one-off build of some downloaded project, it will have to
> compile everything from scratch anyway. Then it can be done much more
> simply.
>
We do an "integration build" whenever a unit of work is finished (we use JIRA
and gitflow, a task is entered as a JIRA, a task branch is started, then it is merged
into the develop branch when it is completed). Merging into the develop branch
automatically triggers a complete re-build from scratch for all platforms.

This caught a problem yesterday. I had entered some data as long string literals.
The compiler I was using accepted the strings. But one of the Windows compilers
rejected them as too long.

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor