I found another mistake of mine:

#ifndef __STRINGIZED__

should be

#if __STRINGIZED__ == 0

or it will always go for the second statement in the conditional.

Can someone please correct my script??? Things are starting to itch.

On Wed, Mar 13, 2024 at 8:44 AM alex xmb sw ratchev <fxmb...@gmail.com>
wrote:

>
>
> On Wed, Mar 13, 2024, 08:26 Mischa Baars <mjbaars1977.bac...@gmail.com>
> wrote:
>
>> On Tue, Mar 12, 2024 at 10:00 PM Paul Smith <psm...@gnu.org> wrote:
>>
>> > On Tue, 2024-03-12 at 13:37 +0100, Mischa Baars wrote:
>> > > > I'd still like to hear why you aren't simply using "make -j".
>> > >
>> > > That's because I don't want to define static compile and link targets
>> > > for every new project I start. The Makefile in question contains only
>> > > a few lines of code and some environment variables, but works on
>> > > every new project as long as you follow certain guidelines regarding
>> > > the directory structure. It scans, compiles and links on the fly.
>> >
>> > I don't find this argument compelling.  It's relatively straightforward
>> > to create a makefile environment that "works on every new project as
>> > long as you follow certain guidelines regarding the directory
>> > structure" while still using parallel builds, that will "scan, compile,
>> > and link" on the fly, using things like the wildcard function, pattern
>> > rules, etc.
>> >
>> > You are merely trading a bit of extra complexity in your makefile for a
>> > whole lot of complexity and tricky hacking in bash, as can be seen by
>> > following this thread.
>> >
>>
>> Only the Makefile is functional right now. The bash script is not working.
>> Good enough to reduce compile time from 1:43 to 0:10. I would have liked
>> to
>> see the script working.
>>
>
> u said u have fs naming conventions
> write em up here , i make the bash ( not sh )
>
> But if you prefer to re-invent make's parallel build capabilities in
>> > bash, certainly that's your prerogative.
>> >
>>
>

Attachment: Makefile
Description: Binary data

/* * * *
 *	:set tabstop=9
 */

#include	<stdio.h>

#define	str(x)	lit(x)
#define	lit(x)	#x

int	main	()
{
#ifndef	__STRINGIZED__
	const	char*	s      =	    __STRING__ ;
#else
	const	char*	s      =	str(__STRING__);
#endif

	printf	("STRINGIZED: %d, STRING: %s\n", __STRINGIZED__, s);
}

Reply via email to