Made wildcards recursive and fixed default PREFIX

This commit is contained in:
Bruce Hill 2019-01-04 14:50:51 -08:00
parent 0507d8de8c
commit 467d6457f3

View File

@ -16,9 +16,9 @@ MOON_FILES= code_obj.moon error_handling.moon files.moon nomsu.moon nomsu_compil
LUA_FILES= code_obj.lua consolecolors.lua error_handling.lua files.lua nomsu.lua nomsu_compiler.lua \ LUA_FILES= code_obj.lua consolecolors.lua error_handling.lua files.lua nomsu.lua nomsu_compiler.lua \
syntax_tree.lua containers.lua bitops.lua parser.lua pretty_errors.lua \ syntax_tree.lua containers.lua bitops.lua parser.lua pretty_errors.lua \
string2.lua nomsu_decompiler.lua nomsu_environment.lua importer.lua string2.lua nomsu_decompiler.lua nomsu_environment.lua importer.lua
CORE_NOM_FILES= $(wildcard core/*.nom) CORE_NOM_FILES= $(wildcard core/**.nom)
CORE_LUA_FILES= $(patsubst %.nom,%.lua,$(CORE_NOM_FILES)) CORE_LUA_FILES= $(patsubst %.nom,%.lua,$(CORE_NOM_FILES))
LIB_NOM_FILES= $(wildcard lib/*.nom) LIB_NOM_FILES= $(wildcard lib/**.nom)
LIB_LUA_FILES= $(patsubst %.nom,%.lua,$(LIB_NOM_FILES)) LIB_LUA_FILES= $(patsubst %.nom,%.lua,$(LIB_NOM_FILES))
PEG_FILES= $(wildcard nomsu.*.peg) PEG_FILES= $(wildcard nomsu.*.peg)
GET_VERSION= $(LUA_BIN) nomsu.lua --version GET_VERSION= $(LUA_BIN) nomsu.lua --version
@ -50,7 +50,7 @@ optimize: lua $(CORE_LUA_FILES) $(LIB_LUA_FILES)
.PHONY: clean .PHONY: clean
clean: clean:
@echo "\033[1mDeleting...\033[0m" @echo "\033[1mDeleting...\033[0m"
@rm -rvf version core/*.lua lib/*.lua tools/*.lua compatibility/*.lua @rm -rvf version core/**.lua lib/**.lua tools/**.lua compatibility/**.lua
.PHONY: install .PHONY: install
install: lua version optimize install: lua version optimize
@ -58,6 +58,9 @@ install: lua version optimize
if [[ ! $$prefix ]]; then \ if [[ ! $$prefix ]]; then \
read -p $$'\033[1mWhere do you want to install Nomsu? (default: /usr/local) \033[0m' prefix; \ read -p $$'\033[1mWhere do you want to install Nomsu? (default: /usr/local) \033[0m' prefix; \
fi; \ fi; \
if [[ ! $$prefix ]]; then \
prefix="/usr/local"; \
fi; \
if [[ $$prefix != "`realpath $$prefix`" ]]; then \ if [[ $$prefix != "`realpath $$prefix`" ]]; then \
echo $$'\033[1;31mWarning: '$$prefix$$' is not an absolute path. This may cause problems.\033[0m'; \ echo $$'\033[1;31mWarning: '$$prefix$$' is not an absolute path. This may cause problems.\033[0m'; \
read -p $$'\033[1mWould you rather use '`realpath $$prefix`$$' instead? (recommended)[Y/n]\033[0m ' use_real; \ read -p $$'\033[1mWould you rather use '`realpath $$prefix`$$' instead? (recommended)[Y/n]\033[0m ' use_real; \
@ -79,6 +82,9 @@ uninstall: version
if [[ ! $$prefix ]]; then \ if [[ ! $$prefix ]]; then \
read -p $$'\033[1mWhere do you want to uninstall Nomsu from? (default: /usr/local) \033[0m' prefix; \ read -p $$'\033[1mWhere do you want to uninstall Nomsu from? (default: /usr/local) \033[0m' prefix; \
fi; \ fi; \
if [[ ! $$prefix ]]; then \
prefix="/usr/local"; \
fi; \
echo "\033[1mNomsu will be uninstalled from:\033[0m"; \ echo "\033[1mNomsu will be uninstalled from:\033[0m"; \
echo " $$prefix/bin"; \ echo " $$prefix/bin"; \
echo " $$prefix/lib"; \ echo " $$prefix/lib"; \