-
Notifications
You must be signed in to change notification settings - Fork 267
/
Makefile.am
201 lines (160 loc) · 6.71 KB
/
Makefile.am
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
ACLOCAL_FLAGS = -I m4
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src ebin_src include priv
APPDIRS = applications/chat applications/mail applications/wiki applications/yapp
if !WINDOWS
# don't c-compile anything on win32 (yet)
# I don't know how to make a linked in driver using gcc, or any other compiler
# there, and have no intentions of finding out
SUBDIRS += c_src
endif
if MINGW
SUBDIRS += win32
endif
SUBDIRS += examples/src examples/ebin examples/include \
test doc man scripts www/code www/shoppingcart
EXTRA_DIST = ChangeLog known_dialyzer_warnings LICENSE \
README.md README.osx README.pkg-config \
rebar.config rebar.config.script two-mode-mode.el vsn.mk \
include.mk erlang_deps.mk ssl munin contrib www
if !MINGW
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = yaws.pc
endif
all-local:
clean-local:
$(AM_V_at)rm -f dialyzer_warnings
install-data-local: all
$(AM_V_at)$(INSTALL) -d $(DESTDIR)$(wwwdir)
$(AM_V_at)(cd @top_srcdir@; tar cf - www ) | (cd $(DESTDIR)$(wwwdir)/..; tar xf - )
$(AM_V_at)chmod -R u+rw $(DESTDIR)$(wwwdir)
$(AM_V_at)$(INSTALL) -d $(DESTDIR)$(logdir)
$(AM_V_at)$(INSTALL) -d $(DESTDIR)$(sysconfdir)/yaws
$(AM_V_at)$(INSTALL) -m 644 @srcdir@/ssl/yaws-cert.pem $(DESTDIR)$(sysconfdir)/yaws
$(AM_V_at)$(INSTALL) -m 644 @srcdir@/ssl/yaws-key.pem $(DESTDIR)$(sysconfdir)/yaws
$(AM_V_at)$(INSTALL) -m 644 @srcdir@/ssl/dhparams.pem $(DESTDIR)$(sysconfdir)/yaws
@echo "-------------------------------"
@echo
@echo "** etc files went into $(sysconfdir)"
@echo "** executables went into $(bindir)"
@echo "** library files went into $(ERLANG_INSTALL_LIB_DIR_yaws)"
@echo "** logs went into $(logdir)"
@echo "** doc files went into $(docdir)"
@echo "** man files went into $(mandir)"
@echo "** default docroot went into $(wwwdir)"
$(AM_V_at)if test $(yawsdir) != $(ERLANG_INSTALL_LIB_DIR_yaws); then \
echo; \
if test -d $(DESTDIR)$(yawsdir) && test ! -h $(DESTDIR)$(yawsdir); then \
backupdir="$(DESTDIR)$(yawsdir).backup"; \
echo "backup old yaws directory into $${backupdir}"; \
mv $(DESTDIR)$(yawsdir) $${backupdir}; \
else \
$(INSTALL) -d `dirname $(yawsdir)`; \
rm -f $(DESTDIR)$(yawsdir); \
fi; \
$(LN_S) -f $(ERLANG_INSTALL_LIB_DIR_yaws) $(DESTDIR)$(yawsdir); \
echo "create link $(ERLANG_INSTALL_LIB_DIR_yaws) -> $(yawsdir)"; \
fi
@echo
@echo "--------------------------------"
uninstall-local:
$(AM_V_at)(cd @top_srcdir@/www && find * -type f -exec rm -f $(DESTDIR)$(wwwdir)/{} \;)
$(AM_V_at)(cd @top_srcdir@/www && find * -type d -exec rm -fr $(DESTDIR)$(wwwdir)/{} \;)
$(AM_V_at)[ ! -h $(yawsdir) ] || rm -f $(DESTDIR)$(libdir)/yaws
$(AM_V_at)rm -r $(DESTDIR)$(sysconfdir)/yaws/yaws-cert.pem
$(AM_V_at)rm -r $(DESTDIR)$(sysconfdir)/yaws/yaws-key.pem
$(AM_V_at)rm -r $(DESTDIR)$(sysconfdir)/yaws/dhparams.pem
debug:
$(MAKE) DEBUG_ERLC_FLAGS=" -Ddebug" CFLAGS="-Werror -Wall -O0 -g"
docs: doc
doc:
$(AM_V_at)( cd doc && $(MAKE) doc )
test: check
list-checks:
$(AM_V_at)( cd test && $(MAKE) list-checks )
cleantest:
$(AM_V_at)( cd test && $(MAKE) clean )
# If dialyzer exits with status 2, it means it emitted warnings. In
# that case, exit with status 0 instead of failing the build, since
# warnings are typically inconsequential.
yaws.plt:
$(AM_V_GEN)$(DIALYZER) --build_plt -r ebin --output_plt yaws.plt\
-r $(ERLANG_LIB_DIR_kernel) \
-r $(ERLANG_LIB_DIR_stdlib) \
-r $(ERLANG_LIB_DIR_sasl) \
-r $(ERLANG_LIB_DIR_erts) \
-r $(ERLANG_LIB_DIR_compiler) \
-r $(ERLANG_LIB_DIR_crypto) \
-r $(ERLANG_LIB_DIR_xmerl) \
-r $$(echo $(ERLANG_LIB_DIR_ssl) | sed "s/not found//") \
-r $$(echo $(ERLANG_LIB_DIR_mnesia) | sed "s/not found//") \
-r $$(echo $(ERLANG_LIB_DIR_inets) | sed "s/not found//") \
-r $$(echo $(ERLANG_LIB_DIR_xmlrpc) | sed "s/not found//") \
-r $$(echo $(ERLANG_LIB_DIR_erlsom) | sed "s/not found//") ; \
[ $$? -eq 2 ] && exit 0 || exit $$?
dialyzer: all yaws.plt
$(AM_V_at)$(DIALYZER) -q --plt yaws.plt -r ebin | \
sed -e :a -e '$$!N;s/\n *//;ta' -e 'P;D' > dialyzer_warnings || true
$(AM_V_at)python3 dialyzer_checker
dist-hook: clean cleantest cleanapps
$(AM_V_at)for a in $(APPDIRS); do \
$(INSTALL) -d $(distdir)/$$a; \
(cd $$a && $(MAKE) top_distdir=../../$(distdir) \
distdir=../../$(distdir)/$$a distdir); \
done
find $(distdir) -type d -name .deps | xargs rm -rf
distclean-local:
$(AM_V_at)[ ! -h include/yaws.hrl ] || rm -f include/yaws.hrl
$(AM_V_at)[ ! -h include/yaws_api.hrl ] || rm -f include/yaws_api.hrl
$(AM_V_at)[ ! -h priv/mime.types ] || rm -f priv/mime.types
$(AM_V_at)for a in $(APPDIRS); do \
(cd $$a && $(MAKE) distclean); \
done
mkinstaller: cleaninstaller
$(AM_V_at)if [ -z "$(UNIX2DOS)" -a -z "$(TODOS)" ]; then \
echo "No unix2dos/todos program found"; \
echo "Run apt-get install dos2unix/tofrodos"; \
exit 1; \
fi
$(AM_V_at)if [ ! -d "$(INSTALL_BUILDER)" ]; then \
echo "No installer-builder found"; \
echo "For more information, read win32/README.developer"; \
exit 1; \
fi
$(AM_V_at)$(MAKE) distdir
$(AM_V_at)$(MKDIR_P) $(distdir)/_build
$(AM_V_at)(cd $(distdir)/_build && ../configure \
--host i586-mingw32msvc --prefix=/ --docdir=/doc --mandir=/man \
wwwdir=/www logdir=/logs yawsdir=/ confdir=/ appsdir=/applications \
yappdir=/applications/yapp INSTALL_BUILDER=$(INSTALL_BUILDER))
$(AM_V_at)(cd $(distdir)/_build && $(MAKE) install DESTDIR=@abs_builddir@/$(distdir)/_inst)
$(AM_V_at)(cd $(distdir)/_build && $(MAKE) installapps DESTDIR=@abs_builddir@/$(distdir)/_inst)
$(AM_V_at)(cd $(distdir)/_build/win32 && $(MAKE) mkinstaller DESTDIR=@abs_builddir@/$(distdir)/_inst)
$(AM_V_at)cp $(distdir)/*.exe @builddir@
$(AM_V_at)rm -fr $(distdir)
cleaninstaller:
$(AM_V_at)rm -f *.exe
$(AM_V_at)rm -fr $(distdir)
apps: $(APPDIRS)
$(APPDIRS):
$(AM_V_at)(cd $@ && $(MAKE) all)
cleanapps:
$(AM_V_at)for a in $(APPDIRS); do \
(cd $$a && $(MAKE) clean); \
done
installapps: apps
$(AM_V_at)$(INSTALL) -d $(DESTDIR)$(appsdir)
$(AM_V_at)for a in $(APPDIRS); do \
(cd $$a && $(MAKE) install); \
done
uninstallapps: apps
$(AM_V_at)for a in $(APPDIRS); do \
(cd $$a && $(MAKE) uninstall); \
done
fullinstall: install installapps
fulluninstall: uninstall uninstallapps
fullclean: clean cleantest cleaninstaller cleanapps
.PHONY: test doc $(APPDIRS)
# Local Variables:
# tab-width: 8
# End: