<commit_before>OPTIM = -g -O0 -Werror
#OPTIM = -O2
CFLAGS = -std=c1x $(OPTIM) -Wall -Wextra -pedantic \
	-Wno-missing-field-initializers \
	-Wno-missing-braces \
	`freetype-config --cflags` \
	-D_POSIX_C_SOURCE=200809L
LDFLAGS = -lrt -lcairo -lX11 `freetype-config --libs` -lfontconfig

CC = gcc

SRC = \
	util.c \
	array.c \
	pipe.c \
	utf.c \
	edit.c \
	font.c \
	view.c \
	draw.c \
	window.c \
	werf.c
OBJ = $(SRC:.c=.o)

all: werf

.c.o:
	@echo CC $<
	@$(CC) -c $(CFLAGS) $< -o $@

$(OBJ): util.h Makefile
window.o: window.h draw.h view.h
draw.o: draw.h view.h
view.o: view.h
utf.o: utf.h
font.o: font.h utf.h
edit.o: edit.h utf.h array.h
pipe.c: pipe.h array.h
werf.o: pipe.h edit.h font.h array.h

test/main.c: $(OBJ) Makefile
	@echo generate test objects
	@mkdir -p test
	@cp $(OBJ) test
	@objcopy -N main test/werf.o
	@sh gen-test.sh $(OBJ) > test/main.c
test/main.o: test/main.c
test-werf.passed: test/main.o test/werf.o
	@echo CC -o test-werf
	@cd test && $(CC) -o ../test-werf main.o $(OBJ) $(LDFLAGS)
	@echo testing
	valgrind --quiet --leak-check=full --error-exitcode=1 ./test-werf<commit_msg>Fix typo in dependencies for pipe.o in Makefile.<commit_after>OPTIM = -g -O0 -Werror
#OPTIM = -O2
CFLAGS = -std=c1x $(OPTIM) -Wall -Wextra -pedantic \
	-Wno-missing-field-initializers \
	-Wno-missing-braces \
	`freetype-config --cflags` \
	-D_POSIX_C_SOURCE=200809L
LDFLAGS = -lrt -lcairo -lX11 `freetype-config --libs` -lfontconfig

CC = gcc

SRC = \
	util.c \
	array.c \
	pipe.c \
	utf.c \
	edit.c \
	font.c \
	view.c \
	draw.c \
	window.c \
	werf.c
OBJ = $(SRC:.c=.o)

all: werf

.c.o:
	@echo CC $<
	@$(CC) -c $(CFLAGS) $< -o $@

$(OBJ): util.h Makefile
window.o: window.h draw.h view.h
draw.o: draw.h view.h
view.o: view.h
utf.o: utf.h
font.o: font.h utf.h
edit.o: edit.h utf.h array.h
pipe.o: pipe.h array.h
werf.o: pipe.h edit.h font.h array.h

test/main.c: $(OBJ) Makefile
	@echo generate test objects
	@mkdir -p test
	@cp $(OBJ) test
	@objcopy -N main test/werf.o
	@sh gen-test.sh $(OBJ) > test/main.c
test/main.o: test/main.c
test-werf.passed: test/main.o test/werf.o
	@echo CC -o test-werf
	@cd test && $(CC) -o ../test-werf main.o $(OBJ) $(LDFLAGS)
	@echo testing
	valgrind --quiet --leak-check=full --error-exitcode=1 ./test-werf
{'fraction_non_alphanumeric': 0.18691588785046728, 'fraction_numerical': 0.010680907877169559, 'mean_word_length': 2.685245901639344, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '6548776', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1043, 'n_words': 250}