http://www.politiker-stopp.de/gfx/politiker-stopp-print.png

Benjamin Schieder

CRUDE MAKEFILE HACK

2019 January 21 | 0 comments

After trying for a while to get all the Makefile special characters encoded for a bash command to run, I’ve finally given up. I’m doing this now: Before (random example, much worse lines in there):

map_files/19/0_42.png:
	bash -c 'convert xc:transparent -background transparent -page +0+0 map_files/20/0_84.png  $$( [ -e map_files/20/1_84.png ] && echo -page +1024+0 map_files/20/1_84.png ) $$( [ -e map_files/20/0_85.png ] && echo -page +0+1024 map_files/20/0_85.png ) $$( [ -e map_files/20/1_85.png ] && echo -page +1024+1024 map_files/20/1_85.png ) -layers merge +repage -resize 50% png:map_files/19/0_42.png'

After:

map_files/19/0_42.png:
	echo 'Y29udmVydCB4Yzp0cmFuc3BhcmVudCAtYmFja2dyb3VuZCB0cmFuc3BhcmVudCAtcGFnZSArMCswIG1hcF9maWxlcy8yMC8wXzg0LnBuZyAgJCggWyAtZSBtYXBfZmlsZXMvMjAvMV84NC5wbmcgXSAmJiBlY2hvIC1wYWdlICsxMDI0KzAgbWFwX2ZpbGVzLzIwLzFfODQucG5nICkgJCggWyAtZSBtYXBfZmlsZXMvMjAvMF84NS5wbmcgXSAmJiBlY2hvIC1wYWdlICswKzEwMjQgbWFwX2ZpbGVzLzIwLzBfODUucG5nICkgJCggWyAtZSBtYXBfZmlsZXMvMjAvMV84NS5wbmcgXSAmJiBlY2hvIC1wYWdlICsxMDI0KzEwMjQgbWFwX2ZpbGVzLzIwLzFfODUucG5nICkgLWxheWVycyBtZXJnZSArcmVwYWdlIC1yZXNpemUgNTAlIHBuZzptYXBfZmlsZXMvMTkvMF80Mi5wbmcK' | base64 -d | bash

EOF

Category: blog

Tags:


Post a comment

All comments are held for moderation; basic HTML formatting is accepted.

Name: (required)
E-mail: (required, not published)
Website: (optional)
Comment: