<commit_before>include commands.mk

OPTS    := -O2
CFLAGS  := -std=c99 $(OPTS) -fPIC -Wall
LDFLAGS :=

SRC  = $(wildcard *.c)
OBJ  = $(foreach obj, $(SRC:.c=.o), $(notdir $(obj)))
DEP  = $(SRC:.c=.d)

TARGETS     = gpushd-server gpushd-client

SERVER_OBJ = gpushd-server.o version.o help.o safe-call.o iobuf.o common.o
CLIENT_OBJ = gpushd-client.o version.o help.o safe-call.o common.o

PREFIX  ?= /usr/local
BIN     ?= /bin

commit = $(shell ./hash.sh)
ifneq ($(commit), UNKNOWN)
	CFLAGS += -DCOMMIT="\"$(commit)\""
	CFLAGS += -DPARTIAL_COMMIT="\"$(shell echo $(commit) | cut -c1-8)\""
endif

ifndef DISABLE_DEBUG
CFLAGS += -ggdb
else
CFLAGS += -DNDEBUG=1
endif

.PHONY: all clean

all: $(TARGETS)

gpushd-server: $(SERVER_OBJ)
	$(CC) -o $@ $^ $(LDFLAGS)

gpushd-client: $(CLIENT_OBJ)
	$(CC) -o $@ $^ $(LDFLAGS)

%.o: %.c
	$(CC) -Wp,-MMD,$*.d -c $(CFLAGS) -o $@ $<

clean:
	$(RM) $(DEP)
	$(RM) $(OBJ)
	$(RM) $(CATALOGS)
	$(RM) $(TARGETS)

install:
	$(MKDIR) -p $(DESTDIR)/$(PREFIX)/$(BIN)
	$(INSTALL_PROGRAM) gpushd-server $(DESTDIR)/$(PREFIX)/$(BIN)
	$(INSTALL_PROGRAM) gpushd-client $(DESTDIR)/$(PREFIX)/$(BIN)

uninstall:
	$(RM) $(DESTDIR)/$(PREFIX)/gpushd-server<commit_msg>Disable optimization with debug messages.<commit_after>include commands.mk

CFLAGS  := -std=c99 $(OPTS) -fPIC -Wall
LDFLAGS :=

SRC  = $(wildcard *.c)
OBJ  = $(foreach obj, $(SRC:.c=.o), $(notdir $(obj)))
DEP  = $(SRC:.c=.d)

TARGETS     = gpushd-server gpushd-client

SERVER_OBJ = gpushd-server.o version.o help.o safe-call.o iobuf.o common.o
CLIENT_OBJ = gpushd-client.o version.o help.o safe-call.o common.o

PREFIX  ?= /usr/local
BIN     ?= /bin

commit = $(shell ./hash.sh)
ifneq ($(commit), UNKNOWN)
	CFLAGS += -DCOMMIT="\"$(commit)\""
	CFLAGS += -DPARTIAL_COMMIT="\"$(shell echo $(commit) | cut -c1-8)\""
endif

ifndef DISABLE_DEBUG
OPTS   := -O0
CFLAGS += -ggdb
else
OPTS   := -O2
CFLAGS += -DNDEBUG=1
endif

.PHONY: all clean

all: $(TARGETS)

gpushd-server: $(SERVER_OBJ)
	$(CC) -o $@ $^ $(LDFLAGS)

gpushd-client: $(CLIENT_OBJ)
	$(CC) -o $@ $^ $(LDFLAGS)

%.o: %.c
	$(CC) -Wp,-MMD,$*.d -c $(CFLAGS) -o $@ $<

clean:
	$(RM) $(DEP)
	$(RM) $(OBJ)
	$(RM) $(CATALOGS)
	$(RM) $(TARGETS)

install:
	$(MKDIR) -p $(DESTDIR)/$(PREFIX)/$(BIN)
	$(INSTALL_PROGRAM) gpushd-server $(DESTDIR)/$(PREFIX)/$(BIN)
	$(INSTALL_PROGRAM) gpushd-client $(DESTDIR)/$(PREFIX)/$(BIN)

uninstall:
	$(RM) $(DESTDIR)/$(PREFIX)/gpushd-server
{'fraction_non_alphanumeric': 0.23176323468111712, 'fraction_numerical': 0.005418924551896623, 'mean_word_length': 3.86815415821501, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5051036', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1026, 'n_words': 221}