<commit_before>include $(SIM_ROOT)/makefiles/Makefile.pylib

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_INCLUDEDIR) -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: Make cosim buildable as 32bit<commit_after>include $(SIM_ROOT)/makefiles/Makefile.pylib

PYTHON_LIBDIR ?= /usr/lib64
SWIG ?= swig
CC=gcc
ifeq ($(ARCH),i686)
	CC += -m32
endif

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

io_module.o: io.c io_module.h io.h
	$(CC) -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
	$(CC) -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
	$(CC) -g -ldl -shared -fPIC -I$(shell pwd) -I$(PYTHON_INCLUDEDIR) -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.16515609264853978, 'fraction_numerical': 0.008559919436052367, 'mean_word_length': 3.7197149643705463, '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': '5613857', 'n_tokens_mistral': 957, 'n_tokens_neox': 920, 'n_words': 170}