<commit_before># Copyright 2007-2008 <NAME> 

# We should strive to keep this Makefile working with the default make
# shipped with the OS's we support. Mainly because I'm lazy and just want
# to type make instead of gmake, but also so that other distros can pick
# it up and not rely on GNU Make.

CC ?= gcc
CFLAGS += -O2 -pipe
LDFLAGS += -L.

# GNU Make way of detecting gcc flags we can use
check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
	  then echo "$(1)"; else echo "$(2)"; fi)

# pmake check for extra cflags 
WEXTRA != for x in -Wdeclaration-after-statement -Wsequence-point -Wextra; do \
	if $(CC) -W$$x -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
	then echo -n "$$x "; fi \
	done

# Loads of nice flags to ensure our code is good
CFLAGS += -pedantic -std=c99 \
    -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \
    -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \
    -Wbad-function-cast -Wnested-externs -Wcomment -Winline \
    -Wchar-subscripts -Wcast-align -Wno-format-nonliteral \
    $(call check_gcc, -Wdeclaration-after-statement) \
    $(call check_gcc, -Wsequence-point) \
    $(call check_gcc, -Wextra) $(WEXTRA)

# For debugging. -Werror is pointless due to ISO C issues with dlsym
#CFLAGS += -ggdb

# Set PAM = pam for pam support
PAM = 

# Set TERMCAP = termcap for termcap support
TERMCAP =

LIBEINFOSOVER = 1
LIBEINFOSO = libeinfo.so.$(LIBRCSOVER)
LIBEINFOOBJS= libeinfo.o
LDLIBS_LIBEINFO =

LIBRCSOVER = 1
LIBRCSO = librc.so.$(LIBRCSOVER)
LIBRCOBJS = librc.o librc-depend.o librc-daemon.o librc-misc.o librc-strlist.o
LDLIBS_LIBRC =

RCOBJS = checkpath.o fstabinfo.o mountinfo.o \
		 rc-depend.o rc-logger.o rc-misc.o rc-plugin.o rc-status.o \
		 rc-update.o \
		 runscript.o  start-stop-daemon.o rc.o
LDLIBS_RC = -leinfo -lrc -lutil

LIB_TARGETS = $(LIBEINFOSO) $(LIBRCSO)
ULIB_TARGETS = libeinfo.a librc.a
SBIN_TARGETS = rc
SYS_WHITELIST = env_whitelist

TARGET = $(LIB_TARGETS) $(BIN_TARGETS) $(SBIN_TARGETS)

RC_BINLINKS = einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \
			  eindent eoutdent esyslog eval_ecolors \
			  veinfo vewarn vebegin veend vewend veindent veoutdent \
			  service_starting service_started \
			  service_stopping service_stopped \
			  service_inactive service_wasinactive \
			  service_coldplugged service_started_daemon \
			  checkpath fstabinfo mountinfo rc-depend \
			  service_get_value service_set_value get_options save_options \
			  shell_var
RC_SBINLINKS =  mark_service_starting mark_service_started \
				mark_service_stopping mark_service_stopped \
				mark_service_inactive mark_service_wasinactive \
				mark_service_coldplugged mark_service_failed \
				rc-abort
BINLINKS = rc-status
SBINLINKS = rc-update runscript start-stop-daemon
ALL_LINKS = $(BINLINKS) $(SBINLINKS) $(RC_BINLINKS) $(RC_SBINLINKS)

CPPFLAGS += -DLIB=\"$(LIB)\"

# IMPORTANT!!!
# Ensure that we don't ship with a .svn directory to avoid RPATH security
# issues. However, this does ease development a little
LDFLAGS += -Wl,-rpath .

# Load an optional Makefiles - the order is important
TOPDIR = ..
include $(TOPDIR)/default.mk
include Makefile.$(TERMCAP)
include Makefile.$(OS)
include Makefile.$(PAM)

all: .depend $(TARGET)

version.h:
	sed -n -e 's/^VERSION =[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1\"/p' ../Makefile > version.h
	if test -n "${BRANDING}"; then \
		echo "#define BRANDING \"${BRANDING}\"" >> version.h; \
	fi

