Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ######################################################################
  2. # Makefile 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=115200
  9. NODEMCU-COMMAND=$(NODEMCU-UPLOADER) -b $(SPEED) --start_baud $(SPEED) -p $(PORT) upload
  10. ######################################################################
  11. HTTP_FILES := $(wildcard http/*)
  12. LUA_FILES := $(wildcard *.lua)
  13. # Print usage
  14. usage:
  15. @echo "make upload FILE:=<file> to upload a specific file (i.e make upload FILE:=init.lua)"
  16. @echo "make upload_http to upload files to be served"
  17. @echo "make upload_server to upload the server code and init.lua"
  18. @echo "make upload_all to upload all"
  19. @echo $(TEST)
  20. # Upload one files only
  21. upload:
  22. @python $(NODEMCU-COMMAND) $(FILE)
  23. # Upload HTTP files only
  24. upload_http: $(HTTP_FILES)
  25. @python $(NODEMCU-COMMAND) $(foreach f, $^, $(f))
  26. # Upload httpserver lua files (init and server module)
  27. upload_server: $(LUA_FILES)
  28. @python $(NODEMCU-COMMAND) $(foreach f, $^, $(f))
  29. # Upload all
  30. upload_all: $(LUA_FILES) $(HTTP_FILES)
  31. @python $(NODEMCU-COMMAND) $(foreach f, $^, $(f))