Saturday, June 12, 2021

handy makefile script

I frequently find myself looking for default make rules, and inevitably how to print their values.  Here's a script to help.

Adapted from https://blog.melski.net/2010/11/30/makefile-hacks-print-the-value-of-any-variable/

$ cat ~/bin/make-vars 
#!/bin/bash

_vars=
for v in $@; do
  _vars="${_vars} print-${v}"
done

make -f- ${_vars} <<'EOF'
print-%:
	@echo '$*=$($*)'
	@echo '  origin = $(origin $*)'
	@echo '  flavor = $(flavor $*)'
	@echo '   value = $(value  $*)'
EOF

Here it is in use

$ make-vars LINK.cc
LINK.cc=c++    
  origin = default
  flavor = recursive
   value = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)

Friday, June 4, 2021

New home for joinery

As of version 1.10, joinery is now hosted in the central repo using the sh.joinery groupId.

As part of the move to central, joinery also has a shiny new domain https://joinery.sh.