This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Detect operating system in Makefile. | |
| # Author: He Tao | |
| # Date: 2015-05-30 | |
| OSFLAG := | |
| ifeq ($(OS),Windows_NT) | |
| OSFLAG += -D WIN32 | |
| ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) | |
| OSFLAG += -D AMD64 | |
| endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task-who-need-specific-envvar: guard-SPECIFIC_ENVVAR | |
| @echo ${SPECIFIC_ENVVAR} | |
| guard-%: | |
| @ if [ "${${*}}" = "" ]; then \ | |
| echo "Environment variable $* not set"; \ | |
| exit 1; \ | |
| fi | |
| # $ make task-who-need-specific-envvar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/signal" | |
| "syscall" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SHELL := /bin/bash | |
| REV := $(shell git rev-parse HEAD) | |
| CHANGES := $(shell test -n "$$(git status --porcelain)" && echo '+CHANGES' || true) | |
| TARGET := packer-provisioner-itamae-local | |
| VERSION := $(shell cat VERSION) | |
| OS := darwin freebsd linux openbsd | |
| ARCH := 386 amd64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "go/build" | |
| "go/types" | |
| "os" | |
| "golang.org/x/tools/go/loader" |