-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinclude.mk
More file actions
69 lines (50 loc) · 1.5 KB
/
include.mk
File metadata and controls
69 lines (50 loc) · 1.5 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# include.mk
# Define global things that all makefiles need.
# Expected to be included from a subdirectory
BUILD_DIR := $(shell pwd)/../build
include ../dirs.mk
# Shell Scripts
SH_SRCS := $(wildcard *.sh)
BIN_TOOLS := $(SH_SRCS:%.sh=$(BUILD_BIN)/%)
PY_SRCS := $(wildcard *.py)
PYBIN_TOOLS := $(PY_SRCS:%.py=$(BUILD_BIN)/%)
FUNC_SRCS := $(wildcard *.func)
FUNC_LOAD := $(FUNC_SRCS:%.func=$(BUILD_FUNC)/%)
EMACS_SRCS := $(wildcard *.el)
EMACS_TOOLS := $(EMACS_SRCS:%=$(BUILD_EMACS)/%)
DOT_SRCS := $(wildcard *.dot)
DOT_TOOLS := $(DOT_SRCS:%.dot=$(BUILD_DOT)/.%)
.PHONY: all install install_funcs install_bin install_dot install_emacs
all: $(BIN_TOOLS) $(PYBIN_TOOLS) $(FUNC_LOAD) $(EMACS_TOOLS) $(DOT_TOOLS)
$(BIN_TOOLS): $(BUILD_BIN)/%: %.sh
cp $< $@
chmod +x $@
$(PYBIN_TOOLS): $(BUILD_BIN)/%: %.py
cp $< $@
chmod +x $@
$(FUNC_LOAD): $(BUILD_FUNC)/%: %.func
cp $< $@
chmod +x $@
$(EMACS_TOOLS): $(BUILD_EMACS)/%.el: %.el
cp $< $@
$(DOT_TOOLS): $(BUILD_DOT)/.%: %.dot
cp $< $@
install_bin: $(BIN_TOOLS) $(PYBIN_TOOLS)
for bin_tool in $^ ; do \
cp $$bin_tool $(INSTALL_BIN) ; \
done
install_funcs: $(FUNC_LOAD)
for func_load in $^ ; do \
cp $$func_load $(INSTALL_FUNC); \
done
install_emacs: $(EMACS_TOOLS)
for file in $^ ; do \
cp $$file $(INSTALL_EMACS); \
done
install_dot: $(DOT_TOOLS)
for file in $^ ; do \
cp $$file $(INSTALL_DOT) ; \
done
install: install_bin install_funcs install_emacs install_dot
clean:
rm $(BIN_TOOLS) $(PYBIN_TOOLS) $(FUNC_LOAD) $(EMACS_TOOLS) $(DOT_TOOLS)