Files
onefinity-firmware/Makefile
muehe 41d720c1d0 kiosk: pi-friendly compact mode + chromium 72 fallbacks
- Detect kiosk mode (localhost / ?kiosk=1) and add html.kiosk-mode
- Suppress 3D path-viewer in kiosk mode (Pi 3B too slow)
- Compact 1366x768 layout: 56px header, smaller jog grid, 4-col macros
  2-col status, 540px jog column
- Flex-gap fallbacks for Chromium 72 (header tabs, sys-btn, state-badge,
  ktab, sp-row, etc.) using "> * + *" margin-* rules
- Path-viewer: opaque WebGL canvas, ResizeObserver-gated render loop,
  no first-frame size flash
- Path-viewer renderer cleared properly on component teardown
- W axis row: W- | W+ | Probe XYZ | Probe Z (was W-|HomeW|W+|Probe)
- Running panel only for actual program execution (not jogging)
- Settings sectioned (Display+Units / Probing / G-code+Motion)
- Routed component now keep-alive across tab swaps
- FA4 -> FA6 webfonts
2026-05-01 11:05:39 +02:00

110 lines
3.2 KiB
Makefile

DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
NODE_MODS := $(DIR)/node_modules
PUG := $(NODE_MODS)/.bin/pug
STYLUS := $(NODE_MODS)/.bin/stylus
TARGET_DIR := build/http
HTML := index
HTML := $(patsubst %,$(TARGET_DIR)/%.html,$(HTML))
RESOURCES := $(shell find src/resources -type f)
RESOURCES := $(patsubst src/resources/%,$(TARGET_DIR)/%,$(RESOURCES))
TEMPLS := $(wildcard src/pug/templates/*.pug)
AVR_FIRMWARE := src/avr/bbctrl-avr-firmware.hex
GPLAN_MOD := rpi-share/camotics/gplan.so
GPLAN_TARGET := src/py/camotics/gplan.so
GPLAN_IMG := gplan-dev.img
RSYNC_EXCLUDE := \*.pyc __pycache__ \*.egg-info \\\#* \*~ .\\\#\*
RSYNC_EXCLUDE := $(patsubst %,--exclude %,$(RSYNC_EXCLUDE))
RSYNC_OPTS := $(RSYNC_EXCLUDE) -rv --no-g --delete --force
VERSION := $(shell sed -n 's/^.*"version": "\([^"]*\)",.*$$/\1/p' package.json)
PKG_NAME := bbctrl-$(VERSION)
SUBPROJECTS := avr boot pwr jig
ifndef HOST
HOST=onefinity.local
endif
ifndef PASSWORD
PASSWORD=onefinity
endif
all: $(HTML) $(RESOURCES)
@for SUB in $(SUBPROJECTS); do $(MAKE) -C src/$$SUB; done
pkg: all $(AVR_FIRMWARE) bbserial
./setup.py sdist
bbserial:
$(MAKE) -C src/bbserial
gplan: $(GPLAN_TARGET)
$(GPLAN_TARGET): $(GPLAN_MOD)
cp $< $@
$(GPLAN_MOD): $(GPLAN_IMG)
./scripts/gplan-init-build.sh
cp ./scripts/gplan-build.sh rpi-share/
chmod +x rpi-share/gplan-build.sh
sudo ./scripts/rpi-chroot.sh $(GPLAN_IMG) /mnt/host/gplan-build.sh
$(GPLAN_IMG):
./scripts/gplan-init-build.sh
.PHONY: $(AVR_FIRMWARE)
$(AVR_FIRMWARE):
$(MAKE) -C src/avr
update: pkg
http_proxy= curl -i -X PUT -H "Content-Type: multipart/form-data" \
-F "firmware=@dist/$(PKG_NAME).tar.bz2" -F "password=$(PASSWORD)" \
http://$(HOST)/api/firmware/update
@-tput sgr0 && echo # Fix terminal output
build/templates.pug: $(TEMPLS)
mkdir -p build
# Use awk to ensure each template is followed by a newline so the
# next file's first line never gets glued onto the previous file's
# last line (some templates ship without a trailing newline, which
# would produce subtle Pug parse failures).
awk 'FNR==1 && NR>1 {print ""} {print} END{print ""}' $(TEMPLS) >$@
node_modules: package.json
npm install && touch node_modules
$(TARGET_DIR)/%: src/resources/%
install -D $< $@
src/svelte-components/dist/%:
cd src/svelte-components && rm -rf dist && npm run build
$(TARGET_DIR)/index.html: build/templates.pug
$(TARGET_DIR)/index.html: $(wildcard src/static/js/*)
$(TARGET_DIR)/index.html: $(wildcard src/static/css/*)
$(TARGET_DIR)/index.html: $(wildcard src/pug/templates/*)
$(TARGET_DIR)/index.html: $(wildcard src/js/*)
$(TARGET_DIR)/index.html: $(wildcard src/stylus/*)
$(TARGET_DIR)/index.html: src/resources/config-template.json
$(TARGET_DIR)/index.html: $(wildcard src/resources/onefinity*defaults.json)
$(TARGET_DIR)/index.html: $(wildcard src/svelte-components/dist/*)
FORCE:
$(TARGET_DIR)/%.html: src/pug/%.pug node_modules FORCE
cd src/svelte-components && rm -rf dist && npm run build
@mkdir -p $(TARGET_DIR)/svelte-components
cp src/svelte-components/dist/* $(TARGET_DIR)/svelte-components/
@mkdir -p $(TARGET_DIR)
$(PUG) -O pug-opts.js -P $< -o $(TARGET_DIR) || (rm -f $@; exit 1)
clean:
rm -rf rpi-share
git clean -fxd
.PHONY: all install clean tidy pkg gplan lint pylint jshint bbserial