diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-01-26 06:38:38 +0000 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-01-26 06:38:38 +0000 |
| commit | 5d5b657f606b5939062983b1f90c3359d542672e (patch) | |
| tree | 32132fd8908d6a8920d59362c572815a949f1a1f /makefile | |
| parent | f5006f449a7be1a2f655f1b178ecf1d2f0569dd5 (diff) | |
| download | yuescript-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-- | makefile | 42 |
1 files changed, 21 insertions, 21 deletions
| @@ -13,9 +13,9 @@ LIBS = | |||
| 13 | # General compiler flags | 13 | # General compiler flags |
| 14 | COMPILE_FLAGS = -std=c++17 -Wall -Wextra -DYUE_UTF8_IMPL | 14 | COMPILE_FLAGS = -std=c++17 -Wall -Wextra -DYUE_UTF8_IMPL |
| 15 | # Additional release-specific flags | 15 | # Additional release-specific flags |
| 16 | RCOMPILE_FLAGS = -D NDEBUG -O3 | 16 | RCOMPILE_FLAGS = -DNDEBUG -O3 |
| 17 | # Additional debug-specific flags | 17 | # Additional debug-specific flags |
| 18 | DCOMPILE_FLAGS = -D DEBUG | 18 | DCOMPILE_FLAGS = -DDEBUG |
| 19 | # Add additional include paths | 19 | # Add additional include paths |
| 20 | INCLUDES = -I $(SRC_PATH) -I $(SRC_PATH)/3rdParty | 20 | INCLUDES = -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) | |||
| 63 | PREFIX_VAR := $(shell echo $$PREFIX) | 63 | PREFIX_VAR := $(shell echo $$PREFIX) |
| 64 | ifneq ($(ANDROID_ROOT_VAR),) | 64 | ifneq ($(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),) | 66 | ifneq ($(PREFIX_VAR),) |
| 67 | ifneq ($(findstring com.termux,$(PREFIX_VAR)),) | 67 | ifneq ($(findstring com.termux,$(PREFIX_VAR)),) |
| 68 | IS_TERMUX := true | 68 | IS_TERMUX := true |
| 69 | endif | 69 | endif |
| 70 | endif | 70 | endif |
| 71 | # Alternative check: verify if Termux installation path exists | 71 | # Alternative check: verify if Termux installation path exists |
| 72 | ifeq ($(IS_TERMUX),false) | 72 | ifeq ($(IS_TERMUX),false) |
| 73 | ifneq ($(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 |
| 75 | endif | 75 | endif |
| 76 | endif | 76 | endif |
| 77 | endif | 77 | endif |
| 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 |
| 80 | ifeq ($(IS_TERMUX),true) | 80 | ifeq ($(IS_TERMUX),true) |
| 81 | ifeq ($(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) |
| 84 | endif | 84 | endif |
| 85 | endif | 85 | endif |
| 86 | 86 | ||
| 87 | ifeq ($(NO_WATCHER),true) | 87 | ifeq ($(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) | 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 |
| 197 | endif | 197 | endif |
| 198 | else | 198 | else |
| 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) | 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 |
| 207 | endif | 207 | endif |
| 208 | endif | 208 | endif |
| 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 |
| 341 | wasm: clean | 341 | wasm: 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 |
