forked from nitrogen/nitrogen
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
executable file
·105 lines (80 loc) · 2.71 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
NITROGEN_VERSION=2.0.0
help:
@echo
@echo "Usage: "
@echo " ./make {compile|clean}"
@echo
@echo " ./make {rel_inets|package_inets}"
@echo " ./make {rel_mochiweb|package_mochiweb}"
@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 compile_mochiweb
@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.
compile_mochiweb:
@(cd apps/mochiweb; make all)
package_mochiweb: rel_mochiweb
mkdir -p ./builds
tar -C rel -c nitrogen | gzip > ./builds/nitrogen-${NITROGEN_VERSION}-mochiweb.tar.gz
# YAWS
rel_yaws: compile compile_yaws
@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.
compile_yaws:
@(cd apps/yaws-1.87; ./configure --disable-sendfile; make)
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: rel_inets
@rm -rf rel/nitrogen/erts-*
@mv rel/nitrogen/lib rel/nitrogen/lib2
@mkdir rel/nitrogen/lib
@cp -r rel/nitrogen/lib2/nitrogen* rel/nitrogen/lib
@cp -r rel/nitrogen/lib2/nprocreg* rel/nitrogen/lib
@cp -r rel/nitrogen/lib2/simple_bridge* 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