<commit_before># Tools used by the Makefile.
CP          = cp -f
MKDIR       = mkdir -vp
RSYNC       = rsync
DIFF        = diff
GREP        = grep
J2          = j2 -C --undefined=normal

# Configuration variables, affecting the processing of templates.
OUTDIR          = output
HOSTNAME        = $(shell uname -n | cut -d. -f1)
KERNEL          = $(shell uname -s | tr A-Z a-z)
CONFIG          = config/$(HOSTNAME)-$(KERNEL).json

# Make a list of *.j2 files that should be compiled with j2cli.
RCFILES_IN      = $(shell find _* -type f -iname '*.j2')
RCFILES_OUT     = $(patsubst _%.j2,$(OUTDIR)/.%,$(RCFILES_IN))

# Anything inside a directory that is not a template is copied without processing.
RCFILES_CP_FROM	= $(shell find _* -type f -not -iname '*.j2')
RCFILES_CP_TO   = $(patsubst _%,$(OUTDIR)/.%,$(RCFILES_CP_FROM))

# adjust RCFILES_OUT depending on kernel (i.e. OS)
ifneq ($(KERNEL),linux)
	RCFILES_OUT := $(filter-out $(OUTDIR)/.x%,$(RCFILES_OUT))
	RCFILES_OUT := $(filter-out $(OUTDIR)/.i3/%,$(RCFILES_OUT))
	RCFILES_OUT := $(filter-out $(OUTDIR)/.local/share/applications/%,$(RCFILES_OUT))
endif


.PHONY: all copy-dry copy-real

all: $(RCFILES_OUT) $(RCFILES_CP_TO)

copy-dry: all
	$(RSYNC) -avPhi -n $(OUTDIR)/ $(HOME)/

copy-real: all
	$(RSYNC) -avPhi $(OUTDIR)/ $(HOME)/

diff: all
	$(DIFF) -wr $(HOME)/ $(OUTDIR)/ | $(GREP) -v "^Only in $(HOME)/[^:]*:" || true

$(OUTDIR)/.%: _% $(CONFIG)<commit_msg>exclude swap files from copying<commit_after># Tools used by the Makefile.
CP          = cp -f
MKDIR       = mkdir -vp
RSYNC       = rsync
DIFF        = diff
GREP        = grep
J2          = j2 -C --undefined=normal

# Configuration variables, affecting the processing of templates.
OUTDIR          = output
HOSTNAME        = $(shell uname -n | cut -d. -f1)
KERNEL          = $(shell uname -s | tr A-Z a-z)
CONFIG          = config/$(HOSTNAME)-$(KERNEL).json

# Make a list of *.j2 files that should be compiled with j2cli.
RCFILES_IN      = $(shell find _* -type f -iname '*.j2')
RCFILES_OUT     = $(patsubst _%.j2,$(OUTDIR)/.%,$(RCFILES_IN))

# Anything inside a directory that is not a template is copied without processing.
RCFILES_CP_FROM	= $(shell find _* -type f -not -iname '*.j2')
RCFILES_CP_TO   = $(patsubst _%,$(OUTDIR)/.%,$(RCFILES_CP_FROM))

# Exclude unwanted files from being copied.
RCFILES_CP_TO	:= $(filter-out %.swp,$(RCFILES_CP_TO))
RCFILES_CP_TO	:= $(filter-out %.swo,$(RCFILES_CP_TO))

# adjust RCFILES_OUT depending on kernel (i.e. OS)
ifneq ($(KERNEL),linux)
	RCFILES_OUT := $(filter-out $(OUTDIR)/.x%,$(RCFILES_OUT))
	RCFILES_OUT := $(filter-out $(OUTDIR)/.i3/%,$(RCFILES_OUT))
	RCFILES_OUT := $(filter-out $(OUTDIR)/.local/share/applications/%,$(RCFILES_OUT))
endif


.PHONY: all copy-dry copy-real

all: $(RCFILES_OUT) $(RCFILES_CP_TO)

copy-dry: all
	$(RSYNC) -avPhi -n $(OUTDIR)/ $(HOME)/

copy-real: all
	$(RSYNC) -avPhi $(OUTDIR)/ $(HOME)/

diff: all
	$(DIFF) -wr $(HOME)/ $(OUTDIR)/ | $(GREP) -v "^Only in $(HOME)/[^:]*:" || true

$(OUTDIR)/.%: _% $(CONFIG)
{'fraction_non_alphanumeric': 0.1794616151545364, 'fraction_numerical': 0.005982053838484547, 'mean_word_length': 3.2039106145251397, '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': '3258577', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1180, 'n_words': 307}