diff --git a/Makefile.am b/Makefile.am
index 906ba04e..e0cafe66 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,31 +1,7 @@
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)
+EXTRA_DIST=VERSION lsp/jquery.js lsp/placeholder.js lsp/md5.js lsp/main.js lsp/functions.js
+EXTRA_DIST+=lsp/header.html lsp/footer.html lsp/style.css src/embed.js
+SUBDIRS=src
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 "" >> $@
- cat $(srcdir)/lsp/footer.html >> $@
-server.html.h: server.html
- xxd -i server.html server.html.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 69c1e0c9..a1bac5c7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,10 +1,16 @@
+lspdir=$(srcdir)/../lsp
+CLOSUREJAR=$(lspdir)/closure-compiler.jar
+CLOSURE=java -jar $(CLOSUREJAR) --warning_level QUIET
+BUILT_SOURCES=server.html.h embed.js.h
+CLEANFILES=$(BUILT_SOURCES) server.html compressed.js
+
AM_CPPFLAGS = $(MIST_CFLAGS)
LDADD = $(MIST_LIBS)
SUBDIRS=converters analysers
bin_PROGRAMS=MistBuffer MistController MistConnRAW MistConnRTMP MistConnHTTP MistConnHTTPProgressive MistConnHTTPDynamic
MistBuffer_SOURCES=buffer.cpp buffer_user.h buffer_user.cpp buffer_stream.h buffer_stream.cpp tinythread.cpp tinythread.h ../VERSION
MistBuffer_LDADD=$(MIST_LIBS) -lpthread
-MistController_SOURCES=controller.cpp ../VERSION ../server.html.h
+MistController_SOURCES=controller.cpp ../VERSION ./server.html.h
MistConnRAW_SOURCES=conn_raw.cpp ../VERSION
MistConnRTMP_SOURCES=conn_rtmp.cpp ../VERSION
MistConnHTTP_SOURCES=conn_http.cpp tinythread.cpp tinythread.h ../VERSION ./embed.js.h
@@ -12,3 +18,26 @@ MistConnHTTP_LDADD=$(MIST_LIBS) -lpthread
MistConnHTTPProgressive_SOURCES=conn_http_progressive.cpp ../VERSION
MistConnHTTPDynamic_SOURCES=conn_http_dynamic.cpp ../VERSION
+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
+
+embed.js.h: $(srcdir)/embed.js $(CLOSUREJAR)
+ $(CLOSURE) $< > embed.min.js
+ xxd -i embed.min.js | sed s/_min_/_/g > embed.js.h
+ rm embed.min.js
+
+compressed.js: $(lspSOURCES) $(CLOSUREJAR)
+ -mkdir lsp
+ $(CLOSURE) $(lspSOURCES) > $@
+
+server.html: compressed.js $(lspDATA)
+ cat $(lspdir)/header.html > $@
+ echo "" >> $@
+ cat $(lspdir)/footer.html >> $@
+
+server.html.h: server.html
+ xxd -i server.html server.html.h
diff --git a/src/controller.cpp b/src/controller.cpp
index c03ca30e..7468f558 100644
--- a/src/controller.cpp
+++ b/src/controller.cpp
@@ -30,7 +30,7 @@
#include
#include
#include
-#include "../server.html.h"
+#include "server.html.h"
#define UPLINK_INTERVAL 30
#define COMPILED_USERNAME ""