$(LIBEINFOOBJS):
	$(CC) $(CPPFLAGS) $(CPPFLAGS_LIBEINFO) $(CFLAGS) -fPIC -c $<
$(LIBEINFOSO): einfo.map $(LIBEINFOOBJS) 
	$(CC) $(LDFLAGS) -fPIC -shared \
		-Wl,-soname,$(LIBEINFOSO) \
		-Wl,-version-script einfo.map \
		-o $(LIBEINFOSO) $(LIBEINFOOBJS) $(LDLIBS_LIBEINFO)
	ln -sf $(LIBEINFOSO) libeinfo.so
	ar rc libeinfo.a $(LIBEINFOOBJS)
	ranlib libeinfo.a

$(LIBRCOBJS):
	$(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $<
$(LIBRCSO): rc.map $(LIBRCOBJS)
	$(CC) $(LDFLAGS) -fPIC -shared \
		-Wl,-soname,$(LIBRCSO) \
		-Wl,-version-script rc.map \
		-o $(LIBRCSO) $(LIBRCOBJS) $(LDLIBS_LIBRC)
	ln -sf $(LIBRCSO) librc.so
	ar rc librc.a $(LIBRCOBJS)
	ranlib librc.a

$(RCOBJS):
	$(CC) $(CPPFLAGS) $(CPPFLAGS_SSD) $(CFLAGS) -c $<
rc: version.h $(LIBEINFOSO) $(LIBRCSO) $(RCOBJS)
	$(CC) $(LDFLAGS) $(BIN_LDFLAGS) -o rc $(RCOBJS) $(LDLIBS_RC)

$(ALL_LINKS): rc
	ln -sf rc $@<commit_msg>do not hardcode ar or ranlib<commit_after># Copyright 2007-2008 <NAME> 

# We should strive to keep this Makefile working with the default make
# shipped with the OS's we support. Mainly because I'm lazy and just want
# to type make instead of gmake, but also so that other distros can pick
# it up and not rely on GNU Make.

CC ?= gcc
AR ?= ar
RANLIB ?= ranlib
CFLAGS += -O2 -pipe
LDFLAGS += -L.

# GNU Make way of detecting gcc flags we can use
check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
	  then echo "$(1)"; else echo "$(2)"; fi)

# pmake check for extra cflags 
WEXTRA != for x in -Wdeclaration-after-statement -Wsequence-point -Wextra; do \
	if $(CC) -W$$x -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
	then echo -n "$$x "; fi \
	done

# Loads of nice flags to ensure our code is good
CFLAGS += -pedantic -std=c99 \
    -Wall -Wunused -Wimplicit -Wshadow -Wformat=2 \
    -Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \
    -Wbad-function-cast -Wnested-externs -Wcomment -Winline \
    -Wchar-subscripts -Wcast-align -Wno-format-nonliteral \
    $(call check_gcc, -Wdeclaration-after-statement) \
    $(call check_gcc, -Wsequence-point) \
    $(call check_gcc, -Wextra) $(WEXTRA)

# For debugging. -Werror is pointless due to ISO C issues with dlsym
#CFLAGS += -ggdb

# Set PAM = pam for pam support
PAM = 

# Set TERMCAP = termcap for termcap support
TERMCAP =

LIBEINFOSOVER = 1
LIBEINFOSO = libeinfo.so.$(LIBRCSOVER)
LIBEINFOOBJS= libeinfo.o
LDLIBS_LIBEINFO =

LIBRCSOVER = 1
LIBRCSO = librc.so.$(LIBRCSOVER)
LIBRCOBJS = librc.o librc-depend.o librc-daemon.o librc-misc.o librc-strlist.o
LDLIBS_LIBRC =

RCOBJS = checkpath.o fstabinfo.o mountinfo.o \
		 rc-depend.o rc-logger.o rc-misc.o rc-plugin.o rc-status.o \
		 rc-update.o \
		 runscript.o  start-stop-daemon.o rc.o
