makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. ######################################################################
  2. # User configuration
  3. ######################################################################
  4. # Path to nodemcu-uploader (https://github.com/kmpm/nodemcu-uploader)
  5. NODEMCU-UPLOADER=../nodemcu-uploader/nodemcu-uploader.py
  6. # Serial port
  7. PORT=/dev/cu.usbserial-A602HRAZ
  8. # Bauds for the serial connection
  9. SPEED=115200
  10. ######################################################################
  11. # End of user config
  12. ######################################################################
  13. HTTP_FILES := $(wildcard http/*)
  14. LUA_FILES := init.lua httpserver.lua httpserver-request.lua httpserver-static.lua httpserver-error.lua
  15. # Print usage
  16. usage:
  17. @echo "make upload_http to upload files to be served"
  18. @echo "make upload_server to upload the server code and init.lua"
  19. @echo "make upload to upload all"
  20. # Upload HTTP files only
  21. upload_http: $(HTTP_FILES)
  22. @$(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(foreach f, $^, $(f))
  23. # Upload httpserver lua files (init and server module)
  24. upload_server: $(LUA_FILES)
  25. @$(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(foreach f, $^, $(f))
  26. # Upload all
  27. upload: $(LUA_FILES) $(HTTP_FILES)
  28. @$(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(foreach f, $^, $(f))