aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-01-26 17:45:26 +0800
committerLi Jin <dragon-fly@qq.com>2026-01-26 17:45:56 +0800
commite02321107277a63e7dcb12ab163c9942ac101b87 (patch)
treef38c6f2fbf4ee35df4938933dbc1e645733356f4 /makefile
parent5d5b657f606b5939062983b1f90c3359d542672e (diff)
downloadyuescript-e02321107277a63e7dcb12ab163c9942ac101b87.tar.gz
yuescript-e02321107277a63e7dcb12ab163c9942ac101b87.tar.bz2
yuescript-e02321107277a63e7dcb12ab163c9942ac101b87.zip
Updated tests.
Diffstat (limited to 'makefile')
-rw-r--r--makefile37
1 files changed, 20 insertions, 17 deletions
diff --git a/makefile b/makefile
index 3220aa5..09aa86d 100644
--- a/makefile
+++ b/makefile
@@ -63,25 +63,25 @@ ANDROID_ROOT_VAR := $(shell echo $$ANDROID_ROOT)
63PREFIX_VAR := $(shell echo $$PREFIX) 63PREFIX_VAR := $(shell echo $$PREFIX)
64ifneq ($(ANDROID_ROOT_VAR),) 64ifneq ($(ANDROID_ROOT_VAR),)
65 # Check if PREFIX environment variable points to Termux directory 65 # Check if PREFIX environment variable points to Termux directory
66ifneq ($(PREFIX_VAR),) 66 ifneq ($(PREFIX_VAR),)
67ifneq ($(findstring com.termux,$(PREFIX_VAR)),) 67 ifneq ($(findstring com.termux,$(PREFIX_VAR)),)
68 IS_TERMUX := true 68 IS_TERMUX := true
69endif 69 endif
70endif 70 endif
71 # Alternative check: verify if Termux installation path exists 71 # Alternative check: verify if Termux installation path exists
72ifeq ($(IS_TERMUX),false) 72 ifeq ($(IS_TERMUX),false)
73ifneq ($(shell test -d /data/data/com.termux/files/usr && echo yes),) 73 ifneq ($(shell test -d /data/data/com.termux/files/usr && echo yes),)
74 IS_TERMUX := true 74 IS_TERMUX := true
75endif 75 endif
76endif 76 endif
77endif 77endif
78 78
79# Auto-set NO_WATCHER for Termux environment if not explicitly set 79# Auto-set NO_WATCHER for Termux environment if not explicitly set
80ifeq ($(IS_TERMUX),true) 80ifeq ($(IS_TERMUX),true)
81ifeq ($(NO_WATCHER),) 81 ifeq ($(NO_WATCHER),)
82 NO_WATCHER := true 82 NO_WATCHER := true
83$(info Detected Android Termux environment, automatically setting NO_WATCHER=true) 83 $(info Detected Android Termux environment, automatically setting NO_WATCHER=true)
84endif 84 endif
85endif 85endif
86 86
87ifeq ($(NO_WATCHER),true) 87ifeq ($(NO_WATCHER),true)
@@ -192,9 +192,9 @@ ifeq ($(UNAME_S),Darwin)
192 $(RM) $(TIME_FILE) ; \ 192 $(RM) $(TIME_FILE) ; \
193 st=$$((`$(CUR_TIME)` - $$st)) ; \ 193 st=$$((`$(CUR_TIME)` - $$st)) ; \
194 echo $$st 194 echo $$st
195ifneq ($(NO_WATCHER),true) 195 ifneq ($(NO_WATCHER),true)
196 SOURCES += $(SRC_PATH)/3rdParty/efsw/FileWatcherFSEvents.cpp $(SRC_PATH)/3rdParty/efsw/FileWatcherKqueue.cpp $(SRC_PATH)/3rdParty/efsw/WatcherFSEvents.cpp $(SRC_PATH)/3rdParty/efsw/WatcherKqueue.cpp 196 SOURCES += $(SRC_PATH)/3rdParty/efsw/FileWatcherFSEvents.cpp $(SRC_PATH)/3rdParty/efsw/FileWatcherKqueue.cpp $(SRC_PATH)/3rdParty/efsw/WatcherFSEvents.cpp $(SRC_PATH)/3rdParty/efsw/WatcherKqueue.cpp
197endif 197 endif
198else 198else
199 TIME_FILE = $(dir $@).$(notdir $@)_time 199 TIME_FILE = $(dir $@).$(notdir $@)_time
200 START_TIME = date '+%s' > $(TIME_FILE) 200 START_TIME = date '+%s' > $(TIME_FILE)
@@ -202,9 +202,9 @@ else
202 $(RM) $(TIME_FILE) ; \ 202 $(RM) $(TIME_FILE) ; \
203 st=$$((`date '+%s'` - $$st - 86400)) ; \ 203 st=$$((`date '+%s'` - $$st - 86400)) ; \
204 echo `date -u -d @$$st '+%H:%M:%S'` 204 echo `date -u -d @$$st '+%H:%M:%S'`
205ifneq ($(NO_WATCHER),true) 205 ifneq ($(NO_WATCHER),true)
206 SOURCES += $(SRC_PATH)/3rdParty/efsw/FileWatcherFSEvents.cpp $(SRC_PATH)/3rdParty/efsw/FileWatcherKqueue.cpp $(SRC_PATH)/3rdParty/efsw/WatcherFSEvents.cpp $(SRC_PATH)/3rdParty/efsw/WatcherKqueue.cpp $(SRC_PATH)/3rdParty/efsw/FileWatcherInotify.cpp $(SRC_PATH)/3rdParty/efsw/WatcherInotify.cpp 206 SOURCES += $(SRC_PATH)/3rdParty/efsw/FileWatcherFSEvents.cpp $(SRC_PATH)/3rdParty/efsw/FileWatcherKqueue.cpp $(SRC_PATH)/3rdParty/efsw/WatcherFSEvents.cpp $(SRC_PATH)/3rdParty/efsw/WatcherKqueue.cpp $(SRC_PATH)/3rdParty/efsw/FileWatcherInotify.cpp $(SRC_PATH)/3rdParty/efsw/WatcherInotify.cpp
207endif 207 endif
208endif 208endif
209 209
210# Version macros 210# Version macros
@@ -437,6 +437,7 @@ test: debug
437 @./$(BIN_NAME) $(TEST_INPUT)/attrib.yue -o $(TEST_OUTPUT)/5.1/attrib.lua --target 5.1 437 @./$(BIN_NAME) $(TEST_INPUT)/attrib.yue -o $(TEST_OUTPUT)/5.1/attrib.lua --target 5.1
438 @./$(BIN_NAME) $(TEST_INPUT)/import_global.yue -o $(TEST_OUTPUT)/5.1/import_global.lua --target 5.1 438 @./$(BIN_NAME) $(TEST_INPUT)/import_global.yue -o $(TEST_OUTPUT)/5.1/import_global.lua --target 5.1
439 @./$(BIN_NAME) $(TEST_INPUT)/test/loops_spec.yue -o $(TEST_OUTPUT)/5.1/test/loops_spec.lua --target 5.1 439 @./$(BIN_NAME) $(TEST_INPUT)/test/loops_spec.yue -o $(TEST_OUTPUT)/5.1/test/loops_spec.lua --target 5.1
440 @./$(BIN_NAME) $(TEST_INPUT)/test/try_catch_spec.yue -o $(TEST_OUTPUT)/5.1/test/try_catch_spec.lua --target 5.1
440 @./$(BIN_NAME) -e spec/inputs/compile_doc.yue $(TEST_OUTPUT) 441 @./$(BIN_NAME) -e spec/inputs/compile_doc.yue $(TEST_OUTPUT)
441 @echo -en "Compile time: " 442 @echo -en "Compile time: "
442 @$(END_TIME) 443 @$(END_TIME)
@@ -457,6 +458,7 @@ gen: release
457 @./$(BIN_NAME) $(TEST_INPUT)/attrib.yue -o $(GEN_OUTPUT)/5.1/attrib.lua --target 5.1 458 @./$(BIN_NAME) $(TEST_INPUT)/attrib.yue -o $(GEN_OUTPUT)/5.1/attrib.lua --target 5.1
458 @./$(BIN_NAME) $(TEST_INPUT)/import_global.yue -o $(GEN_OUTPUT)/5.1/import_global.lua --target 5.1 459 @./$(BIN_NAME) $(TEST_INPUT)/import_global.yue -o $(GEN_OUTPUT)/5.1/import_global.lua --target 5.1
459 @./$(BIN_NAME) $(TEST_INPUT)/test/loops_spec.yue -o $(GEN_OUTPUT)/5.1/test/loops_spec.lua --target 5.1 460 @./$(BIN_NAME) $(TEST_INPUT)/test/loops_spec.yue -o $(GEN_OUTPUT)/5.1/test/loops_spec.lua --target 5.1
461 @./$(BIN_NAME) $(TEST_INPUT)/test/try_catch_spec.yue -o $(GEN_OUTPUT)/5.1/test/try_catch_spec.lua --target 5.1
460 @./$(BIN_NAME) -e spec/inputs/compile_doc.yue $(GEN_OUTPUT) 462 @./$(BIN_NAME) -e spec/inputs/compile_doc.yue $(GEN_OUTPUT)
461 @echo -en "Compile time: " 463 @echo -en "Compile time: "
462 @$(END_TIME) 464 @$(END_TIME)
@@ -495,3 +497,4 @@ $(BUILD_PATH)/%.o: $(SRC_PATH)/%.c
495 $(CMD_PREFIX)$(CC) $(CFLAGS) $(INCLUDES) -MP -MMD -c $< -o $@ 497 $(CMD_PREFIX)$(CC) $(CFLAGS) $(INCLUDES) -MP -MMD -c $< -o $@
496 @echo -en "\t Compile time: " 498 @echo -en "\t Compile time: "
497 @$(END_TIME) 499 @$(END_TIME)
500