<commit_before># --- Distribution ---
# This section 
# Two main targets:
#   release - zips up the source
#   dist    - collects and creates the files necessary for an online Stata repo
#     unfortunately, because it is impossible to do all the building on one machine,
#     this only collects whatever it finds. You will need to manually merge the various builds.

$(call FixPath,../statasvm.%):
#at this writing, git doesn't let you say ".." as a path: it thinks it's "out of the repository", so instead we cd and hardcode the filename
	cd .. && git archive --format=$* -o statasvm.$* HEAD

ifndef RELEASE_FORMAT
  RELEASE_FORMAT:=zip
endif
.PHONY: release
release: ../statasvm.$(RELEASE_FORMAT)


DIST:=$(wildcard *.ado) $(wildcard bin/*/*)
DIST:=$(patsubst %,dist/svm/%,$(DIST))

ifeq ($(wildcard bin/),) #if bin/ does not not exist
# trick make
.PHONY: bin-warning
bin-warning:
	@echo --------------------------------------------------------------
	@echo No bin/ folder found. Please \'make\' first.
	@echo
	@echo You cannot \'make dist\' directly, because to do a proper
	@echo distribution you need to \'make\' on all the different build
	@echo  machines and manually sync their results. 
#	and in particular there's no way to arrange svm.pkg to pick up bin/
#	files which don't exist at the start of make, because make expands depends eagerly
	@echo --------------------------------------------------------------
	@false
dist: bin-warning
endif


dist: dist/svm.pkg $(DIST)
dist: dist/stata.toc

# tricky:
# the mixed lazy and eager evaluation modes of make are tripping me up
# DIST is lazy, which means it is evaluated *anew* everytime it is asked for
# but dependencies are always evaluated eagerly
# so saying "the .pkg file depends on having all these other files in place"
# *doesn't work* under "make clean; make dist" because after make clean bin/*/* is missing, so dist/%.pkg ends up only depending on the .ado files
# but it *does* under "make clean; make; make dist"
# Something is creaking badly here.

# XXX clean this up
# factor out the 'make stata repos' and 'make stata packages' parts
dist/stata.toc: ../scripts/maketoc
	@mkdir -p $(dir $@)
	../scripts/maketoc $(dir $@) "$(DESCRIPTION)"

dist/stata.toc: DESCRIPTION:=nguenthe's Stata repo


dist/%.pkg: $(DIST) ../scripts/makepluginpkg
	@mkdir -p $(dir $@)
	../scripts/makepluginpkg "$@" "$(DESCRIPTION)" "$(AUTHOR)"

# copy listed files into the distribution directory
dist/svm/%: %
	@mkdir -p $(dir $@)
	$(CP) $< $@
	

# --- cleaning ---
clean: clean-dist

.PHONY: clean-dist
clean-dist:
	-$(RMDIR) dist
<commit_msg>Include manual pages in `make dist`<commit_after># --- Distribution ---
# This section 
# Two main targets:
#   release - zips up the source
#   dist    - collects and creates the files necessary for an online Stata repo
#     unfortunately, because it is impossible to do all the building on one machine,
#     this only collects whatever it finds. You will need to manually merge the various builds.

$(call FixPath,../statasvm.%):
#at this writing, git doesn't let you say ".." as a path: it thinks it's "out of the repository", so instead we cd and hardcode the filename
	cd .. && git archive --format=$* -o statasvm.$* HEAD

ifndef RELEASE_FORMAT
  RELEASE_FORMAT:=zip
endif
.PHONY: release
release: ../statasvm.$(RELEASE_FORMAT)


DIST:=$(wildcard *.ado *.sthlp wildcard bin/*/*)
DIST:=$(patsubst %,dist/svm/%,$(DIST))

ifeq ($(wildcard bin/),) #if bin/ does not not exist
# trick make
.PHONY: bin-warning
bin-warning:
	@echo --------------------------------------------------------------
	@echo No bin/ folder found. Please \'make\' first.
	@echo
	@echo You cannot \'make dist\' directly, because to do a proper
	@echo distribution you need to \'make\' on all the different build
	@echo  machines and manually sync their results. 
#	and in particular there's no way to arrange svm.pkg to pick up bin/
#	files which don't exist at the start of make, because make expands depends eagerly
	@echo --------------------------------------------------------------
	@false
dist: bin-warning
endif


dist: dist/svm.pkg $(DIST)
dist: dist/stata.toc

# tricky:
# the mixed lazy and eager evaluation modes of make are tripping me up
# DIST is lazy, which means it is evaluated *anew* everytime it is asked for
# but dependencies are always evaluated eagerly
# so saying "the .pkg file depends on having all these other files in place"
# *doesn't work* under "make clean; make dist" because after make clean bin/*/* is missing, so dist/%.pkg ends up only depending on the .ado files
# but it *does* under "make clean; make; make dist"
# Something is creaking badly here.

# XXX clean this up
# factor out the 'make stata repos' and 'make stata packages' parts
dist/stata.toc: ../scripts/maketoc
	@mkdir -p $(dir $@)
	../scripts/maketoc $(dir $@) "$(DESCRIPTION)"

dist/stata.toc: DESCRIPTION:=nguenthe's Stata repo


dist/%.pkg: $(DIST) ../scripts/makepluginpkg
	@mkdir -p $(dir $@)
	../scripts/makepluginpkg "$@" "$(DESCRIPTION)" "$(AUTHOR)"

# copy listed files into the distribution directory
dist/svm/%: %
	@mkdir -p $(dir $@)
	$(CP) $< $@
	

# --- cleaning ---
clean: clean-dist

.PHONY: clean-dist
clean-dist:
	-$(RMDIR) dist

{'fraction_non_alphanumeric': 0.16523071031973963, 'fraction_numerical': 0.0, 'mean_word_length': 3.0, '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': '7336601', 'n_tokens_mistral': 1636, 'n_tokens_neox': 1517, 'n_words': 674}