-
Notifications
You must be signed in to change notification settings - Fork 158
/
Makefile
executable file
·131 lines (100 loc) · 3.6 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
NITROGEN_VERSION=2.0.4
help:
@echo
@echo "Usage: "
@echo " ./make {compile|clean}"
@echo
@echo " ./make {rel_inets|package_inets}"
@echo " ./make {rel_mochiweb|package_mochiweb}"
@echo " ./make {rel_webmachine|package_webmachine}"
@echo " ./make {rel_yaws|package_yaws}"
@echo
@echo " ./make package_docs"
@echo
@echo
compile:
@(cd ./apps/nitrogen; make compile)
@(cd ./apps/simple_bridge; make compile)
@(cd ./apps/nprocreg; make compile)
clean:
@(cd ./apps/nitrogen; make clean)
@(cd ./apps/simple_bridge; make clean)
@(cd ./apps/nprocreg; make clean)
# INETS
rel_inets: compile
@rm -rf rel/nitrogen
@rm -rf rel/reltool.config
@ln rel/inets.config rel/reltool.config
@(make rel_inner)
@echo Generated a self-contained Nitrogen project
@echo in 'rel/nitrogen', configured to run on Inets.
package_inets: rel_inets
mkdir -p ./builds
tar -C rel -c nitrogen | gzip > ./builds/nitrogen-${NITROGEN_VERSION}-inets.tar.gz
# MOCHIWEB
rel_mochiweb: compile
@rm -rf rel/nitrogen
@rm -rf rel/reltool.config
@ln rel/mochiweb.config rel/reltool.config
@(make rel_inner)
@echo Generated a self-contained Nitrogen project
@echo in 'rel/nitrogen', configured to run on Mochiweb.
package_mochiweb: rel_mochiweb
mkdir -p ./builds
tar -C rel -c nitrogen | gzip > ./builds/nitrogen-${NITROGEN_VERSION}-mochiweb.tar.gz
# WEBMACHINE
rel_webmachine: compile
@rm -rf rel/nitrogen
@rm -rf rel/reltool.config
@ln rel/webmachine.config rel/reltool.config
@(make rel_inner)
@echo Generated a self-contained Nitrogen project
@echo in 'rel/nitrogen', configured to run on Webmachine.
package_webmachine: rel_webmachine
mkdir -p ./builds
tar -C rel -c nitrogen | gzip > ./builds/nitrogen-${NITROGEN_VERSION}-webmachine.tar.gz
# YAWS
rel_yaws: compile
@rm -rf rel/nitrogen
@rm -rf rel/reltool.config
@ln rel/yaws.config rel/reltool.config
@(make rel_inner)
@echo Generated a self-contained Nitrogen project
@echo in 'rel/nitrogen', configured to run on Yaws.
package_yaws: rel_yaws
mkdir -p ./builds
tar -C rel -c nitrogen | gzip > ./builds/nitrogen-${NITROGEN_VERSION}-yaws.tar.gz
# Create an Inets release dependent upon the built in Erlang installation.
dependent:
@rm -rf rel/nitrogen/erts-*
@mv rel/nitrogen/lib rel/nitrogen/lib2
@mkdir rel/nitrogen/lib
@mv rel/nitrogen/lib2/nitrogen* rel/nitrogen/lib
@mv rel/nitrogen/lib2/nprocreg* rel/nitrogen/lib
@mv rel/nitrogen/lib2/simple_bridge* rel/nitrogen/lib
@mv rel/nitrogen/lib2/webmachine* rel/nitrogen/lib
@mv rel/nitrogen/lib2/mochiweb* rel/nitrogen/lib
@mv rel/nitrogen/lib2/yaws* rel/nitrogen/lib
@rm -rf rel/nitrogen/lib2
@cp rel/overlay_dependent/bin/nitrogen rel/nitrogen/bin/
@mkdir -p rel/nitrogen/erts/bin
@cp rel/overlay/erts-vsn/bin/nodetool rel/nitrogen/erts/bin
# SHARED
rel_inner:
@(cd rel; ./rebar generate)
@(cd rel/nitrogen; make)
@printf "Nitrogen Version:\n${NITROGEN_VERSION}\n\n" > rel/nitrogen/BuildInfo.txt
@echo "Built On (uname -v):" >> rel/nitrogen/BuildInfo.txt
@uname -v >> rel/nitrogen/BuildInfo.txt
@cp -r ./doc rel/nitrogen/doc
@cp -r ./apps/nitrogen/www rel/nitrogen/site/static/nitrogen
@rm -rf rel/reltool.config
rel_copy_quickstart:
cp -R Quickstart/src/* rel/nitrogen/site/src
cp -R Quickstart/static/* rel/nitrogen/site/static
cp -R Quickstart/templates/* rel/nitrogen/site/templates
cp -R doc/html/* rel/nitrogen/site/static/doc
(cd rel/nitrogen; ln -s site/static static)
(cd rel/nitrogen; ln -s site/templates templates)
rellink:
$(foreach app,$(wildcard apps/*), rm -rf rel/nitrogen/lib/$(shell basename $(app))* && ln -sf $(abspath $(app)) rel/nitrogen/lib;)