Makefile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.SLAB_USBtoUART
  8. SPEED=9600
  9. ######################################################################
  10. # End of user config
  11. ######################################################################
  12. HTTP_FILES := $(wildcard http/*)
  13. LUA_FILES := \
  14. init.lua \
  15. httpserver.lua \
  16. httpserver-b64decode.lua \
  17. httpserver-basicauth.lua \
  18. httpserver-conf.lua \
  19. httpserver-connection.lua \
  20. httpserver-error.lua \
  21. httpserver-header.lua \
  22. httpserver-request.lua \
  23. httpserver-static.lua \
  24. # Print usage
  25. usage:
  26. @echo "make upload FILE:=<file> to upload a specific file (i.e make upload FILE:=init.lua)"
  27. @echo "make upload_http to upload files to be served"
  28. @echo "make upload_server to upload the server code and init.lua"
  29. @echo "make upload_all to upload all"
  30. @echo $(TEST)
  31. # Upload one files only
  32. upload:
  33. @python $(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(FILE)
  34. # Upload HTTP files only
  35. upload_http: $(HTTP_FILES)
  36. @python $(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(foreach f, $^, $(f))
  37. # Upload httpserver lua files (init and server module)
  38. upload_server: $(LUA_FILES)
  39. @python $(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(foreach f, $^, $(f))
  40. # Upload all
  41. upload_all: $(LUA_FILES) $(HTTP_FILES)
  42. @python $(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(foreach f, $^, $(f))