From 1c6ea921b415e9ee60deac3ba1bfe8318d07200d Mon Sep 17 00:00:00 2001 From: Atirut Wattanamongkol Date: Fri, 16 Apr 2021 19:24:54 +0700 Subject: [PATCH] Install target for Linux --- Makefile | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 91398b4..2cff6f7 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,27 @@ ifeq ($(OS),Windows_NT) - # If you're using Windows, change the path to wherever you put LuaComp in. - COMMAND = lua53 "./luacomp.lua" - # COMMAND = lua53 "C:/Standalone Programs/luacomp.lua" +# If you're using Windows, change the path to wherever you put LuaComp in. +COMMAND = lua53 "./luacomp.lua" +# COMMAND = lua53 "C:/Standalone Programs/luacomp.lua" else - - COMMAND = luacomp +COMMAND = luacomp endif build: @echo Building LuaComp... @${COMMAND} ./src/init.lua -O ./luacomp.lua +install: +ifeq ($(OS),Windows_NT) + @echo Installing is not supported on Windows +else + @echo Installing LuaComp... + @echo "#!/usr/bin/env lua5.3" | cat - ./luacomp.lua > ~/bin/luacomp + @chmod +x ~/bin/luacomp +endif + clean: - ifeq ($(OS),Windows_NT) - rmdir build /s /q - else - rm -rf build - endif +ifeq ($(OS),Windows_NT) + @rmdir build /s /q +else + @rm -rf build +endif