LDLIBS_RC = -leinfo -lrc -lutil

LIB_TARGETS = $(LIBEINFOSO) $(LIBRCSO)
ULIB_TARGETS = libeinfo.a librc.a
SBIN_TARGETS = rc
SYS_WHITELIST = env_whitelist

TARGET = $(LIB_TARGETS) $(BIN_TARGETS) $(SBIN_TARGETS)

RC_BINLINKS = einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \
			  eindent eoutdent esyslog eval_ecolors \
			  veinfo vewarn vebegin veend vewend veindent veoutdent \
			  service_starting service_started \
			  service_stopping service_stopped \
			  service_inactive service_wasinactive \
			  service_coldplugged service_started_daemon \
			  checkpath fstabinfo mountinfo rc-depend \
			  service_get_value service_set_value get_options save_options \
			  shell_var
RC_SBINLINKS =  mark_service_starting mark_service_started \
				mark_service_stopping mark_service_stopped \
				mark_service_inactive mark_service_wasinactive \
				mark_service_coldplugged mark_service_failed \
				rc-abort
BINLINKS = rc-status
SBINLINKS = rc-update runscript start-stop-daemon
ALL_LINKS = $(BINLINKS) $(SBINLINKS) $(RC_BINLINKS) $(RC_SBINLINKS)

CPPFLAGS += -DLIB=\"$(LIB)\"

# IMPORTANT!!!
# Ensure that we don't ship with a .svn directory to avoid RPATH security
# issues. However, this does ease development a little
LDFLAGS += -Wl,-rpath .

# Load an optional Makefiles - the order is important
TOPDIR = ..
include $(TOPDIR)/default.mk
include Makefile.$(TERMCAP)
include Makefile.$(OS)
include Makefile.$(PAM)

all: .depend $(TARGET)

version.h:
	sed -n -e 's/^VERSION =[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1\"/p' ../Makefile > version.h
	if test -n "${BRANDING}"; then \
		echo "#define BRANDING \"${BRANDING}\"" >> version.h; \
	fi

$(LIBEINFOOBJS):
	$(CC) $(CPPFLAGS) $(CPPFLAGS_LIBEINFO) $(CFLAGS) -fPIC -c $<
$(LIBEINFOSO): einfo.map $(LIBEINFOOBJS) 
	$(CC) $(LDFLAGS) -fPIC -shared \
		-Wl,-soname,$(LIBEINFOSO) \
		-Wl,-version-script einfo.map \
		-o $(LIBEINFOSO) $(LIBEINFOOBJS) $(LDLIBS_LIBEINFO)
	ln -sf $(LIBEINFOSO) libeinfo.so
	$(AR) rc libeinfo.a $(LIBEINFOOBJS)
	$(RANLIB) libeinfo.a

$(LIBRCOBJS):
	$(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $<
$(LIBRCSO): rc.map $(LIBRCOBJS)
	$(CC) $(LDFLAGS) -fPIC -shared \
		-Wl,-soname,$(LIBRCSO) \
		-Wl,-version-script rc.map \
		-o $(LIBRCSO) $(LIBRCOBJS) $(LDLIBS_LIBRC)
	ln -sf $(LIBRCSO) librc.so
	$(AR) rc librc.a $(LIBRCOBJS)
	$(RANLIB) librc.a

$(RCOBJS):
	$(CC) $(CPPFLAGS) $(CPPFLAGS_SSD) $(CFLAGS) -c $<
rc: version.h $(LIBEINFOSO) $(LIBRCSO) $(RCOBJS)
	$(CC) $(LDFLAGS) $(BIN_LDFLAGS) -o rc $(RCOBJS) $(LDLIBS_RC)

$(ALL_LINKS): rc
	ln -sf rc $@
{'fraction_non_alphanumeric': 0.13956157465855618, 'fraction_numerical': 0.005049925398829335, 'mean_word_length': 3.730727470141151, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '4064575', 'n_tokens_mistral': 3618, 'n_tokens_neox': 3396, 'n_words': 889}