-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (29 loc) · 774 Bytes
/
Makefile
File metadata and controls
36 lines (29 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ifdef QUIET
MAKE_FLAGS += --no-print-directory
Q := @
else
Q :=
endif
TARGETS := $(notdir $(wildcard src/*))
BINARIES := $(addprefix dist/bin/, $(TARGETS))
MAJOR := 0
MINOR := 1
PATCH ?= 99999+local-$(shell git rev-parse --abbrev-ref HEAD 2> /dev/null)-$(shell git rev-list --count HEAD 2>/dev/null)-$(shell git rev-parse --short HEAD)
VERSION := $(MAJOR).$(MINOR).$(PATCH)
log = $(if $(QUIET),,$(info $(1)))
$(call log,entering directory `$(shell pwd)')
$(call log,VERSION: $(VERSION))
.PHONY: all FORCE
all: $(BINARIES)
@:
FORCE:
dist/bin/%: FORCE
$(Q) mkdir -p $(dir $@)
$(Q) make -C src/$* DIST_DIR=$(abspath $(dir $@))
dist:
$(Q) mkdir -p dist
link: dist FORCE
$(Q) ln -s $(abspath dist) ~/.git-interactive
.PHONY: version
version:
@printf $(VERSION)