-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
50 lines (42 loc) · 1.26 KB
/
Makefile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
CTAGS:=$(shell ctags --version 2>/dev/null)
SHELL=/usr/bin/env bash
BINS=$(filter-out bin/README.md,$(wildcard bin/*))
LIBS=$(filter-out lib/README.md,$(wildcard lib/*))
SCRIPTS=$(BINS) formulas/*/depends formulas/*/functions/* formulas/*/run $(LIBS)
.PHONY: clean
FORMULA_READMES=$(patsubst %/./,%/README.md,$(wildcard formulas/*/./))
all: bin/README.md lib/README.md formulas/README.md $(FORMULA_READMES) tags TAGS
bin/README.md: $(BINS)
util/build-readme $@ > [email protected]
mv [email protected] $@
lib/README.md: $(LIBS)
util/build-readme $@ > [email protected]
mv [email protected] $@
formulas/README.md: $(FORMULA_READMES)
util/build-formula-index-readme $@ > [email protected]
mv [email protected] $@
.SECONDEXPANSION:
formulas/%/README.md: formulas/%/run $$(wildcard formulas/%/functions/*) $$(wildcard formulas/%/explorers/*)
util/build-formula-readme $@ > [email protected]
mv [email protected] $@
perms:
chmod 755 $(SCRIPTS)
TAGS: $(SCRIPTS) perms
ifdef CTAGS
ctags -e --recurse $(SCRIPTS)
else
$(warning ctags is not installed - not building $@)
endif
tags: $(SCRIPTS) perms
ifdef CTAGS
ctags --recurse $(SCRIPTS)
else
$(warning ctags is not installed - not building $@)
endif
clean:
#
# This only cleans up the tag files.
# README.md files are left intentionally because we may update just
# a portion of that file.
#
rm tags TAGS