aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-01-26 06:38:38 +0000
committerLi Jin <dragon-fly@qq.com>2026-01-26 06:38:38 +0000
commit5d5b657f606b5939062983b1f90c3359d542672e (patch)
tree32132fd8908d6a8920d59362c572815a949f1a1f /makefile
parentf5006f449a7be1a2f655f1b178ecf1d2f0569dd5 (diff)
downloadyuescript-5d5b657f606b5939062983b1f90c3359d542672e.tar.gz
yuescript-5d5b657f606b5939062983b1f90c3359d542672e.tar.bz2
yuescript-5d5b657f606b5939062983b1f90c3359d542672e.zip
Fixed compiler improvements and added comprehensive test suite
- Fixed makefile preprocessor macro definitions (removed spaces in -D flags) - Added null pointer check in compiler class declaration handling - Added comprehensive test specifications for various language features: - attrib, backcall, cond, config, existential, export, goto - import, literals, macro, metatable, operators, return - string, switch, vararg, with Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makefile')
-rw-r--r--makefile42
1 files changed, 21 insertions, 21 deletions
diff --git a/makefile b/makefile
index 5cd1de2..3220aa5 100644
--- a/makefile
+++ b/makefile
@@ -13,9 +13,9 @@ LIBS =
13# General compiler flags 13# General compiler flags
14COMPILE_FLAGS = -std=c++17 -Wall -Wextra -DYUE_UTF8_IMPL 14COMPILE_FLAGS = -std=c++17 -Wall -Wextra -DYUE_UTF8_IMPL
15# Additional release-specific flags 15# Additional release-specific flags
16RCOMPILE_FLAGS = -D NDEBUG -O3 16RCOMPILE_FLAGS = -DNDEBUG -O3
17# Additional debug-specific flags 17# Additional debug-specific flags
18DCOMPILE_FLAGS = -D DEBUG 18DCOMPILE_FLAGS = -DDEBUG
19# Add additional include paths 19# Add additional include paths
20INCLUDES = -I $(SRC_PATH) -I $(SRC_PATH)/3rdParty 20INCLUDES = -I $(SRC_PATH) -I $(SRC_PATH)/3rdParty
21# General linker settings 21# General linker settings
@@ -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
66 ifneq ($(PREFIX_VAR),) 66ifneq ($(PREFIX_VAR),)
67 ifneq ($(findstring com.termux,$(PREFIX_VAR)),) 67ifneq ($(findstring com.termux,$(PREFIX_VAR)),)
68 IS_TERMUX := true 68 IS_TERMUX := true
69 endif 69endif
70 endif 70endif
71 # Alternative check: verify if Termux installation path exists 71 # Alternative check: verify if Termux installation path exists
72 ifeq ($(IS_TERMUX),false) 72ifeq ($(IS_TERMUX),false)
73 ifneq ($(shell test -d /data/data/com.termux/files/usr && echo yes),) 73ifneq ($(shell test -d /data/data/com.termux/files/usr && echo yes),)
74 IS_TERMUX := true 74 IS_TERMUX := true
75 endif 75endif
76 endif 76endif
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)
81 ifeq ($(NO_WATCHER),) 81ifeq ($(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)
84 endif 84endif
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
195 ifneq ($(NO_WATCHER),true) 195ifneq ($(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
197 endif 197endif
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'`
205 ifneq ($(NO_WATCHER),true) 205ifneq ($(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
207 endif 207endif
208endif 208endif
209 209
210# Version macros 210# Version macros
@@ -335,7 +335,7 @@ wasm-node: clean
335 -s MODULARIZE=1\ 335 -s MODULARIZE=1\
336 -s LZ4=1 336 -s LZ4=1
337 337
338 @${MAKE} clean 338 @$(MAKE) clean
339 339
340.PHONY: wasm 340.PHONY: wasm
341wasm: clean 341wasm: clean
@@ -359,7 +359,7 @@ wasm: clean
359 --bind \ 359 --bind \
360 -fexceptions \ 360 -fexceptions \
361 -Wno-deprecated-declarations 361 -Wno-deprecated-declarations
362 @${MAKE} clean 362 @$(MAKE) clean
363 363
364# Debug build for gdb debugging 364# Debug build for gdb debugging
365.PHONY: debug 365.PHONY: debug