<commit_before># Cyclone Scheme
# Copyright (c) 2014, <NAME>
# All rights reserved.

include Makefile.config

CYCLONE = cyclone
TESTSCM = unit-tests
TESTFILES = $(addprefix tests/, $(addsuffix .scm, $(TESTSCM)))
BOOTSTRAP_DIR = ../cyclone-bootstrap

SMODULES = \
  scheme/base \
  scheme/char \
  scheme/cxr \
  scheme/eval \
  scheme/file \
  scheme/load \
  scheme/inexact \
  scheme/process-context \
  scheme/read \
  scheme/time \
  scheme/write \
  scheme/cyclone/cgen \
  scheme/cyclone/common \
  scheme/cyclone/libraries \
  scheme/cyclone/macros \
  scheme/cyclone/transforms \
  scheme/cyclone/util \
  srfi/9 \
  srfi/18
SLDFILES = $(addsuffix .sld, $(SMODULES))
COBJECTS=$(SLDFILES:.sld=.o)

all: cyclone icyc

%.o: %.sld
	$(CYCLONE) $<

cyclone: $(COBJECTS) libcyclone.a cyclone.scm
	$(CYCLONE) cyclone.scm

icyc: $(COBJECTS) libcyclone.a icyc.scm
	$(CYCLONE) icyc.scm

dispatch.c: generate-c.scm
# TODO: could call from icyc, eg: icyc generate-c.scm
	$(CYCLONE) generate-c.scm
	./generate-c

libcyclone.so.1: runtime.c include/cyclone/runtime.h
	gcc $(CFLAGS) -c -fPIC runtime.c -o runtime.o
	gcc -shared -Wl,-soname,libcyclone.so.1 -o libcyclone.so.1.0.1 runtime.o

libcyclone.a: runtime.c include/cyclone/runtime.h include/cyclone/types.h gc.c dispatch.c
	$(CC) $(CFLAGS) -c -Iinclude dispatch.c -o dispatch.o
	$(CC) $(CFLAGS) -std=gnu99 -c -Iinclude gc.c -o gc.o
	$(CC) $(CFLAGS) -c -Iinclude -DCYC_INSTALL_DIR=\"$(PREFIX)\" -DCYC_INSTALL_LIB=\"$(LIBDIR)\" -DCYC_INSTALL_INC=\"$(INCDIR)\" -DCYC_INSTALL_SLD=\"$(DATADIR)\" runtime.c -o runtime.o
	$(AR) rcs libcyclone.a runtime.o gc.o dispatch.o
# Instructions from: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html
# Note compiler will have to link to this, eg:
#Linking against static library
#gcc -static main.c -L. -lmean -o statically_linked
#Note: the first three letters (the lib) must not be specified, as well as the suffix (.a)

