makefile

makefile 邪道な使い方

Makefile

Exec

make docker-compose_ps
docker-compose_ps:
	@$(call _docker_compose, 'ps')

include

include ./.makefile.d/*.mk

variable

  FOO := foo
BAR = $(shell date)
  FOO := foo

define

Current DIR

  echo $(PWD)

Shell

MAKEFILE_DIR:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))

Function

define _docker_compose
	cd $(PARENT_DIR) && docker-compose $1 $2
endef
docker-compose_ps:
	@$(call _docker_compose, 'ps')

Directory

# Current Dir
MAKEFILE_DIR:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# 1 up Dir
PARENT_DIR := $(shell dirname ${MAKEFILE_DIR})

おっさんWEBエンジニア奮闘記©2007 WEBDIMENSION