<commit_before>PYTHON_INCDIR ?= /usr/include/python2.7
PYTHON_LIBDIR ?= /usr/lib64
SWIG ?= swig

.PHONY: all
all: io_module.so _hal.so

io_module.o: io.c io_module.h io.h
	gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -I$(PYTHON_INCDIR) -c $< -o $@

io_module.so: io_module.o
	gcc -pthread -shared -Wl,-z,relro $< -L$(PYTHON_LIBDIR) -lpython2.7 -o $@

_hal.so: ../hal/endian_swapper_hal.c endian_swapper_hal_wrap.c io_module.so
	gcc -g -ldl -shared -fPIC -I$(shell pwd) -I$(PYTHON_INCDIR) -I../hal ../hal/endian_swapper_hal.c endian_swapper_hal_wrap.c io_module.so -o $@

endian_swapper_hal_wrap.c: ../hal/endian_swapper_hal.h
	$(SWIG) -python -outcurrentdir ../hal/endian_swapper_hal.h

.PHONY: clean
clean:
	-rm -rf hal.py*
	-rm -rf *.so
	-rm -rf *.o
	-rm -rf endian_swapper_hal_wrap.c<commit_msg>Cleanup: Pick up python version correctly<commit_after>PYTHON_LIBDIR ?= /usr/lib64
SWIG ?= swig

.PHONY: all
all: io_module.so _hal.so

io_module.o: io.c io_module.h io.h
	gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 \
	-fexceptions --param=ssp-buffer-size=4 -mtune=generic -D_GNU_SOURCE -fPIC \
	-fwrapv -DNDEBUG -I$(PYTHON_INCLUDEDIR) -c $< -o $@

io_module.so: io_module.o
	gcc -pthread -shared -Wl,-z,relro $< -L$(PYTHON_LIBDIR) -lpython$(PYTHON_VERSION) -o $@

_hal.so: ../hal/endian_swapper_hal.c endian_swapper_hal_wrap.c io_module.so
	gcc -g -ldl -shared -fPIC -I$(shell pwd) -I$(PYTHON_INCDIR) -I../hal ../hal/endian_swapper_hal.c endian_swapper_hal_wrap.c io_module.so -o $@

endian_swapper_hal_wrap.c: ../hal/endian_swapper_hal.h
	$(SWIG) -python -outcurrentdir ../hal/endian_swapper_hal.h

.PHONY: clean
clean:
	-rm -rf hal.py*
	-rm -rf *.so
	-rm -rf *.o
	-rm -rf endian_swapper_hal_wrap.c
{'fraction_non_alphanumeric': 0.16127292340884575, 'fraction_numerical': 0.007551240560949299, 'mean_word_length': 3.6144278606965172, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '1995227', 'n_tokens_mistral': 894, 'n_tokens_neox': 861, 'n_words': 162}