<commit_before># $Id: mingw.mk,v 1.2 2008/11/05 15:15:53 tho Exp $
#
# import __LIB, OBJS, OBJFORMAT from lib.mk
# export SHLIB_NAME to lib.mk 
# export CPICFLAGS, SHLIB_MAJOR, SHLIB_MINOR, SONAME to userspace
# export {all,install,uninstall,clean}-shared targets to lib.mk

ifdef SHLIB

SHLIB_OBJS = $(OBJS:.o=.so)

##
## automatic rules for shared objects
##
.SUFFIXES: .so $(ALL_EXTS)

$(foreach e,$(CXX_EXTS),$(addsuffix .so,$(e))):
	$(CXX) $(CPICFLAGS) -DBUILD_DLL $(CXXFLAGS) -c $< -o $*.so

$(foreach e,$(C_EXTS),$(addsuffix .so,$(e))):
	$(CC) $(CPICFLAGS) -DBUILD_DLL $(CFLAGS) -c $< -o $*.so

##
## set library naming vars
##
SHLIB_NAME ?= lib$(__LIB).dll

##
## build rules
##
all-shared: $(SHLIB_NAME)

$(SHLIB_NAME): $(SHLIB_OBJS)
	@echo "===> building dynamically linked library $(__LIB)"
	rm -f $(SHLIB_NAME)
	$(CC) -shared -Wl,--out-implib,lib$(__LIB).a -o $(SHLIB_NAME) \
	    `$(LORDER) $(SHLIB_OBJS) | $(TSORT)` $(LDADD) $(LDFLAGS) 

install-shared:
	$(INSTALL) $(__INSTALL_ARGS) -m $(LIBMODE) $(SHLIB_NAME) $(SHLIBDIR)

uninstall-shared:
	rm -f $(SHLIBDIR)/$(SHLIB_NAME)
	-rmdir $(SHLIBDIR) 2>/dev/null

clean-shared:
	rm -f $(SHLIB_OBJS)
	rm -f $(SHLIB_NAME)

endif<commit_msg>[makl] mingw shared library as per http://www.mingw.org/MinGWiki/index.php/sample%20DLL<commit_after># $Id: mingw.mk,v 1.3 2008/11/06 17:25:47 tho Exp $
#
# import __LIB, OBJS, OBJFORMAT from lib.mk
# export SHLIB_NAME to lib.mk 
# export CPICFLAGS, SHLIB_MAJOR, SHLIB_MINOR, SONAME to userspace
# export {all,install,uninstall,clean}-shared targets to lib.mk

ifdef SHLIB

SHLIB_OBJS = $(OBJS:.o=.so)

##
## automatic rules for shared objects
##
.SUFFIXES: .so $(ALL_EXTS)

$(foreach e,$(CXX_EXTS),$(addsuffix .so,$(e))):
	$(CXX) $(CPICFLAGS) $(CXXFLAGS) -c $< -o $*.so

$(foreach e,$(C_EXTS),$(addsuffix .so,$(e))):
	$(CC) $(CPICFLAGS) $(CFLAGS) -c $< -o $*.so

##
## set library naming vars
##
SHLIB_NAME ?= $(__LIB).dll

SHLIB_LDFLAGS += -shared 
# also create an import library in order to interface with objects 
# generated by other toolchains 
SHLIB_LDFLAGS += -Wl,--out-implib,lib$(__LIB).dll.a
# the following makes useless adding dllimport or dllexport attributes 
# to the source code
SHLIB_LDFLAGS += -Wl,-no-undefined -Wl,--enable-runtime-pseudo-reloc

##
## build rules
##
all-shared: $(SHLIB_NAME)

$(SHLIB_NAME): $(SHLIB_OBJS)
	@echo "===> building dynamically linked library $(__LIB)"
	rm -f $(SHLIB_NAME)
	$(__CC) $(SHLIB_LDFLAGS) -o $(SHLIB_NAME) \
	    `$(LORDER) $(SHLIB_OBJS) | $(TSORT)` $(LDADD) $(LDFLAGS) 

install-shared:
	$(INSTALL) $(__INSTALL_ARGS) -m $(LIBMODE) $(SHLIB_NAME) $(SHLIBDIR)

uninstall-shared:
	rm -f $(SHLIBDIR)/$(SHLIB_NAME)
	-rmdir $(SHLIBDIR) 2>/dev/null

clean-shared:
	rm -f $(SHLIB_OBJS)
	rm -f $(SHLIB_NAME)

endif
{'fraction_non_alphanumeric': 0.19145855953673543, 'fraction_numerical': 0.013029315960912053, 'mean_word_length': 4.698969072164949, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '3896417', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1125, 'n_words': 267}