.PHONY: bootstrap
bootstrap: icyc
#	rm -rf $(BOOTSTRAP_DIR)
	mkdir -p $(BOOTSTRAP_DIR)/scheme/cyclone
	mkdir -p $(BOOTSTRAP_DIR)/srfi
	mkdir -p $(BOOTSTRAP_DIR)/include/cyclone
	cp include/cyclone/types.h $(BOOTSTRAP_DIR)/include/cyclone
	cp include/cyclone/runtime-main.h $(BOOTSTRAP_DIR)/include/cyclone
	cp include/cyclone/runtime.h $(BOOTSTRAP_DIR)/include/cyclone
	cp include/cyclone/ck_ht_hash.h $(BOOTSTRAP_DIR)/include/cyclone
	cp scheme/*.sld $(BOOTSTRAP_DIR)/scheme
	cp scheme/cyclone/*.sld $(BOOTSTRAP_DIR)/scheme/cyclone
	cp srfi/*.sld $(BOOTSTRAP_DIR)/srfi
	cp runtime.c $(BOOTSTRAP_DIR)
	cp gc.c $(BOOTSTRAP_DIR)
	cp dispatch.c $(BOOTSTRAP_DIR)
	cp scheme/base.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/cxr.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/read.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/write.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/char.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/eval.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/file.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/inexact.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/load.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/process-context.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/time.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/cyclone/common.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp icyc.scm $(BOOTSTRAP_DIR)
	cp tests/unit-tests.scm $(BOOTSTRAP_DIR)
	cp scheme/cyclone/libraries.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp scheme/cyclone/macros.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp scheme/cyclone/transforms.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp scheme/cyclone/cgen.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp scheme/cyclone/util.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp srfi/9.c $(BOOTSTRAP_DIR)/srfi
	cp srfi/9.meta $(BOOTSTRAP_DIR)/srfi
	cp srfi/18.c $(BOOTSTRAP_DIR)/srfi
	cp cyclone.c $(BOOTSTRAP_DIR)/cyclone.c
	cp Makefile.config $(BOOTSTRAP_DIR)/Makefile.config


.PHONY: test
test: $(TESTFILES) $(CYCLONE)<commit_msg>Added lazy library<commit_after># Cyclone Scheme
# Copyright (c) 2014, <NAME>
# All rights reserved.

include Makefile.config

CYCLONE = cyclone
TESTSCM = unit-tests
TESTFILES = $(addprefix tests/, $(addsuffix .scm, $(TESTSCM)))
BOOTSTRAP_DIR = ../cyclone-bootstrap

SMODULES = \
  scheme/base \
  scheme/char \
  scheme/cxr \
  scheme/eval \
  scheme/file \
  scheme/lazy \
  scheme/load \
  scheme/inexact \
  scheme/process-context \
  scheme/read \
  scheme/time \
  scheme/write \
  scheme/cyclone/cgen \
  scheme/cyclone/common \
  scheme/cyclone/libraries \
  scheme/cyclone/macros \
  scheme/cyclone/transforms \
  scheme/cyclone/util \
  srfi/9 \
  srfi/18
SLDFILES = $(addsuffix .sld, $(SMODULES))
COBJECTS=$(SLDFILES:.sld=.o)

all: cyclone icyc

%.o: %.sld
	$(CYCLONE) $<

cyclone: $(COBJECTS) libcyclone.a cyclone.scm
	$(CYCLONE) cyclone.scm

icyc: $(COBJECTS) libcyclone.a icyc.scm
	$(CYCLONE) icyc.scm

dispatch.c: generate-c.scm
# TODO: could call from icyc, eg: icyc generate-c.scm
	$(CYCLONE) generate-c.scm
	./generate-c

libcyclone.so.1: runtime.c include/cyclone/runtime.h
	gcc $(CFLAGS) -c -fPIC runtime.c -o runtime.o
	gcc -shared -Wl,-soname,libcyclone.so.1 -o libcyclone.so.1.0.1 runtime.o

libcyclone.a: runtime.c include/cyclone/runtime.h include/cyclone/types.h gc.c dispatch.c
	$(CC) $(CFLAGS) -c -Iinclude dispatch.c -o dispatch.o
	$(CC) $(CFLAGS) -std=gnu99 -c -Iinclude gc.c -o gc.o
	$(CC) $(CFLAGS) -c -Iinclude -DCYC_INSTALL_DIR=\"$(PREFIX)\" -DCYC_INSTALL_LIB=\"$(LIBDIR)\" -DCYC_INSTALL_INC=\"$(INCDIR)\" -DCYC_INSTALL_SLD=\"$(DATADIR)\" runtime.c -o runtime.o
	$(AR) rcs libcyclone.a runtime.o gc.o dispatch.o
# Instructions from: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html
# Note compiler will have to link to this, eg:
#Linking against static library
#gcc -static main.c -L. -lmean -o statically_linked
#Note: the first three letters (the lib) must not be specified, as well as the suffix (.a)

.PHONY: bootstrap
bootstrap: icyc
#	rm -rf $(BOOTSTRAP_DIR)
	mkdir -p $(BOOTSTRAP_DIR)/scheme/cyclone
	mkdir -p $(BOOTSTRAP_DIR)/srfi
	mkdir -p $(BOOTSTRAP_DIR)/include/cyclone
	cp include/cyclone/types.h $(BOOTSTRAP_DIR)/include/cyclone
	cp include/cyclone/runtime-main.h $(BOOTSTRAP_DIR)/include/cyclone
	cp include/cyclone/runtime.h $(BOOTSTRAP_DIR)/include/cyclone
	cp include/cyclone/ck_ht_hash.h $(BOOTSTRAP_DIR)/include/cyclone
	cp scheme/*.sld $(BOOTSTRAP_DIR)/scheme
	cp scheme/cyclone/*.sld $(BOOTSTRAP_DIR)/scheme/cyclone
	cp srfi/*.sld $(BOOTSTRAP_DIR)/srfi
	cp runtime.c $(BOOTSTRAP_DIR)
	cp gc.c $(BOOTSTRAP_DIR)
	cp dispatch.c $(BOOTSTRAP_DIR)
	cp scheme/base.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/cxr.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/read.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/write.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/char.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/eval.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/file.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/inexact.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/lazy.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/load.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/process-context.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/time.c $(BOOTSTRAP_DIR)/scheme
	cp scheme/cyclone/common.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp icyc.scm $(BOOTSTRAP_DIR)
	cp tests/unit-tests.scm $(BOOTSTRAP_DIR)
	cp scheme/cyclone/libraries.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp scheme/cyclone/macros.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp scheme/cyclone/transforms.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp scheme/cyclone/cgen.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp scheme/cyclone/util.c $(BOOTSTRAP_DIR)/scheme/cyclone
	cp srfi/9.c $(BOOTSTRAP_DIR)/srfi
	cp srfi/9.meta $(BOOTSTRAP_DIR)/srfi
	cp srfi/18.c $(BOOTSTRAP_DIR)/srfi
	cp cyclone.c $(BOOTSTRAP_DIR)/cyclone.c
	cp Makefile.config $(BOOTSTRAP_DIR)/Makefile.config


.PHONY: test
test: $(TESTFILES) $(CYCLONE)
{'fraction_non_alphanumeric': 0.14769557710187275, 'fraction_numerical': 0.00478151148890955, 'mean_word_length': 4.2364394993045895, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '27421', 'n_tokens_mistral': 3170, 'n_tokens_neox': 3088, 'n_words': 599}