<commit_before># This file describes what to do in order to build a package for GHC.

LIBNAME			?= $(PACKAGENAME)

TARGETOK		= $(addprefix $(strip $(LIBPREFIX)),\
			$(addsuffix $(LIBSUFFIX),$(strip $(LIBNAME))))


makeTextList		= $(addprefix \",$(addsuffix \",\
			$(subst $(SPACE),\"$(COMMA)\",$(sort $(1)))))

noinplace : inplaceinit
	@if $(PKG) -f $(LOCALPKGCONF) $(LISTLOCAL) | $(GREP) $(PACKAGENAME) \
	  > /dev/null; then \
	  echo Removing old local entry for \"$(PACKAGENAME)\".; \
          $(PKG) -f $(LOCALPKGCONF) -r $(PACKAGENAME) > /dev/null; \
	fi

inplace	: noinplace
	@echo Adding package description to local package file.
	@echo Package {\
	  name			= \"$(PACKAGENAME)\",\
	  import_dirs		= [$(call makeTextList, $(INPL_HIDIR))],\
	  source_dirs		= [],\
	  library_dirs		= [$(call makeTextList, $(INPL_LIBDIR) \
	  $(patsubst -L%,%,$(filter -L%,$(EXTRA_LIBS_ONLY_L) \
	  $(LIBS_ONLY_L))))],\
	  hs_libraries		= [\"$(LIBNAME)\"],\
	  extra_libraries	= [$(call makeTextList,\
	  $(patsubst -l%,%,$(filter -l%,$(EXTRA_LIBS_ONLY_Ll) \
	  $(LIBS_ONLY_L))))],\
	  include_dirs		= [$(call makeTextList, $(INPL_INCLDIR)\
	  $(patsubst -I%,%,$(EXTRA_CPPFLAGS_ONLY_I)))],\
	  c_includes		= [$(call makeTextList,\
	  			  $(notdir $(STUBHFILES)) $(HEADER)\
				  $(EXTRA_HFILESOK))],\
	  package_deps		= [$(call makeTextList,$(NEEDPACKAGES))],\
	  extra_ghc_opts	= [$(call makeTextList,$(EXTRAHC_FLAGS))],\
	  extra_cc_opts		= [],\
	  extra_ld_opts		= [$(call makeTextList,\
          $(addprefix -Wl$(COMMA),\
	  $(addprefix --subsystem$(SPACE),$(SUBSYSTEM))) \
	  $(addprefix -u ,$(EXTRA_SYMBOLS)))]} | \
	  $(PKG) --force -g -f $(LOCALPKGCONF) -a  > /dev/null

installcheck :
	@if $(PKG) -l | $(GREP) $(PACKAGENAME) > /dev/null; then \
	  echo There is already a global package of the name $(PACKAGENAME).; \
	  echo Remove this package with \`make uninstall\' first.; \
	  exit 1; \
	fi

installdirs :
	$(INSTALL) -d $(DESTDIR)$(INST_HIDIR) $(DESTDIR)$(INST_LIBDIR) $(DESTDIR)$(INST_INCLDIR)

install : $(TARGETOK) installdirs installfiles install-pkg

installfiles : $(PACKAGENAME).conf
	$(INSTALL) -m644 $(ALLHSFILES:.hs=.hi) $(DESTDIR)$(INST_HIDIR)
	$(INSTALL) -m644 $(TARGETOK) $(DESTDIR)$(INST_LIBDIR)
	$(TOUCH) -r $(TARGETOK) $(DESTDIR)$(INST_LIBDIR)/$(TARGETOK)
ifneq ($(strip $(STUBHFILES) $(EXTRA_HFILESOK)),)
	$(INSTALL) -m644 $(STUBHFILES) $(EXTRA_HFILESOK) $(DESTDIR)$(INST_INCLDIR)
endif
	$(INSTALL) -m644 $(PACKAGENAME).conf $(DESTDIR)$(INST_LIBDIR)

$(PACKAGENAME).conf :
	@echo Package {\
	  name			= \"$(PACKAGENAME)\",\
	  import_dirs		= [\"$(INST_HIDIR)\"],\
	  source_dirs		= [],\
	  library_dirs		= [$(call makeTextList, $(INST_LIBDIR) \
	  $(patsubst -L%,%,$(EXTRA_LIBS_ONLY_L)))],\
	  hs_libraries		= [\"$(LIBNAME)\"],\
	  extra_libraries	= [$(call makeTextList,\
	  $(patsubst -l%,%,$(filter -l%,$(EXTRA_LIBS_ONLY_Ll) \
	  $(LIBS_ONLY_L))))],\
	  include_dirs		= [$(call makeTextList, $(INST_INCLDIR)\
	  $(patsubst -I%,%,$(EXTRA_CPPFLAGS_ONLY_I)))],\
	  c_includes		= [$(call makeTextList,\
	  			  $(notdir $(STUBHFILES)) $(HEADER)\
				  $(notdir $(EXTRA_HFILESOK)))],\
	  package_deps		= [$(call makeTextList,$(NEEDPACKAGES))],\
	  extra_ghc_opts	= [$(call makeTextList,$(EXTRAHC_FLAGS))],\<commit_msg>[project @ 2003-07-15 08:47:18 by juhp] (install-without-pkg): New target that installs library without installing ghc package. (install): Use it.<commit_after># This file describes what to do in order to build a package for GHC.

LIBNAME			?= $(PACKAGENAME)

TARGETOK		= $(addprefix $(strip $(LIBPREFIX)),\
			$(addsuffix $(LIBSUFFIX),$(strip $(LIBNAME))))


makeTextList		= $(addprefix \",$(addsuffix \",\
			$(subst $(SPACE),\"$(COMMA)\",$(sort $(1)))))

noinplace : inplaceinit
	@if $(PKG) -f $(LOCALPKGCONF) $(LISTLOCAL) | $(GREP) $(PACKAGENAME) \
	  > /dev/null; then \
	  echo Removing old local entry for \"$(PACKAGENAME)\".; \
          $(PKG) -f $(LOCALPKGCONF) -r $(PACKAGENAME) > /dev/null; \
	fi

inplace	: noinplace
	@echo Adding package description to local package file.
	@echo Package {\
	  name			= \"$(PACKAGENAME)\",\
	  import_dirs		= [$(call makeTextList, $(INPL_HIDIR))],\
	  source_dirs		= [],\
	  library_dirs		= [$(call makeTextList, $(INPL_LIBDIR) \
	  $(patsubst -L%,%,$(filter -L%,$(EXTRA_LIBS_ONLY_L) \
	  $(LIBS_ONLY_L))))],\
	  hs_libraries		= [\"$(LIBNAME)\"],\
	  extra_libraries	= [$(call makeTextList,\
	  $(patsubst -l%,%,$(filter -l%,$(EXTRA_LIBS_ONLY_Ll) \
	  $(LIBS_ONLY_L))))],\
	  include_dirs		= [$(call makeTextList, $(INPL_INCLDIR)\
	  $(patsubst -I%,%,$(EXTRA_CPPFLAGS_ONLY_I)))],\
	  c_includes		= [$(call makeTextList,\
	  			  $(notdir $(STUBHFILES)) $(HEADER)\
				  $(EXTRA_HFILESOK))],\
	  package_deps		= [$(call makeTextList,$(NEEDPACKAGES))],\
	  extra_ghc_opts	= [$(call makeTextList,$(EXTRAHC_FLAGS))],\
	  extra_cc_opts		= [],\
	  extra_ld_opts		= [$(call makeTextList,\
          $(addprefix -Wl$(COMMA),\
	  $(addprefix --subsystem$(SPACE),$(SUBSYSTEM))) \
	  $(addprefix -u ,$(EXTRA_SYMBOLS)))]} | \
	  $(PKG) --force -g -f $(LOCALPKGCONF) -a  > /dev/null

installcheck :
	@if $(PKG) -l | $(GREP) $(PACKAGENAME) > /dev/null; then \
	  echo There is already a global package of the name $(PACKAGENAME).; \
	  echo Remove this package with \`make uninstall\' first.; \
	  exit 1; \
	fi

installdirs :
	$(INSTALL) -d $(DESTDIR)$(INST_HIDIR) $(DESTDIR)$(INST_LIBDIR) $(DESTDIR)$(INST_INCLDIR)

install-without-pkg : $(TARGETOK) installdirs installfiles

install : install-without-pkg install-pkg

installfiles : $(PACKAGENAME).conf
	$(INSTALL) -m644 $(ALLHSFILES:.hs=.hi) $(DESTDIR)$(INST_HIDIR)
	$(INSTALL) -m644 $(TARGETOK) $(DESTDIR)$(INST_LIBDIR)
	$(TOUCH) -r $(TARGETOK) $(DESTDIR)$(INST_LIBDIR)/$(TARGETOK)
ifneq ($(strip $(STUBHFILES) $(EXTRA_HFILESOK)),)
	$(INSTALL) -m644 $(STUBHFILES) $(EXTRA_HFILESOK) $(DESTDIR)$(INST_INCLDIR)
endif
	$(INSTALL) -m644 $(PACKAGENAME).conf $(DESTDIR)$(INST_LIBDIR)

$(PACKAGENAME).conf :
	@echo Package {\
	  name			= \"$(PACKAGENAME)\",\
	  import_dirs		= [\"$(INST_HIDIR)\"],\
	  source_dirs		= [],\
	  library_dirs		= [$(call makeTextList, $(INST_LIBDIR) \
	  $(patsubst -L%,%,$(EXTRA_LIBS_ONLY_L)))],\
	  hs_libraries		= [\"$(LIBNAME)\"],\
	  extra_libraries	= [$(call makeTextList,\
	  $(patsubst -l%,%,$(filter -l%,$(EXTRA_LIBS_ONLY_Ll) \
	  $(LIBS_ONLY_L))))],\
	  include_dirs		= [$(call makeTextList, $(INST_INCLDIR)\
	  $(patsubst -I%,%,$(EXTRA_CPPFLAGS_ONLY_I)))],\
	  c_includes		= [$(call makeTextList,\
	  			  $(notdir $(STUBHFILES)) $(HEADER)\
				  $(notdir $(EXTRA_HFILESOK)))],\
	  package_deps		= [$(call makeTextList,$(NEEDPACKAGES))],\
	  extra_ghc_opts	= [$(call makeTextList,$(EXTRAHC_FLAGS))],\
{'fraction_non_alphanumeric': 0.21134794356049236, 'fraction_numerical': 0.006304413089162414, 'mean_word_length': 4.113584036838066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2677705', 'n_tokens_mistral': 2891, 'n_tokens_neox': 2665, 'n_words': 498}