SHELL := /bin/bash PWD ?= pwd_unknown TIME := $(shell date +%s) export TIME CARGO_PATH :=$(HOME)/.cargo export CARGO_PATH #PATH :=$(shell sudo -su $(USER) $(CARGO_PATH))/bin:$(PATH) GIT_STATUS := $(shell git status --ignore-submodules=dirty --porcelain=2 -s) export GIT_STATUS ifeq ($(project),) PROJECT_NAME := $(notdir $(PWD)) else PROJECT_NAME := $(project) endif export PROJECT_NAME ifeq ($(port),) PORT := 0 else PORT := $(port) endif export PORT #GIT CONFIG GIT_USER_NAME := $(shell git config user.name) export GIT_USER_NAME GH_USER_NAME := $(shell git config user.name) #MIRRORS GH_USER_REPO := $(GH_USER_NAME).github.io #GITHUB RUNNER CONFIGS ifneq ($(ghuser),) GH_USER_NAME := $(ghuser) GH_USER_REPO := $(ghuser).github.io endif export GIT_USER_NAME export GH_USER_REPO GIT_USER_EMAIL := $(shell git config user.email) export GIT_USER_EMAIL GIT_SERVER := https://github.com export GIT_SERVER GIT_SSH_SERVER := git@github.com export GIT_SSH_SERVER GIT_PROFILE := $(shell git config user.name) export GIT_PROFILE GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) export GIT_BRANCH GIT_HASH := $(shell git rev-parse --short HEAD^0) export GIT_HASH GIT_PREVIOUS_HASH := $(shell git rev-parse --short HEAD^1) export GIT_PREVIOUS_HASH GIT_REPO_ORIGIN := $(shell git remote get-url origin) export GIT_REPO_ORIGIN GIT_REPO_NAME := $(PROJECT_NAME) export GIT_REPO_NAME GIT_REPO_PATH := $(HOME)/$(GIT_REPO_NAME) export GIT_REPO_PATH #BASENAME := $(shell basename -s .git `git config --get remote.origin.url`) #export BASENAME .PHONY: default default: @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?##/ {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) .PHONY: help help:## verbose help @echo "" @echo verbose $@ @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /' @echo "" .PHONY: report report:## report @echo 'TIME=${TIME}' @echo 'PROJECT_NAME=${PROJECT_NAME}' @echo 'CARGO_PATH=${CARGO_PATH}' @echo 'GIT_USER_NAME=${GIT_USER_NAME}' @echo 'GH_USER_REPO=${GH_USER_REPO}' @echo 'GIT_USER_EMAIL=${GIT_USER_EMAIL}' @echo 'GIT_SERVER=${GIT_SERVER}' @echo 'GIT_PROFILE=${GIT_PROFILE}' @echo 'GIT_BRANCH=${GIT_BRANCH}' @echo 'GIT_HASH=${GIT_HASH}' @echo 'GIT_PREVIOUS_HASH=${GIT_PREVIOUS_HASH}' @echo 'GIT_REPO_ORIGIN=${GIT_REPO_ORIGIN}' @echo 'GIT_REPO_NAME=${GIT_REPO_NAME}' @echo 'GIT_REPO_PATH=${GIT_REPO_PATH}' .PHONY: cargo .ONESHELL: cargo:## cargo-build cargo-install $(MAKE) cargo-build $(MAKE) cargo-install checkbrew:## checkbrew ifeq ($(HOMEBREW),) @/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" else @type -P brew endif submodules:checkbrew## submodules @git submodule update --init --recursive git submodule foreach --recursive "git submodule update --init --recursive" build:## build @docker compose build run:## run @docker-compose up -d restart:## restart @docker-compose restart -include cargo.mk -include act.mk # vim: set noexpandtab: # vim: set setfiletype make