From: W. Trevor King Date: Sun, 31 Aug 2008 22:47:36 +0000 (+0000) Subject: Importing NanoBlogger post "Make gotcha" X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1bb098d33fb7ac0566c1852196f0d5b684147561;p=mw2txt.git Importing NanoBlogger post "Make gotcha" --- diff --git a/posts/Make_gotcha.mdwn b/posts/Make_gotcha.mdwn new file mode 100644 index 0000000..f8a049c --- /dev/null +++ b/posts/Make_gotcha.mdwn @@ -0,0 +1,34 @@ +[[!meta title="Make gotcha"]] +[[!meta date="2008-08-31 18:47:36"]] +Alrighty, this one had me stumped for a while: + + $ cat Makefile + DIRA=dirA + DIRB =dirB + DIRC = dirC + DIRD=dirD# immediate comment + DIRE= dirE# immediate comment + DIRF=dirF + DIRG=dirG # (dirF has a trailing space too) + FILE = a # more spaces here + + make : $(DIRA)/$(FILE) $(DIRB)/$(FILE) $(DIRC)/$(FILE) $(DIRD)/$(FILE) $(DIRE)/$(FILE) $(DIRF)/$(FILE) $(DIRG)/$(FILE) + echo "done" + % : + echo "looking for $@" + $ make + looking for dirA/a + looking for dirB/a + looking for dirC/a + looking for dirD/a + looking for dirE/a + looking for dirF + looking for /a + looking for dirG + done + +Apparently bonus whitespace (normally before a comment or after an +equals sign) in variable definitions is stripped from the front of a +definition, but not the back. You have been warned ;). + +[[!tag programming]]