<commit_before># UHDM top Makefile (Wrapper to cmake)

release:
	mkdir -p build
	cd build; cmake ../ -DCMAKE_BUILD_TYPE=Release
	$(MAKE) -C build

debug:
	mkdir -p build
	cd build; cmake ../ -DCMAKE_BUILD_TYPE=Debug
	$(MAKE) -C build

test:
	$(MAKE) -C build test

clean:
	rm -f src/*
	rm -rf headers/*
	rm -rf build

install:
	$(MAKE) -C build install

uninstall:
	rm -rf /usr/local/lib/uhdm
	rm -rf /usr/local/include/uhdm

test_install:
	$(CXX) -std=c++14 -g tests/test1.cpp -I/usr/local/include/uhdm -I/usr/local/include/uhdm/include /usr/local/lib/uhdm/libuhdm.a -lcapnp -lkj -ldl -lutil -lm -lrt -lpthread -o test_inst
	./test_inst
<commit_msg>Use common PREFIX variable in Makefile to choose install destination.<commit_after># UHDM top Makefile (Wrapper to cmake)
PREFIX?=/usr/local

release: cmake-prepare
	$(MAKE) -C build

debug:
	mkdir -p build
	cd build; cmake ../ -DCMAKE_BUILD_TYPE=Debug
	$(MAKE) -C build

test: cmake-prepare
	$(MAKE) -C build test

clean:
	rm -f src/*
	rm -rf headers/*
	rm -rf build

install: cmake-prepare
	$(MAKE) -C build install

uninstall:
	rm -rf $(PREFIX)/lib/uhdm
	rm -rf $(PREFIX)/include/uhdm

cmake-prepare:
	mkdir -p build
	cd build; cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(PREFIX)

test_install:
	$(CXX) -std=c++14 -g tests/test1.cpp -I$(PREFIX)/include/uhdm -I$(PREFIX)/include/uhdm/include $(PREFIX)/lib/uhdm/libuhdm.a -lcapnp -lkj -ldl -lutil -lm -lrt -lpthread -o test_inst
	./test_inst

{'fraction_non_alphanumeric': 0.1464750171115674, 'fraction_numerical': 0.004106776180698152, 'mean_word_length': 3.416918429003021, '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': '428448', 'n_tokens_mistral': 622, 'n_tokens_neox': 579, 'n_words': 163}