-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
81 lines (66 loc) · 1.46 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
CWD := $(shell pwd)
NAME := $(shell pwd | grep -Po "[^\/]*$$")
CMD := cat configure.ac | grep -Po "(?<=AC_INIT\(\[$(NAME)],\s\[).*(?=],)"
VERSION := $(shell $(CMD))
.PHONY: all
all: clean build
.PHONY: eternal-alias
eternal-alias: make break
@dist/bin/eternal-alias hello="echo world"
.PHONY: eternal-export
eternal-export: make break
@dist/bin/eternal-export HELLO=WORLD
.PHONY: eternal-source
eternal-source: make break
@dist/bin/eternal-source ~/.bashrc
.PHONY: eternal-unalias
eternal-unalias: make break
@dist/bin/eternal-unalias hello
.PHONY: eternal-unset
eternal-unset: make break
@dist/bin/eternal-unset HELLO
.PHONY: eternal-unsource
eternal-unsource: make break
@dist/bin/eternal-unsource ~/.zsh_envs
.PHONY: break
break:
@echo --------
.PHONY: make
make: clean dist
@cd dist && ./configure
@cd dist && make
.PHONY: clean
clean:
-@rm -r $(NAME) \
*.cache \
*.in \
*.log \
*.tar.gz \
aclocal.m4 \
bin \
compile \
config.status \
configure \
dist \
depcomp \
install-sh \
missing \
src/*.in \
src/*.o \
src/.deps \
src/Makefile 2>/dev/null || true
.PHONY: autoreconf
autoreconf: dist
dist:
@rsync -rv --exclude=Makefile --exclude=.git --exclude=dist ./ dist
@cd dist && autoreconf --install
@rm -r dist/*.cache
.PHONY: build
build: $(NAME)_$(VERSION).tar.gz
.PHONY: publish
publish:
@cd ubuntu && make publish
$(NAME)_$(VERSION).tar.gz: dist
@mv dist $(NAME)
@tar -czvf $(NAME)_$(VERSION).tar.gz $(NAME)
@mv $(NAME) dist