Fix building of server.html.h, move embed.js.h
This commit is contained in:
parent
45d9971aca
commit
8fd383115f
5 changed files with 27 additions and 22 deletions
27
Makefile.am
27
Makefile.am
|
@ -1,6 +1,31 @@
|
|||
SUBDIRS=src
|
||||
CLOSURE=java -jar $(srcdir)/lsp/closure-compiler.jar --warning_level QUIET
|
||||
EXTRA_DIST=server.html server.html.h VERSION lsp/*.js lsp/*.html lsp/*.css src/embed.js*
|
||||
SUBDIRS=. src
|
||||
BUILT_SOURCES=lsp/compressed.js server.html.h src/embed.js.h
|
||||
CLEANFILES=$(BUILT_SOURCES)
|
||||
docs:
|
||||
doxygen ./Doxyfile > /dev/null
|
||||
.PHONY: docs
|
||||
|
||||
SOURCES=server.html.h
|
||||
|
||||
lspSOURCES=$(srcdir)/lsp/jquery.js $(srcdir)/lsp/placeholder.js $(srcdir)/lsp/md5.js $(srcdir)/lsp/main.js $(srcdir)/lsp/functions.js
|
||||
lsp/compressed.js: $(lspSOURCES)
|
||||
-mkdir lsp
|
||||
$(CLOSURE) --js_output_file $@ $(lspSOURCES)
|
||||
src/embed.js.h: $(srcdir)/src/embed.js
|
||||
$(CLOSURE) --js_output_file embed.js $<
|
||||
xxd -i embed.js embed.js.h
|
||||
rm embed.js
|
||||
mv embed.js.h src/
|
||||
|
||||
server.html: lsp/compressed.js
|
||||
cat $(srcdir)/lsp/header.html lsp/compressed.js > $@
|
||||
echo "<script>" >> $@
|
||||
cat lsp/compressed.js >> $@
|
||||
echo "</script><style>" >> $@
|
||||
cat $(srcdir)/lsp/style.css >> $@
|
||||
echo "</style>" >> $@
|
||||
cat $(srcdir)/lsp/footer.html >> $@
|
||||
server.html.h: server.html
|
||||
xxd -i server.html server.html.h
|
||||
|
|
BIN
lsp/closure-compiler.jar
Normal file
BIN
lsp/closure-compiler.jar
Normal file
Binary file not shown.
Binary file not shown.
|
@ -1,23 +1,3 @@
|
|||
../lsp/uncompressed.js: ../lsp/jquery.js ../lsp/placeholder.js ../lsp/md5.js ../lsp/main.js ../lsp/functions.js
|
||||
cat ../lsp/jquery.js ../lsp/placeholder.js ../lsp/md5.js ../lsp/main.js ../lsp/functions.js > ../lsp/uncompressed.js
|
||||
../lsp/compressed.js: ../lsp/uncompressed.js
|
||||
echo "<script>" > ../lsp/compressed.js
|
||||
java -jar ../lsp/jscompiler.jar < ../lsp/uncompressed.js >> ../lsp/compressed.js
|
||||
echo "</script>" >> ../lsp/compressed.js
|
||||
../server.html: ../lsp/compressed.js
|
||||
cat ../lsp/header.html ../lsp/compressed.js > ../server.html
|
||||
echo "<style>" >> ../server.html
|
||||
cat ../lsp/style.css >> ../server.html
|
||||
echo "</style>" >> ../server.html
|
||||
cat ../lsp/footer.html >> ../server.html
|
||||
../server.html.h: ../server.html
|
||||
xxd -i ../server.html ../server.html.h
|
||||
./embed.js.h: ./embed.js
|
||||
mv embed.js tmp.js
|
||||
java -jar ../lsp/jscompiler.jar < tmp.js > embed.js
|
||||
xxd -i embed.js embed.js.h
|
||||
mv tmp.js embed.js
|
||||
|
||||
AM_CPPFLAGS = $(MIST_CFLAGS)
|
||||
LDADD = $(MIST_LIBS)
|
||||
SUBDIRS=converters analysers
|
||||
|
|
|
@ -503,7 +503,7 @@ int main(int argc, char ** argv){
|
|||
it->H.SetHeader("Content-Type", "text/html");
|
||||
it->H.SetHeader("X-Info", "To force an API response, request the file /api");
|
||||
it->H.SetHeader("Server", "mistserver/" PACKAGE_VERSION "/" + Util::Config::libver);
|
||||
it->H.SetBody(std::string((char*)___server_html, (size_t)___server_html_len));
|
||||
it->H.SetBody(std::string((char*)server_html, (size_t)server_html_len));
|
||||
it->C.Send(it->H.BuildResponse("200", "OK"));
|
||||
it->H.Clean();
|
||||
}else{
|
||||
|
|
Loading…
Add table
Reference in a new issue