Most users of GNU make are familiar with its two types of variables: recursive variables, where the value is expanded every time the variable is referenced, and simple variables, where the value is expanded only once: when the variable is assigned. But what if you wanted a variable that was expanded only once, but not until the first time it was used? Such a thing is possible in GNU make… with a bit of trickery.
Continue reading
Managing Recipe Echoing
Today’s compiler invocations often utilize a large number of flags and options, which can make reading the output from a make
invocation difficult. But what’s the best way to provide cleaner build output while still maintaining the ability to see the entire recipe, when necessary?
Continue reading
Switching GPG keys
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1,SHA512 I have generated a new 4096-bit RSA GPG key and am switching to it from my old key. All future signatures will be created using the new key. The old key was not compromised and can continue to be used safely but future correspondence should be encrypted using the new key. This document is signed with both keys. Old key: pub dsa1024/96B047156338B6D4 2004-01-04 Key fingerprint = 3D25 54F0 A153 38AB 9AF1 BB9D 96B0 4715 6338 B6D4 New key: pub rsa4096/80CB727A20C79BB2 2016-10-22 Key fingerprint = 6D4E EB02 AD83 4703 510B 1176 80CB 727A 20C7 9BB2 Download my new key directly: http://mad-scientist.net/gpg/80CB727A20C79BB2.asc Download my new key using a keyserver: gpg --keyserver keys.gnupg.net --recv-key 80CB727A20C79BB2 Display the new fingerprint (compare with the fingerprint above): gpg --fingerprint 80CB727A20C79BB2 Display signatures on my new key (it's signed with the old key): gpg --check-sigs 80CB727A20C79BB2 To verify this message: wget -O- http://mad-scientist.net/gpg/key-transition-2016.asc \ | gpg --verify Cheers! Paul D. Smith <psmith@gnu.org> Saturday, 22 Oct 2016 -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlgMPKoACgkQlrBHFWM4ttTigwCgvENSyLbkZa1/ejRiI+Ww/iQK h4IAoKRBtzLl9D1l9yNxr5OZ1cjgJzy2iQIcBAEBCgAGBQJYDDyqAAoJEN6syq7b eBN6yjYP/17pAHRaymGixgt3Yhq2vaSbFqhH0JOeDM5Q7KYPNcU77qJqYaAxJfKy iFQXLWdLX1MyKblzzqruY5tHILyO8t9TE6E5Z0L1SuFdCSapWfvQBi85DsY4F0Gy ANuKKRFO8UjQ32+AXzHezcBMQkS9KWmaL7RKCWxqWSgciYPsoh4uJyA0Y5Q3Wa1k i1yFp8kOdVeTYb29KRL+AnuuTQb3d5pbhggyHXjXVvxPr8OHsz6XCNLSm3EkXHHv NuiaySSQF3J4Jv+tlfo+vwAzJEp5U7y/y2GN41RFBjVx3ko2tUr66rWMJBiJyKeK jA+9SViUT73qKWiWRIK9z7yrTHzcvye8fkQbTTufCQWJ9NFOqvLUZS7clfurAZQJ wuBuSYdNv6bWIxUmfdevuKc+joC6kG9PSGpcKKxMvgyPGkhQvpQSi5Hlwy1LfGd8 RXopQHupIbHEyLT6xloMQ0817JKOTblsM0uMiVI8jK2jMrky8RQBOQZDhW/1dKGf +lgZ55S+fNWrUwK45O9Xga1AdkoVSFBGW5l+3Miile3lWbobzSYLHOLI0P8lp2Wa mCf/tOKV1zZFDZmstjisnGcKrGECiGilW5g8aYNt/kuXNtECnquJptpsHDl/TsGR YBQY7z+a2CPpL17Oidz5YUvKaug22k9qsbAEJk7LKqiKRzcaxWSx =uJo7 -----END PGP SIGNATURE-----
Metaprogramming Make VI — The eval Function
Metaprogramming is the ability of a program generate other programs, or even modify itself while running. This is the sixth in a series of posts exploring how to use metaprogramming in GNU make makefiles, discussing the eval
function. Continue reading
Metaprogramming Make V — Constructed Include Files
Metaprogramming is the ability of a program generate other programs, or even modify itself while running. This is the fifth in a series of posts exploring how to use metaprogramming in GNU make makefiles, discussing constructed include files. Continue reading
Metaprogramming Make IV — Secondary Expansion
Metaprogramming is the ability of a program generate other programs, or even modify itself while running. This is the fourth in a series of posts exploring how to use metaprogramming in GNU make makefiles, discussing secondary expansion. Continue reading
Metaprogramming Make III — Constructed Macro Names
Metaprogramming is the ability of a program generate other programs, or even modify itself while running. This is the third in a series of posts exploring how to use metaprogramming in GNU make makefiles, discussing constructed macro names. Continue reading
Metaprogramming Make II — Recursive Expansion
Metaprogramming is the ability of a program generate other programs, or even modify itself while running. This is the second in a series of posts exploring how to use metaprogramming in GNU make makefiles, discussing recursive expansion. Continue reading
Metaprogramming Make I — Evaluation and Expansion
This is the first in a series of posts discussing metaprogramming techniques in GNU make.
Metaprogramming is the ability of a program generate a program or to modify itself while running. It turns out that GNU make has a number of facilities that can be considered “metaprogramming”, and these capabilities can be incredibly powerful in creating build environments that require a minimal amount of upkeep and maintenance, while providing a significant amount of flexibility. In a series of posts I’ll explore these different facilities, starting from the simplest to most complex.
Continue reading