mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-15 14:23:32 +03:00
d60feaace0
This involves new primitives GCPtr and GCAnyPtr which are pointer types that have finalisers attached. The finalisers are run when the associated pointer goes out of scope. In the test, I am assuming that the GC will only be called once, right at the end. Otherwise, the output isn't guaranteed to be deterministic! Let's see how this assumption holds... This is currently Chez only. I think it'll be easy enough to add to the Racket and Gambit back ends too.
29 lines
387 B
Makefile
29 lines
387 B
Makefile
include ../../../config.mk
|
|
|
|
TARGET = libmkalloc
|
|
|
|
SRCS = $(wildcard *.c)
|
|
OBJS = $(SRCS:.c=.o)
|
|
DEPS = $(OBJS:.o=.d)
|
|
|
|
|
|
all: $(TARGET)$(SHLIB_SUFFIX)
|
|
|
|
$(TARGET)$(SHLIB_SUFFIX): $(OBJS)
|
|
$(CC) -shared $(LDFLAGS) -o $@ $^
|
|
|
|
|
|
-include $(DEPS)
|
|
|
|
%.d: %.c
|
|
@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean :
|
|
$(RM) $(OBJS) $(TARGET)$(SHLIB_SUFFIX)
|
|
|
|
cleandep: clean
|
|
$(RM) $(DEPS)
|