<commit_before># -----------------------------------------------------------------------------
#
# (c) 2009-2012 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------

define shell-wrapper
$(call trace, shell-wrapper($1,$2))
$(call profStart, shell-wrapper($1,$2))
# $1 = dir
# $2 = distdir

ifeq "$$($1_$2_SHELL_WRAPPER_NAME)" ""
$1_$2_SHELL_WRAPPER_NAME = $1/$$($1_$2_PROGNAME).wrapper
endif


ifeq "$$($1_$2_WANT_INPLACE_WRAPPER)" "YES"

$1_$2_INPLACE_SHELL_WRAPPER_NAME = $$($1_$2_PROG)

ifeq "$$($1_$2_TOPDIR)" "YES"
$1_$2_INPLACE_WRAPPER = $$(INPLACE_LIB)/$$($1_$2_INPLACE_SHELL_WRAPPER_NAME)
else
$1_$2_INPLACE_WRAPPER = $$(INPLACE_BIN)/$$($1_$2_INPLACE_SHELL_WRAPPER_NAME)
endif

all_$1_$2 : $$($1_$2_INPLACE_WRAPPER)

$$($1_$2_INPLACE_WRAPPER): WRAPPER=$$@
ifeq "$$($1_$2_SHELL_WRAPPER)" "YES"
$$($1_$2_INPLACE_WRAPPER): $$($1_$2_SHELL_WRAPPER_NAME)
endif
$$($1_$2_INPLACE_WRAPPER): $$($1_$2_INPLACE)
	$$(call removeFiles,                                                    $$@)
	echo '#!$$(SHELL)'                                                   >> $$@
	echo 'executablename="$$(TOP)/$$<"'                                  >> $$@
	echo 'datadir="$$(TOP)/$$(INPLACE_LIB)"'                             >> $$@
	echo 'bindir="$$(TOP)/$$(INPLACE_BIN)"'                              >> $$@
	echo 'topdir="$$(TOP)/$$(INPLACE_TOPDIR)"'                           >> $$@
	echo 'pgmgcc="$$(WhatGccIsCalled)"'                                  >> $$@
	$$($1_$2_SHELL_WRAPPER_EXTRA)
	$$($1_$2_INPLACE_SHELL_WRAPPER_EXTRA)
ifeq "$$(DYNAMIC_GHC_PROGRAMS)" "YES"
	echo '$$(call prependLibraryPath,$$($1_$2_DEP_LIB_DIRS_SEARCHPATH))' >> $$@
endif
ifeq "$$($1_$2_SHELL_WRAPPER)" "YES"
	cat $$($1_$2_SHELL_WRAPPER_NAME)                                     >> $$@
else<commit_msg>Build system: also clean the inplace wrapper<commit_after># -----------------------------------------------------------------------------
#
# (c) 2009-2012 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------

define shell-wrapper
$(call trace, shell-wrapper($1,$2))
$(call profStart, shell-wrapper($1,$2))
# $1 = dir
# $2 = distdir

ifeq "$$($1_$2_SHELL_WRAPPER_NAME)" ""
$1_$2_SHELL_WRAPPER_NAME = $1/$$($1_$2_PROGNAME).wrapper
endif


ifeq "$$($1_$2_WANT_INPLACE_WRAPPER)" "YES"

$1_$2_INPLACE_SHELL_WRAPPER_NAME = $$($1_$2_PROG)

ifeq "$$($1_$2_TOPDIR)" "YES"
$1_$2_INPLACE_WRAPPER = $$(INPLACE_LIB)/$$($1_$2_INPLACE_SHELL_WRAPPER_NAME)
else
$1_$2_INPLACE_WRAPPER = $$(INPLACE_BIN)/$$($1_$2_INPLACE_SHELL_WRAPPER_NAME)
endif

all_$1_$2 : $$($1_$2_INPLACE_WRAPPER)

$(call clean-target,$1,$2_inplace_wrapper,$$($1_$2_INPLACE_WRAPPER))

$$($1_$2_INPLACE_WRAPPER): WRAPPER=$$@
ifeq "$$($1_$2_SHELL_WRAPPER)" "YES"
$$($1_$2_INPLACE_WRAPPER): $$($1_$2_SHELL_WRAPPER_NAME)
endif
$$($1_$2_INPLACE_WRAPPER): $$($1_$2_INPLACE)
	$$(call removeFiles,                                                    $$@)
	echo '#!$$(SHELL)'                                                   >> $$@
	echo 'executablename="$$(TOP)/$$<"'                                  >> $$@
	echo 'datadir="$$(TOP)/$$(INPLACE_LIB)"'                             >> $$@
	echo 'bindir="$$(TOP)/$$(INPLACE_BIN)"'                              >> $$@
	echo 'topdir="$$(TOP)/$$(INPLACE_TOPDIR)"'                           >> $$@
	echo 'pgmgcc="$$(WhatGccIsCalled)"'                                  >> $$@
	$$($1_$2_SHELL_WRAPPER_EXTRA)
	$$($1_$2_INPLACE_SHELL_WRAPPER_EXTRA)
ifeq "$$(DYNAMIC_GHC_PROGRAMS)" "YES"
	echo '$$(call prependLibraryPath,$$($1_$2_DEP_LIB_DIRS_SEARCHPATH))' >> $$@
endif
ifeq "$$($1_$2_SHELL_WRAPPER)" "YES"
	cat $$($1_$2_SHELL_WRAPPER_NAME)                                     >> $$@
else
{'fraction_non_alphanumeric': 0.25064782096584215, 'fraction_numerical': 0.030624263839811542, 'mean_word_length': 2.2838360402165505, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5593630', 'n_tokens_mistral': 1707, 'n_tokens_neox': 1653, 'n_words': 213}