<commit_before>CC = /usr/local/bin/gcc
BIGLOO = bigloo -cc $(CC)
AFILE = bglafile

BGL_COMMON_FLAGS = -L .. -copt -fpic -mkaddlib
BGL_FLAGS = $(BGL_COMMON_FLAGS) -g

UTF_BGL_MODULES = utf
UTF_OBJECTS = $(UTF_BGL_MODULES:%=%.o)
UTF_SOURCES = $(UTF_BGL_MODULES:%=%.scm)

OBJECTS	= $(UTF_OBJECTS)
SOURCES	= $(UTF_SOURCES)

UTF_LIB = utf
UTF_HEAP = $(UTF_LIB).heap
UTF_INIT = $(UTF_LIB).init
UTF_VERSION = 1.0
UTF_LIB_A = lib$(UTF_LIB)_s-$(UTF_VERSION).a
UTF_LIB_SO = lib$(UTF_LIB)_s-$(UTF_VERSION).so
UTF_LIB_OBJECTS = $(OBJECTS)

all: $(UTF_LIB_A) $(UTF_LIB_SO) $(UTF_INIT)

.PHONY: build-afile clean all

.afile: $(SOURCES)
	$(AFILE) -o $@ $(SOURCES)

o/runtime.o: $(RUNTIME_SOURCES)

o/unicode/.keep:
	mkdir -p o/unicode;
	touch $@;

%.o: %.scm .afile
	$(BIGLOO) $(BGL_FLAGS) -c -o $@ $<

clean:
	rm -f $(OBJECTS) \
	      $(UTF_HEAP) \
	      $(UTF_LIB_A) \
	      $(UTF_LIB_SO) \
	      $(UTF_INIT) \
	      unicode-reader.o unicode-reader \
	      utf-data.sch utf-category-data.sch \
	      utf-init-gen utf-init-gen.o \
	      .afile;

$(UTF_INIT): utf.init.in utf-init-gen
	./utf-init-gen -o $@ $<

$(UTF_HEAP): make-lib.scm utf.scm .afile utf.o
	bigloo $(BGL_FLAGS) -mkaddheap -mkaddlib -heap-library $(UTF_LIB) $< -addheap $@
$(UTF_LIB_A): $(UTF_HEAP) $(UTF_LIB_OBJECTS)
	rm -f $@ && \
	ar qcv $@ $(UTF_LIB_OBJECTS) && \
	ranlib $@
$(UTF_LIB_SO): $(UTF_HEAP) $(UTF_LIB_OBJECTS)
	ld -G -o $@ $(UTF_LIB_OBJECTS)

# explicit deps
utf.o: utf-data.sch utf-category-data.sch

utf-data.sch: unicode-reader
	./unicode-reader > $@
utf-category-data.sch: unicode-reader
	./unicode-reader --categories > $@

unicode-reader: unicode-reader.scm
	bigloo -Wall -g -o $@ $^

utf-init-gen: utf-init-gen.scm
	bigloo -Wall -g -o $@ $^<commit_msg>Fix dependencies.<commit_after>CC = /usr/local/bin/gcc
BIGLOO = bigloo -cc $(CC)
AFILE = bglafile

BGL_COMMON_FLAGS = -L .. -copt -fpic -mkaddlib
BGL_FLAGS = $(BGL_COMMON_FLAGS) -g
BSAFE_FLAGS = -g
BUNSAFE_FLAGS = -unsafe

UTF_BGL_MODULES = utf
UTF_OBJECTS = $(UTF_BGL_MODULES:%=%.o)
UTF_SOURCES = $(UTF_BGL_MODULES:%=%.scm)

OBJECTS_S	= $(UTF_OBJECTS:%=os/%)
OBJECTS_U	= $(UTF_OBJECTS:%=ou/%)
SOURCES	= $(UTF_SOURCES)

UTF_LIB = utf
UTF_HEAP = $(UTF_LIB).heap
UTF_INIT = $(UTF_LIB).init
UTF_VERSION = 1.0
UTF_LIB_A_S = lib$(UTF_LIB)_s-$(UTF_VERSION).a
UTF_LIB_SO_S = lib$(UTF_LIB)_s-$(UTF_VERSION).so
UTF_LIB_A_U = lib$(UTF_LIB)_u-$(UTF_VERSION).a
UTF_LIB_SO_U = lib$(UTF_LIB)_u-$(UTF_VERSION).so
UTF_LIB_SO_E = lib$(UTF_LIB)_e-$(UTF_VERSION).so
UTF_LIB_OBJECTS_S = $(OBJECTS_S)
UTF_LIB_OBJECTS_U = $(OBJECTS_U)
UTF_LIB_OBJECTS_E = make-lib.o

