Bundle server.html so it does not need to get rebuilt

Also remove CLOSUREJAR dependency. This gives less useful error messages, but
ah well...
This commit is contained in:
Peter Wu 2012-08-30 16:02:44 +02:00
parent 86fee22565
commit cdfd074a1b

View file

@ -2,7 +2,8 @@ lspdir=$(srcdir)/../lsp
CLOSUREJAR=$(lspdir)/closure-compiler.jar CLOSUREJAR=$(lspdir)/closure-compiler.jar
CLOSURE=java -jar $(CLOSUREJAR) --warning_level QUIET CLOSURE=java -jar $(CLOSUREJAR) --warning_level QUIET
BUILT_SOURCES=server.html.h embed.js.h BUILT_SOURCES=server.html.h embed.js.h
CLEANFILES=$(BUILT_SOURCES) server.html compressed.js # Do not clean below files, build machines do not have closure installed
EXTRA_DIST=server.html server.html.h embed.js.h
AM_CPPFLAGS = $(MIST_CFLAGS) AM_CPPFLAGS = $(MIST_CFLAGS)
LDADD = $(MIST_LIBS) LDADD = $(MIST_LIBS)
@ -21,19 +22,17 @@ MistConnHTTPDynamic_SOURCES=conn_http_dynamic.cpp ../VERSION
lspSOURCES=$(lspdir)/jquery.js $(lspdir)/placeholder.js $(lspdir)/md5.js $(lspdir)/main.js $(lspdir)/functions.js lspSOURCES=$(lspdir)/jquery.js $(lspdir)/placeholder.js $(lspdir)/md5.js $(lspdir)/main.js $(lspdir)/functions.js
lspDATA=$(lspdir)/header.html $(lspdir)/style.css $(lspdir)/footer.html lspDATA=$(lspdir)/header.html $(lspdir)/style.css $(lspdir)/footer.html
embed.js.h: $(srcdir)/embed.js $(CLOSUREJAR) embed.js.h: $(srcdir)/embed.js
$(CLOSURE) $< > embed.min.js $(CLOSURE) $< > embed.min.js
xxd -i embed.min.js | sed s/_min_/_/g > embed.js.h xxd -i embed.min.js | sed s/_min_/_/g > embed.js.h
rm embed.min.js rm embed.min.js
compressed.js: $(lspSOURCES) $(CLOSUREJAR)
-mkdir lsp
$(CLOSURE) $(lspSOURCES) > $@
server.html: compressed.js $(lspDATA) server.html: compressed.js $(lspDATA)
$(CLOSURE) $(lspSOURCES) > compressed.js
cat $(lspdir)/header.html > $@ cat $(lspdir)/header.html > $@
echo "<script>" >> $@ echo "<script>" >> $@
cat compressed.js >> $@ cat compressed.js >> $@
rm compressed.js
echo "</script><style>" >> $@ echo "</script><style>" >> $@
cat $(lspdir)/style.css >> $@ cat $(lspdir)/style.css >> $@
echo "</style>" >> $@ echo "</style>" >> $@