Skip to content

Instantly share code, notes, and snippets.

@spro
Created November 4, 2020 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spro/6139930fd9bfb6b240dfe4078b8c9f21 to your computer and use it in GitHub Desktop.
Save spro/6139930fd9bfb6b240dfe4078b8c9f21 to your computer and use it in GitHub Desktop.
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