<commit_before>#!/usr/bin/make -rf
all: lws install-plugin python_c_test

make-datadir:
	mkdir -p build/datadir
	cp -rv example-config/ build/datadir/config

lws: make-datadir
	cd build && cmake ../libwebsockets -DLWS_WITH_LWSWS=1 -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/build/datadir -DCMAKE_BUILD_TYPE=DEBUG
	cd build && make

install-plugin: make-datadir libprotocol_battleships.so
	install -d build/datadir/share/libwebsockets-test-server/plugins
	install libprotocol_battleships.so build/datadir/share/libwebsockets-test-server/plugins/

CFLAGS += -fPIC
CFLAGS += -ggdb3
CFLAGS += -Ibuild/
LDLIBS += -ljansson
CFLAGS += $(shell python3-config --cflags)
LDFLAGS += $(shell python3-config --ldflags)
LDLIBS += $(shell python3-config --libs)

libprotocol_battleships.so: protocol_battleships.o py_logic.o
	gcc -shared $(LDLIBS) $^ -o $@

python_c_test:
	gcc $(CFLAGS) python_c_test.c py_logic.c -o python_c_test $(LDFLAGS) $(LDLIBS)

clean:
	rm -rf build
	rm -f protocol_battleships.o py_logic.o libprotocol_battleships.so 
	rm -f python_c_test

run:
	build/bin/lwsws -c build/datadir/config

valgrind:<commit_msg>Fix order of arguments to gcc<commit_after>#!/usr/bin/make -rf
all: lws install-plugin python_c_test

make-datadir:
	mkdir -p build/datadir
	cp -rv example-config/ build/datadir/config

lws: make-datadir
	cd build && cmake ../libwebsockets -DLWS_WITH_LWSWS=1 -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/build/datadir -DCMAKE_BUILD_TYPE=DEBUG
	cd build && make

install-plugin: make-datadir libprotocol_battleships.so
	install -d build/datadir/share/libwebsockets-test-server/plugins
	install libprotocol_battleships.so build/datadir/share/libwebsockets-test-server/plugins/

CFLAGS += -fPIC
CFLAGS += -ggdb3
CFLAGS += -Ibuild/
LDLIBS += -ljansson
CFLAGS += $(shell python3-config --cflags)
LDFLAGS += $(shell python3-config --ldflags)
LDLIBS += $(shell python3-config --libs)

libprotocol_battleships.so: protocol_battleships.o py_logic.o
	gcc -shared $^ $(LDLIBS) -o $@

python_c_test:
	gcc $(CFLAGS) python_c_test.c py_logic.c -o python_c_test $(LDFLAGS) $(LDLIBS)

clean:
	rm -rf build
	rm -f protocol_battleships.o py_logic.o libprotocol_battleships.so 
	rm -f python_c_test

run:
	build/bin/lwsws -c build/datadir/config

valgrind:
{'fraction_non_alphanumeric': 0.1224307417336908, 'fraction_numerical': 0.004468275245755138, 'mean_word_length': 4.711734693877551, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3048713', 'n_tokens_mistral': 925, 'n_tokens_neox': 875, 'n_words': 180}