<commit_before>#
# PACKAGE.MK--Build rules for packaging.
#
# Contents:
# package:         --Build a package for the current module.
# staging-root:    --Install the package in a staged root directory.
# release:         --Mark the current version of this package as "released".
# distclean:       --Remove the tarball created by "dist".
# package-vars-ok: --Test that "PACKAGE" and other variables are defined.
#
# Remarks:
# The package module sets up some common definitions and then passes
# off to a package-specific makefile, which must define a top-level
# package-building rule named after the package type (i.e. "deb",
# "rpm", etc.).
#
PVR	= $(PACKAGE)_$(VERSION).$(RELEASE)
VRA	= $(VERSION).$(RELEASE)_$(ARCH)
PVRA	= $(PACKAGE)_$(VERSION).$(RELEASE)_$(ARCH)
STAGING_ROOT = staging-$(PACKAGE)

include $(package:%=package/%.mk)

#
# package: --Build a package for the current module.
#
package: package-vars-ok $(package:%=package-%)

#
# staging-root: --Install the package in a staged root directory.
#
# Remarks:
# This target is constructed as a pattern rule so that packages
# can override it.
#
.SECONDARY: $(STAGING_ROOT)
staging-%:
	$(ECHO_TARGET)
	$(MAKE) install DESTDIR=$$(pwd)/$@ prefix= usr=usr

#
# release: --Mark the current version of this package as "released".
#
release: vcs-tag[$(VERSION).$(RELEASE)]

#
# dist:	--Create a tar.gz distribution file.
#
# Remarks:
# This target execs another make to do a distclean before building the tar.gz.
#
dist:	package-vars-ok $(PVR).tar.gz
$(PVR).tar.gz:
	$(ECHO_TARGET)
	$(MAKE) distclean
	root=$$PWD; \
	    cd ..; ln -s $$root $(PVR); \
	    tar czf $(PVR).tar.gz -h $(VCS_EXCLUDES) $(PVR); \
	    $(RM) $(PVR); \
	    mv $(PVR).tar.gz $$root
#
# distclean: --Remove the tarball created by "dist".
#
distclean:	distclean-package
distclean-package:
	$(RM) $(PVR).tar.gz
	$(RM) -r $(STAGING_ROOT)

#
# package-vars-ok: --Test that "PACKAGE" and other variables are defined.
#
# Remarks:
# The "PACKAGE" variable is used to drive some of the packaging
# targets, so this rule prevents them from running (and failing)
# if PACKAGE is not defined.
#
.PHONY:		package-vars-ok
package-vars-ok:	var-defined[PACKAGE] var-defined[VERSION] var-defined[RELEASE]
<commit_msg>specify packaging w/ "package-type"<commit_after>#
# PACKAGE.MK--Build rules for packaging.
#
# Contents:
# package:         --Build a package for the current module.
# staging-root:    --Install the package in a staged root directory.
# release:         --Mark the current version of this package as "released".
# distclean:       --Remove the tarball created by "dist".
# package-vars-ok: --Test that "PACKAGE" and other variables are defined.
#
# Remarks:
# The package module sets up some common definitions and then passes
# off to a package-specific makefile, which must define a top-level
# package-building rule named after the package type (i.e. "deb",
# "rpm", etc.).
#
export PACKAGE
export VERSION
export RELEASE

PVR	= $(PACKAGE)_$(VERSION).$(RELEASE)
VRA	= $(VERSION).$(RELEASE)_$(ARCH)
PVRA	= $(PACKAGE)_$(VERSION).$(RELEASE)_$(ARCH)
STAGING_ROOT = staging-$(PACKAGE)

include $(package-type:%=package/%.mk)

#
# package: --Build a package for the current module.
#
package: package-vars-ok $(package:%=package-%)

#
# staging-root: --Install the package in a staged root directory.
#
# Remarks:
# This target is constructed as a pattern rule so that packages
# can override it.
#
.SECONDARY: $(STAGING_ROOT)
staging-%:
	$(ECHO_TARGET)
	$(MAKE) install DESTDIR=$$(pwd)/$@ prefix= usr=usr

#
# release: --Mark the current version of this package as "released".
#
release: vcs-tag[$(VERSION).$(RELEASE)]

#
# dist:	--Create a tar.gz distribution file.
#
# Remarks:
# This target execs another make to do a distclean before building the tar.gz.
#
dist:	package-vars-ok $(PVR).tar.gz
$(PVR).tar.gz:
	$(ECHO_TARGET)
	$(MAKE) distclean
	root=$$PWD; \
	    cd ..; ln -s $$root $(PVR); \
	    tar czf $(PVR).tar.gz -h $(VCS_EXCLUDES) $(PVR); \
	    $(RM) $(PVR); \
	    mv $(PVR).tar.gz $$root
#
# distclean: --Remove the tarball created by "dist".
#
distclean:	distclean-package
distclean-package:
	$(RM) $(PVR).tar.gz
	$(RM) -r $(STAGING_ROOT)

#
# package-vars-ok: --Test that "PACKAGE" and other variables are defined.
#
# Remarks:
# The "PACKAGE" variable is used to drive some of the packaging
# targets, so this rule prevents them from running (and failing)
# if PACKAGE is not defined.
#
.PHONY:		package-vars-ok
package-vars-ok:	var-defined[PACKAGE] var-defined[VERSION] var-defined[RELEASE]

{'fraction_non_alphanumeric': 0.15166189742460928, 'fraction_numerical': 0.0, 'mean_word_length': 3.8443496801705757, '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': '604252', 'n_tokens_mistral': 1578, 'n_tokens_neox': 1526, 'n_words': 507}