I'm a happy user of the $(file) function and multiline macros/variables
likes this:
..
define FOO_PACKAGE
 exec_prefix=$(FOO_ROOT)
 libdir=$${exec_prefix}/lib
 includedir=$${exec_prefix}/inc
 Version: $(FOO_VERSION)
 Libs: $${libdir}/$(FOO_LIB)
endef

write_pkg:
 $(file > ./foo.pc, $(strip $(FOO_PACKAGE)))

Since I suspect some older pkgconfig programs doesn't like the leading
spaces in foo.pc, I'm using $(strip). But this also removes the newlines. My make-manual documents that "white space" gets stripped off. IMHO make 4.x has a too strict definition of white-space. Or have I misunderstood how $(strip) is supposed to work?

But I could always have 'define FOO_PACKAGE'
without the leading spaces and do:

write_pkg:
$(file > ./foo.pc,$(FOO_PACKAGE))

But I prefer the nice indent.

--gv

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to