tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bmake bug with expanding pattern macro replacements



maya%NetBSD.org@localhost wrote:

> sjg is distributing a portable version independent of pkgsrc.
> You can find it here: http://crufty.net/help/sjg/bmake.html
> 
> Specific link: http://www.crufty.net/ftp/pub/sjg/bmake.tar.gz

Thank you for the link. That helped and I only needed to copy 3 files from the 
current state to make it work.

I could make the make program detection work with that version.

Now the next problem is that bmake only seem to support the ancient suffix 
rules. This could make it hard to support architecture specific directories for 
.o files, but this is required.

Is there something better than suffix rules in bmake?

BTW: While looking at the unit tests, I discovered "unit-tests/posix.mk"

Let me discuss this since bmake is not POSIX compliant and it would be a win to 
fix the following problems:

1)	A makefile that tests POSIX compliance sould start with:
	
	.POSIX:

	but this is missing in "unit-tests/posix.mk"

2)	This rule creates the attempt to check for POSIX compliance:

	x:
		@echo "Posix says we should execute the command as if run by system(3)"
		@echo "Expect 'Hello,' and 'World!'"
		@echo Hello,; false; echo "World!"

	It is however based on a mistake from reading POSIX, as POSIX really says:

	The execution line shall then be executed by a shell as if it were 
	passed as the argument to the system() interface, except that if errors
	are not being ignored then the shell -e option shall also be in effect.
	If errors are being ignored for the command (as a result of the -i option,
	a '-' command prefix, or a .IGNORE special target), the shell -e option
	shall not be in effect.

	As a result, this test should only print: "Hello," if bmake was made 
	POSIX compliant. BTW: This is well known UNIX make behavior since 
	44 years.

3)	Do not use non-POSIX features when testing for POSIX compliance:

	subs:
		@echo make -n
		@${.MAKE} -f ${MAKEFILE} -n plus
		@echo make -n -j1
		@${.MAKE} -f ${MAKEFILE} -n -j1 plus

	${.MAKE} is not a make macro supported by POSIX

	${MAKEFILE} is not a make macro supported by POSIX

	-j is not an option supported by POSIX 

4)	bmake misses support for the POSIX command line option -p

5)	bmake misses support for the POSIX command line option -S

Jörg

-- 
EMail:joerg%schily.net@localhost                  (home) Jörg Schilling D-13353 Berlin
joerg.schilling%fokus.fraunhofer.de@localhost (work) Blog: http://schily.blogspot.com/
URL:  http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/



Home | Main Index | Thread Index | Old Index