<commit_before>PYTHON			?= python
CLIPS_VERSION		?= 6.31
CLIPS_SOURCE_URL	?= "https://downloads.sourceforge.net/project/clipsrules/CLIPS/6.31/clips_core_source_631.zip"
MAKEFILE_NAME		?= makefile
SHARED_LIBRARY_DIR	?= /usr/lib

.PHONY: clips clipspy test install clean

all: clips_source clips clipspy

clips_source:
	wget -O clips.zip $(CLIPS_SOURCE_URL)
	unzip -jo clips.zip -d clips_source

clips: clips_source
	$(MAKE) -f $(MAKEFILE_NAME) -C clips_source                            \
		CFLAGS="-std=c99 -O3 -fno-strict-aliasing -fPIC"               \
		LDLIBS="-lm -lrt"
	ld -G clips_source/*.o -o clips_source/libclips.so

clipspy: clips
	$(PYTHON) setup.py build_ext

test: clipspy
	cp build/lib.*/clips/_clips*.so clips
	LD_LIBRARY_PATH=$LD_LIBRARY_PATH:clips_source			       \
		$(PYTHON) -m pytest -v

install-clips: clips
	cp clips_source/libclips.so		 			       \
	 	$(SHARED_LIBRARY_DIR)/libclips.so.$(CLIPS_VERSION)
	ln -s $(SHARED_LIBRARY_DIR)/libclips.so.$(CLIPS_VERSION)	       \
	 	$(SHARED_LIBRARY_DIR)/libclips.so.6
	ln -s $(SHARED_LIBRARY_DIR)/libclips.so.$(CLIPS_VERSION)	       \
	 	$(SHARED_LIBRARY_DIR)/libclips.so
	ldconfig -n -v $(SHARED_LIBRARY_DIR)<commit_msg>Install header files globally, so subsequently CLIPS can be used in installations by virtual environments.<commit_after>PYTHON			?= python
CLIPS_VERSION		?= 6.31
CLIPS_SOURCE_URL	?= "https://downloads.sourceforge.net/project/clipsrules/CLIPS/6.31/clips_core_source_631.zip"
MAKEFILE_NAME		?= makefile
SHARED_INCLUDE_DIR	?= /usr/local/include
SHARED_LIBRARY_DIR	?= /usr/local/lib

.PHONY: clips clipspy test install clean

all: clips_source clips clipspy

clips_source:
	wget -O clips.zip $(CLIPS_SOURCE_URL)
	unzip -jo clips.zip -d clips_source

clips: clips_source
	$(MAKE) -f $(MAKEFILE_NAME) -C clips_source                            \
		CFLAGS="-std=c99 -O3 -fno-strict-aliasing -fPIC"               \
		LDLIBS="-lm -lrt"
	ld -G clips_source/*.o -o clips_source/libclips.so

clipspy: clips
	$(PYTHON) setup.py build_ext

test: clipspy
	cp build/lib.*/clips/_clips*.so clips
	LD_LIBRARY_PATH=$LD_LIBRARY_PATH:clips_source			       \
		$(PYTHON) -m pytest -v

install-clips: clips
	install -d $(SHARED_INCLUDE_DIR)/
	install -m 644 clips_source/clips.h $(SHARED_INCLUDE_DIR)/
	install -d $(SHARED_INCLUDE_DIR)/clips
	install -m 644 clips_source/*.h $(SHARED_INCLUDE_DIR)/clips/
	install -d $(SHARED_LIBRARY_DIR)/
	install -m 644 clips_source/libclips.so                                \
	 	$(SHARED_LIBRARY_DIR)/libclips.so.$(CLIPS_VERSION)
	ln -s $(SHARED_LIBRARY_DIR)/libclips.so.$(CLIPS_VERSION)	       \
	 	$(SHARED_LIBRARY_DIR)/libclips.so.6
	ln -s $(SHARED_LIBRARY_DIR)/libclips.so.$(CLIPS_VERSION)	       \
	 	$(SHARED_LIBRARY_DIR)/libclips.so
	ldconfig -n -v $(SHARED_LIBRARY_DIR)
{'fraction_non_alphanumeric': 0.12162648434688737, 'fraction_numerical': 0.012594458438287154, 'mean_word_length': 3.3987341772151898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1472673', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1122, 'n_words': 196}