mirror of
https://github.com/kanaka/mal.git
synced 2024-10-27 06:40:14 +03:00
8c7d495eea
Update build system, syntax and library calls for zig 0.13.0. Rewrite the build system so that the steps can build separately. Drop intermediate symbolic links (unneeded complexity, confusing timestamps). Build with debugging options, this is a toy project full of memory leaks. Declare the allocators as global variables instead of passing and/or storing always the same reference everywhere for no benefit. Make apply_function a global variable instead of adding a reference to EVAL in each function. Pass arguments as a slice instead of using a different type for each argument count. There is no point in renaming default errors. Remove a lot of reference counting and some indirection levels. This fixes the current segmentation faults. Create each object as soon as possible and use errdefer so that it is deallocated if an exception occurs when computing its elemements. Use a global variable to convey a MAL object alongside a thrown error. Remove the unused logging_alloc module (but add a debug_alloc boolean in types.zig).
16 lines
355 B
Makefile
16 lines
355 B
Makefile
|
|
STEPS = step0_repl step1_read_print step2_eval step3_env step4_if_fn_do step5_tco step6_file step7_quote step8_macros step9_try stepA_mal
|
|
|
|
all: $(STEPS)
|
|
|
|
zig_opts += --release=safe
|
|
zig_opts += -Doptimize=Debug
|
|
$(STEPS):
|
|
zig build $(zig_opts) -Dname=$@ -Droot_source_file=$@.zig
|
|
|
|
.PHONY: all $(STEPS) clean
|
|
|
|
clean:
|
|
rm -fr .zig-cache/ zig-out/
|
|
rm -f *~
|