added html building support straight in the makefile

master
Ondřej Hruška 9 years ago
parent 4a3c814e57
commit d41d080a70
  1. 2
      .gitignore
  2. 6
      Makefile
  3. 11
      html_build.sh
  4. 2
      html_src/home.php

2
.gitignore vendored

@ -9,7 +9,9 @@ espfs/espfstest/espfstest
html_compressed/
ldscript_memspecific.ld
eagle.app.sym
*~
# html
.sass-cache
node_modules
build/

@ -185,7 +185,7 @@ endef
.PHONY: all checkdirs clean libesphttpd default-tgt
all: checkdirs $(TARGET_OUT) $(FW_BASE)
all: checkdirs htmlbuild $(TARGET_OUT) $(FW_BASE)
$(Q) echo -e "\nBuild OK.\n"
# libesphttpd/Makefile:
@ -193,6 +193,10 @@ all: checkdirs $(TARGET_OUT) $(FW_BASE)
# $(Q) git submodule init
# $(Q) git submodule update
htmlbuild:
$(vecho) "Building HTML..."
$(Q) ./html_build.sh
libesphttpd: libesphttpd/Makefile
$(Q) make -C libesphttpd USE_OPENSDK=$(USE_OPENSDK)

@ -1,5 +1,8 @@
#!/bin/bash
set -e
set -x
SRCDIR=html_src
BLDDIR=html
@ -12,10 +15,12 @@ gulp
cd ..
cp -R "$SRCDIR/css" "$BLDDIR"
cp -R "$SRCDIR/images" "$BLDDIR"
cp -R "$SRCDIR/js" "$BLDDIR"
find "$BLDDIR" -name "*.map" -delete
php "$SRCDIR/home.php" > "$BLDDIR/home.tpl"
php "$SRCDIR/wifi.php" > "$BLDDIR/wifi.tpl"
mkdir -p "$BLDDIR/pages"
php "$SRCDIR/home.php" > "$BLDDIR/pages/home.tpl"
php "$SRCDIR/wifi.php" > "$BLDDIR/pages/wifi.tpl"

@ -2,6 +2,6 @@
<h1>System Status</h1>
<div class="Box">TODO</div>
<div class="Box">This page was shown %counter% times.</div>
<?php include "_end.php"; ?>

Loading…
Cancel
Save