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/ html_compressed/
ldscript_memspecific.ld ldscript_memspecific.ld
eagle.app.sym eagle.app.sym
*~
# html
.sass-cache .sass-cache
node_modules node_modules
build/ build/

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

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

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

Loading…
Cancel
Save