WebInterface: Makefile

File Makefile, 3.1 KB (added by manualwiki, 6 years ago)

Makefile for Yaws-1.96 for users who are using Erlang/OTP-R16B01

Line 
1include ../include.mk
2
3ifeq ($(TYPE),debug)
4DEBUG_FLAGS = -Ddebug +debug_info
5else
6DEBUG_FLAGS =
7endif
8
9include ../vsn.mk
10VSN=$(YAWS_VSN)
11
12
13## the websocket code uses new modern bits stuff
14ifeq ($(BITS_SUPPORT),true)
15BITSMODS=yaws_websockets
16endif
17
18
19MODULES=yaws \
20        yaws_app \
21        yaws_ticker \
22        yaws_config \
23        yaws_server \
24        yaws_sup \
25        yaws_api \
26        yaws_log \
27        yaws_trace \
28        yaws_logger \
29        yaws_ls \
30        yaws_debug \
31        yaws_compile \
32        yaws_ctl \
33        yaws_cgi \
34        yaws_zlib \
35        yaws_generated \
36        mime_type_c \
37        mime_types \
38        yaws_session_server \
39        yaws_outmod \
40        yaws_revproxy \
41        yaws_html  \
42        yaws_log_file_h \
43        yaws_rss \
44        yaws_dav \
45        yaws_davlock \
46        yaws_pam \
47        json json2 jsonrpc yaws_jsonrpc yaws_xmlrpc\
48        haxe yaws_rpc \
49        yaws_soap_srv yaws_soap_lib yaws_soap12_lib \
50        authmod_gssapi \
51        yaws_appmod_cgi \
52        yaws_appmod_fcgi \
53        yaws_sendfile \
54        yaws_sup_restarts \
55        yaws_stats \
56        yaws_vdir \
57        yaws_multipart \
58        yaws_shaper \
59        yaws_dime \
60        yaws_exhtml \
61        yaws_sse \
62        $(BITSMODS)
63
64
65
66EBIN_FILES=$(MODULES:%=../ebin/%.$(EMULATOR)) ../ebin/yaws.app ../ebin/yaws.appup
67ERLC_FLAGS+=-W $(DEBUG_FLAGS) -pa ../../yaws -I ../include
68
69#
70# Targets
71#
72all: yaws_generated.erl yaws_configure.hrl $(EBIN_FILES)
73
74dav:
75        $(MAKE) MODULES="$(MODULES) yaws_dav"
76
77$(EBIN_FILES) : ../include/yaws.hrl ../include/yaws_api.hrl
78
79../ebin/yaws_sendfile.$(EMULATOR): yaws_configure.hrl
80
81yaws_generated.erl:     yaws_generated.template ../vsn.mk
82        $(MAKE) IS_LOCAL_INSTALL=true gen_yaws_generated
83
84yaws_configure.hrl:      ../vsn.mk ../include.mk
85        if [  $(HAVE_YAWS_SENDFILE) = "true" ]; then \
86                echo "-define(HAVE_YAWS_SENDFILE, true)." > yaws_configure.hrl; \
87        else touch yaws_configure.hrl; fi
88
89mime_types.erl: ../priv/charset.def ../priv/mime.types \
90                                ../ebin/yaws_generated.$(EMULATOR) ../ebin/mime_type_c.$(EMULATOR)
91        $(ERL) -noshell -pa ../ebin -s mime_type_c generate
92
93
94debug:
95        $(MAKE) TYPE=debug
96
97clean:
98        rm -f $(EBIN_FILES) yaws_generated.erl yaws_configure.hrl mime_types.erl
99
100install: all docsinstall
101        $(MAKE) IS_LOCAL_INSTALL=false gen_yaws_generated
102        $(INSTALL) -d $(DESTDIR)$(LIBDIR)/yaws/examples/ebin
103        $(INSTALL) -d $(DESTDIR)$(LIBDIR)/yaws/examples/include
104        $(INSTALL) -d $(DESTDIR)$(LIBDIR)/yaws/ebin
105        $(INSTALL) -d $(DESTDIR)$(LIBDIR)/yaws/priv
106        $(INSTALL) -d $(DESTDIR)$(VARDIR)/log/yaws
107        $(INSTALL) -d $(DESTDIR)$(VARDIR)/yaws/ebin
108        (cd ..; tar cf - ebin ) | (cd $(DESTDIR)$(LIBDIR)/yaws; tar xf - )
109        (cd ..; tar cf - include ) | (cd $(DESTDIR)$(LIBDIR)/yaws; tar xf - )
110        (cd ..; tar cf - priv/*.xsd ) | (cd $(DESTDIR)$(LIBDIR)/yaws; tar xf - )
111        $(INSTALL) -m 644 ../priv/mime.types  $(DESTDIR)$(LIBDIR)/yaws/priv
112        $(MAKE) IS_LOCAL_INSTALL=true gen_yaws_generated
113
114docsinstall:
115        $(INSTALL) -d $(DESTDIR)$(VARDIR)/yaws/www
116        (cd ..; tar cf - www ) | (cd $(DESTDIR)$(VARDIR)/yaws; tar xf - )
117
118tags:
119        erl  -noshell -pa ../ebin -s yaws_debug mktags
120
121xref:
122        erl -noshell -pa ../ebin -s yaws_debug xref ../ebin
123
124
125
126## need to differentiate between local install and not
127gen_yaws_generated:
128        rm -f yaws_generated.erl ../ebin/yaws_generated.$(EMULATOR)
129        YAWS_VSN='$(YAWS_VSN)' VARDIR='$(VARDIR)' ETCDIR='$(ETCDIR)' \
130            ../scripts/gen-yaws-generated $(IS_LOCAL_INSTALL) > yaws_generated.erl
131        $(MAKE) ../ebin/yaws_generated.$(EMULATOR)
132