<commit_before>CC=gcc
CFLAGS=-Wall
JDK_HOME=$(shell readlink -f `which javac` | sed "s:bin/javac::")
INCLUDES = -I$(JDK_HOME)include/linux -I$(JDK_HOME)include
LFLAGS = -shared
JAVAH=javah
CLASSPATH=../../target/classes
NLIB=../../nlib

all: prepare javah build 

javah: tproxy.h tuntap.h linuxutils.h libnetlink3.h

tproxy.h: org_it4y_jni_tproxy.c
	$(JAVAH) -classpath $(CLASSPATH) org.it4y.jni.tproxy

tuntap.h: org_it4y_jni_tuntap.c
	$(JAVAH) -classpath $(CLASSPATH) org.it4y.jni.tuntap

linuxutils.h: org_it4y_jni_linuxutils.c
	$(JAVAH) -classpath $(CLASSPATH) org.it4y.jni.linuxutils

libnetlink3.h: org_it4y_jni_libnetlink3.c
	$(JAVAH) -classpath $(CLASSPATH) org.it4y.jni.libnetlink3

build:  libjnitproxy.so libjnituntap.so libjnilinuxutils.so libjninetlink3.so

libjnitproxy.so: org_it4y_jni_tproxy.c
	$(CC) $(CFLAGS) $(INCLUDES) $(LFLAGS) -o libjnitproxy.so org_it4y_jni_tproxy.c
	install libjnitproxy.so $(NLIB)

libjnituntap.so: org_it4y_jni_tuntap.c
	$(CC) $(CFLAGS) $(INCLUDES) $(LFLAGS) -o libjnituntap.so org_it4y_jni_tuntap.c
	install libjnituntap.so $(NLIB)

libjnilinuxutils.so: org_it4y_jni_linuxutils.c
	$(CC) $(CFLAGS) $(INCLUDES) $(LFLAGS) -o libjnilinuxutils.so org_it4y_jni_linuxutils.c
	install libjnilinuxutils.so $(NLIB)

libjninetlink3.so: org_it4y_jni_libnetlink3.c
	$(CC) $(CFLAGS)  $(INCLUDES) `pkg-config --cflags --libs libnl-3.0` $(LFLAGS) \
	 -o libjninetlink3.so -Wl,-whole-archive /usr/lib/libnetlink.a -Wl,-no-whole-archive org_it4y_jni_libnetlink3.c
	 install libjninetlink3.so $(NLIB)

prepare:
	install -d $(NLIB)

clean:
	rm -rf *.so
	rm -rf $(NLIB)/*.so<commit_msg>- add build for testjhash<commit_after>CC=gcc
CFLAGS=-Wall
JDK_HOME=$(shell readlink -f `which javac` | sed "s:bin/javac::")
INCLUDES = -I$(JDK_HOME)include/linux -I$(JDK_HOME)include
LFLAGS = -shared
JAVAH=javah
CLASSPATH=../../target/classes
NLIB=../../nlib

all: prepare javah build 

javah: tproxy.h tuntap.h linuxutils.h libnetlink3.h

tproxy.h: org_it4y_jni_tproxy.c
	$(JAVAH) -classpath $(CLASSPATH) org.it4y.jni.tproxy

tuntap.h: org_it4y_jni_tuntap.c
	$(JAVAH) -classpath $(CLASSPATH) org.it4y.jni.tuntap

linuxutils.h: org_it4y_jni_linuxutils.c
	$(JAVAH) -classpath $(CLASSPATH) org.it4y.jni.linuxutils

libnetlink3.h: org_it4y_jni_libnetlink3.c
	$(JAVAH) -classpath $(CLASSPATH) org.it4y.jni.libnetlink3

build:  libjnitproxy.so libjnituntap.so libjnilinuxutils.so libjninetlink3.so testjhash

libjnitproxy.so: org_it4y_jni_tproxy.c
	$(CC) $(CFLAGS) $(INCLUDES) $(LFLAGS) -o libjnitproxy.so org_it4y_jni_tproxy.c
	install libjnitproxy.so $(NLIB)

libjnituntap.so: org_it4y_jni_tuntap.c
	$(CC) $(CFLAGS) $(INCLUDES) $(LFLAGS) -o libjnituntap.so org_it4y_jni_tuntap.c
	install libjnituntap.so $(NLIB)

libjnilinuxutils.so: org_it4y_jni_linuxutils.c
	$(CC) $(CFLAGS) $(INCLUDES) $(LFLAGS) -o libjnilinuxutils.so org_it4y_jni_linuxutils.c
	install libjnilinuxutils.so $(NLIB)

libjninetlink3.so: org_it4y_jni_libnetlink3.c
	$(CC) $(CFLAGS)  $(INCLUDES) `pkg-config --cflags --libs libnl-3.0` $(LFLAGS) \
	 -o libjninetlink3.so -Wl,-whole-archive /usr/lib/libnetlink.a -Wl,-no-whole-archive org_it4y_jni_libnetlink3.c
	 install libjninetlink3.so $(NLIB)
testjhash: testjhash.c
	$(CC) $(CFLAGS) $(INCLUDES) testjhash.c -o testjhash

prepare:
	install -d $(NLIB)

clean:
	rm -rf *.so
	rm -rf testjhash
	rm -rf $(NLIB)/*.so
{'fraction_non_alphanumeric': 0.1472263868065967, 'fraction_numerical': 0.016791604197901048, 'mean_word_length': 5.154981549815498, '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': '725622', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1548, 'n_words': 257}