makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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. ######################################################################
  9. # End of user config
  10. ######################################################################
  11. HTTP_FILES := $(wildcard http/*)
  12. LUA_FILES := init.lua httpserver.lua httpserver-static.lua httpserver-error.lua
  13. # Print usage
  14. usage:
  15. @echo "make upload_http to upload files to be served"
  16. @echo "make upload_server to upload the server code and init.lua"
  17. @echo "make upload to upload all"
  18. # Upload HTTP files only
  19. upload_http: $(HTTP_FILES)
  20. @$(NODEMCU-UPLOADER) -p $(PORT) upload $(foreach f, $^, -f $(f) -d $(f))
  21. # Upload httpserver lua files (init and server module)
  22. upload_server: $(LUA_FILES)
  23. @$(NODEMCU-UPLOADER) -p $(PORT) upload $(foreach f, $^, -f $(f) -d $(f))
  24. # Upload all
  25. upload: $(LUA_FILES) $(HTTP_FILES)
  26. @$(NODEMCU-UPLOADER) -p $(PORT) upload $(foreach f, $^, -f $(f) -d $(f))