<commit_before>all: jar agent

setup:
ifndef JAVA_HOME
	echo "You need to set JAVA_HOME"
	false
endif
	mkdir -p target

clean: 
	rm -rf target

jar: setup
	$(JAVA_HOME)/bin/javac -d target/ java/is/jcdav/darkseer/*
	$(JAVA_HOME)/bin/jar cvf target/darkseer.jar target/is/jcdav/darkseer/*.class

ARCH=$(shell uname -s | tr '[:upper:]' '[:lower:]')
agent: setup
	gcc -o target/ldsagent.so -lc -shared -fPIC -I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/$(ARCH)/ c/*.c

stubs: setup jar
	$(JAVA_HOME)/bin/javah -o target/stubs.c -stubs -cp target/ is.jcdav.darkseer.DarkSeer

demo: setup jar agent
	$(JAVA_HOME)/bin/javac -cp target/ -d target test/*
	$(JAVA_HOME)/bin/java -cp target/ -agentpath:target/ldsagent.so Demo		<commit_msg>Makefile pedantry<commit_after>all: jar agent

setup:
ifndef JAVA_HOME
	echo "You need to set JAVA_HOME"
	false
endif
	mkdir -p target

clean: 
	rm -rf target

jar: setup
	$(JAVA_HOME)/bin/javac -d target/ java/is/jcdav/darkseer/*
	$(JAVA_HOME)/bin/jar cvf target/darkseer.jar target/is/jcdav/darkseer/*.class

OS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
agent: setup
	gcc -o target/ldsagent.so -lc -shared -fPIC -I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/$(OS)/ c/*.c

stubs: setup jar
	$(JAVA_HOME)/bin/javah -o target/stubs.c -stubs -cp target/ is.jcdav.darkseer.DarkSeer

demo: setup jar agent
	$(JAVA_HOME)/bin/javac -cp target/ -d target test/*
	$(JAVA_HOME)/bin/java -cp target/ -agentpath:target/ldsagent.so Demo		
{'fraction_non_alphanumeric': 0.15940054495912806, 'fraction_numerical': 0.0, 'mean_word_length': 3.7694805194805197, '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': '839286', 'n_tokens_mistral': 632, 'n_tokens_neox': 602, 'n_words': 151}