Skip to content

Instantly share code, notes, and snippets.

@spro
Created November 4, 2020 05:19
Embed
What would you like to do?
Example makefile for ESP8266/ESP32 with NodeMCU
PORT=/dev/cu.usbserial-AL00FP1H
LUAS=name.lc helpers.lc sta.lc blink.lc tcpclient.lc ir.lc
all: name init $(LUAS)
init:
nodemcu-tool -p $(PORT) upload init.lua
name:
@[ "${DEVICE_NAME}" ] || ( echo ">> DEVICE_NAME is not set"; exit 1 )
echo "DEVICE_NAME = '$(DEVICE_NAME)'" > name.lua
nodemcu-tool -p $(PORT) upload --minify --compile name.lua
%.lc: %.lua
nodemcu-tool -p $(PORT) upload --minify --compile $<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment