Skip to content

Instantly share code, notes, and snippets.

View benjaminfuchs's full-sized avatar

Benjamin Fuchs benjaminfuchs

  • Freiburg, Germany
View GitHub Profile
import subprocess
import tempfile
import os
import re
from string import Template
STRING = """
#include <iostream>
#include <string>
@benjaminfuchs
benjaminfuchs / gist:f05053067e723cf02a3272f341363da9
Last active August 10, 2017 23:45
Add prefix to GNU make shell output
SHELL=/bin/bash -c 'eval $$0 $$@ 2>&1 | stdbuf -oL sed "s/^/[$@] /"'
.SHELLFLAGS=
# Prints all targets of the Makefile
.PHONY: help
help:
@make --print-data-base --question | \
grep -v -e '^Makefile' | \
awk '/^[^.%][-A-Za-z0-9_]*:/ \
{ print substr($$1, 1, length($$1)-1) }' | \
sort | \
pr --omit-pagination --width=80 --columns=3 \