all: $(UTF_INIT) \
	$(UTF_LIB_A_S) $(UTF_LIB_SO_S) \
	$(UTF_LIB_A_U) $(UTF_LIB_SO_U) \
	$(UTF_LIB_SO_E)

.PHONY: build-afile clean all

.afile: $(SOURCES)
	$(AFILE) -o $@ $(SOURCES)

o/runtime.o: $(RUNTIME_SOURCES)

o/unicode/.keep:
	mkdir -p o/unicode;
	touch $@;

%.o: %.scm .afile
	$(BIGLOO) $(BGL_FLAGS) -c -o $@ $<

os/%.o: %.scm .afile
	@ mkdir -p os
	$(BIGLOO) $(BSAFE_FLAGS) $(BGL_FLAGS) -c -o $@ $<

ou/%.o: %.scm .afile
	@ mkdir -p ou
	$(BIGLOO) $(BUNSAFE_FLAGS) $(BGL_FLAGS) -c -o $@ $<

clean:
	rm -f $(OBJECTS_S) \
	      $(OBJECTS_U) \
	      $(UTF_HEAP) \
	      $(UTF_LIB_A_S) \
	      $(UTF_LIB_SO_S) \
	      $(UTF_LIB_A_U) \
	      $(UTF_LIB_SO_U) \
	      $(UTF_LIB_SO_E) \
	      $(UTF_INIT) \
	      unicode-reader.o unicode-reader \
	      utf-data.sch utf-category-data.sch \
	      utf-init-gen utf-init-gen.o \
	      .afile;

$(UTF_INIT): utf.init.in utf-init-gen
	./utf-init-gen -o $@ $<

$(UTF_HEAP): make-lib.scm utf.scm .afile utf-data.sch
	bigloo $(BGL_FLAGS) -mkaddheap -mkaddlib -heap-library $(UTF_LIB) $< -addheap $@
$(UTF_LIB_A_S): $(UTF_HEAP) $(UTF_LIB_OBJECTS_S)
	rm -f $@ && \
	ar qcv $@ $(UTF_LIB_OBJECTS_S) && \
	ranlib $@
$(UTF_LIB_SO_S): $(UTF_HEAP) $(UTF_LIB_OBJECTS_S)
	ld -G -o $@ $(UTF_LIB_OBJECTS_S)
$(UTF_LIB_A_U): $(UTF_HEAP) $(UTF_LIB_OBJECTS_U)
	rm -f $@ && \
	ar qcv $@ $(UTF_LIB_OBJECTS_U) && \
	ranlib $@
$(UTF_LIB_SO_U): $(UTF_HEAP) $(UTF_LIB_OBJECTS_U)
	ld -G -o $@ $(UTF_LIB_OBJECTS_U)
$(UTF_LIB_SO_E): $(UTF_HEAP) $(UTF_LIB_OBJECTS_E) $(UTF_LIB_SO_S)
	ld -G -o $@ $(UTF_LIB_OBJECTS_E) -L. -l$(UTF_LIB)_s-$(UTF_VERSION)

# explicit deps
os/utf.o: utf-data.sch utf-category-data.sch
ou/utf.o: utf-data.sch utf-category-data.sch

make-lib.o: utf-data.sch

utf-data.sch: unicode-reader
	./unicode-reader > $@
utf-category-data.sch: unicode-reader
	./unicode-reader --categories > $@

unicode-reader: unicode-reader.scm
	bigloo -Wall -g -o $@ $^

utf-init-gen: utf-init-gen.scm utf-category-data.sch
	bigloo -Wall -g -o $@ $<
{'fraction_non_alphanumeric': 0.19210526315789472, 'fraction_numerical': 0.0008771929824561404, 'mean_word_length': 3.5383084577114428, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4179362', 'n_tokens_mistral': 2208, 'n_tokens_neox': 2089, 'n_words': 356}