<commit_before>################################################################
 # Run Time Access Library
 # Copyright (C) 2003-2014 <NAME> (<EMAIL>)
 #
 #  This program is distributed under the terms of the GNU LGPL.
 #  See the file COPYING file.
################################################################

################################################################
# Makefile -- to make the librta library.
#    Add or remove debug stuff to meet your needs.  
#    The "standard" target runs the source through indent to
# give the source a standardized look.
################################################################
# We use the default make rules for .c and .l 

CC    ?= gcc
DEBUG ?= -DDEBUG -DYYDEBUG
OPT    = -fPIC -Wall -D_GNU_SOURCE
ifdef CFLAGS
  CFLAGS += $(OPT) $(DEBUG)
else
  CFLAGS = -g -O2 $(OPT) $(DEBUG)
endif

OBJS   = api.o token.o parse.tab.o do_sql.o rtatables.o
LIBS   = 

INSTDIR    ?= /usr/local
INSTLIBDIR ?= $(INSTDIR)/lib
INSTINCDIR ?= $(INSTDIR)/include

default: librta.so.3 librta.a

librta.so.3: $(OBJS)
	$(CC) -g -Wall -shared -Wl,-soname,librta.so.3 \
		-o librta.so.3.0 $(OBJS)
	ln -sf librta.so.3.0 librta.so.3
	ln -sf librta.so.3 librta.so

librta.a: $(OBJS)
	ar -rcs librta.a $(OBJS)

token.o: parse.tab.c do_sql.h

parse.tab.c: parse.y do_sql.h<commit_msg>Allow for chosing bitness of the target build. This way packages for i386 can be built on an x86_64 build host and vice versa.<commit_after>################################################################
 # Run Time Access Library
 # Copyright (C) 2003-2014 <NAME> (<EMAIL>)
 #
 #  This program is distributed under the terms of the GNU LGPL.
 #  See the file COPYING file.
################################################################

################################################################
# Makefile -- to make the librta library.
#    Add or remove debug stuff to meet your needs.  
#    The "standard" target runs the source through indent to
# give the source a standardized look.
################################################################
# We use the default make rules for .c and .l 

# CPU architecture for the build host.
HOST_ARCH := $(shell uname -m)
# Normalized CPU architecture for the target.
TARGET_ARCH ?= $(TARGET_ARCH:i%86=i386)

CC    ?= gcc
DEBUG ?= -DDEBUG -DYYDEBUG
OPT    = -fPIC -Wall -D_GNU_SOURCE
ifdef CFLAGS
  CFLAGS += $(OPT) $(DEBUG)
else
  CFLAGS = -g -O2 $(OPT) $(DEBUG)
endif

# Add flags to cross compile, depending on the bitness.
ifeq ($(TARGET_ARCH), i386)
  ifeq ($(HOST_ARCH), x86_64)
    CC += -m32
  endif
else ($(TARGET_ARCH), x86_64)
  ifeq ($(HOST_ARCH), i386)
    CC += -m64
  endif
endif

OBJS   = api.o token.o parse.tab.o do_sql.o rtatables.o
LIBS   = 

INSTDIR    ?= /usr/local
INSTLIBDIR ?= $(INSTDIR)/lib
INSTINCDIR ?= $(INSTDIR)/include

default: librta.so.3 librta.a

librta.so.3: $(OBJS)
	$(CC) -g -Wall -shared -Wl,-soname,librta.so.3 \
		-o librta.so.3.0 $(OBJS)
	ln -sf librta.so.3.0 librta.so.3
	ln -sf librta.so.3 librta.so

librta.a: $(OBJS)
	ar -rcs librta.a $(OBJS)

token.o: parse.tab.c do_sql.h

parse.tab.c: parse.y do_sql.h
{'fraction_non_alphanumeric': 0.2726110578459572, 'fraction_numerical': 0.02109300095877277, 'mean_word_length': 3.852713178294574, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3654104', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1026, 'n_words': 334}