From 2da23c36ede1762a07abd1ef86702b5d83dcae67 Mon Sep 17 00:00:00 2001 From: "Samuel A. Dieck" Date: Fri, 13 Feb 2015 00:12:43 -0600 Subject: [PATCH 1/2] Added makefile to upload files via luatool. --- makefile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 makefile diff --git a/makefile b/makefile new file mode 100644 index 0000000..f885fe9 --- /dev/null +++ b/makefile @@ -0,0 +1,30 @@ + +###################################################################### +# User configuration +###################################################################### +# Path to the tool and serial port +LUATOOL=./luatool/luatool/luatool.py +PORT=/dev/ttyUSB0 + +###################################################################### +# End of user config +###################################################################### +HTTP_FILES := $(wildcard http/*html) + +# Print usage +usage: + @echo "make upload_http to upload http files only" + @echo "make upload_program to upload init.lua and httpserver.lua" + @echo "make upload to upload all" + +# Upload HTTP files only +upload_http: $(HTTP_FILES) + $(foreach f, $^, $(LUATOOL) -f $(f) -t $(f) -p $(PORT);) + +# Upload httpserver lua files (init and server module) +upload_program: init.lua httpserver.lua + $(LUATOOL) -f init.lua -t init.lua -p $(PORT) + +# Upload all +upload: upload_http upload_program + From 44b40f00f3a13c04b048f005d7c3db476d66a0aa Mon Sep 17 00:00:00 2001 From: "Samuel A. Dieck" Date: Fri, 13 Feb 2015 00:19:26 -0600 Subject: [PATCH 2/2] Fixed upload_lua target in makefile --- makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index f885fe9..9256332 100644 --- a/makefile +++ b/makefile @@ -10,11 +10,12 @@ PORT=/dev/ttyUSB0 # End of user config ###################################################################### HTTP_FILES := $(wildcard http/*html) +LUA_FILES := init.lua httpserver.lua # Print usage usage: @echo "make upload_http to upload http files only" - @echo "make upload_program to upload init.lua and httpserver.lua" + @echo "make upload_lua to upload init.lua and httpserver.lua" @echo "make upload to upload all" # Upload HTTP files only @@ -22,9 +23,9 @@ upload_http: $(HTTP_FILES) $(foreach f, $^, $(LUATOOL) -f $(f) -t $(f) -p $(PORT);) # Upload httpserver lua files (init and server module) -upload_program: init.lua httpserver.lua - $(LUATOOL) -f init.lua -t init.lua -p $(PORT) +upload_lua: $(LUA_FILES) + $(foreach f, $^, $(LUATOOL) -f $(f) -t $(f) -p $(PORT);) # Upload all -upload: upload_http upload_program +upload: upload_http upload_lua