<commit_before>include utils.mak

CFLAGS = -g -Wall
CFLAGS += $(call cc-option, -Wdeclaration-after-statement)
CFLAGS += $(call cc-option, -Wno-switch)
CFLAGS += $(call cc-option, -Wdisabled-optimization)
CFLAGS += $(call cc-option, -Wpointer-arith)
CFLAGS += $(call cc-option, -Wredundant-decls)
CFLAGS += $(call cc-option, -Wno-pointer-sign)
CFLAGS += $(call cc-option, -Wcast-qual)
CFLAGS += $(call cc-option, -Wwrite-strings)
CFLAGS += $(call cc-option, -Wtype-limits)
CFLAGS += $(call cc-option, -Wundef)

CFLAGS += $(call cc-option, -funit-at-a-time)

NAPA ?= NAPA
GRAPES ?= GRAPES

CPPFLAGS = -I$(NAPA)/include
CPPFLAGS += -I$(GRAPES)/include

ifdef DEBUG
CFLAGS += -O0
CPPFLAGS += -DDEBUG
OBJS += dbg.o
endif

ifdef DEBUGOUT
CPPFLAGS += -DDEBUGOUT
endif

LDFLAGS += -L$(GRAPES)/som
LDLIBS += -lgrapes
ifdef ML
LDFLAGS += -L$(NAPA)/ml -L$(LIBEVENT)/lib
LDLIBS += -lml -lm
CPPFLAGS += -I$(LIBEVENT)/include
ifdef MONL
LDFLAGS += -L$(NAPA)/dclog -L$(NAPA)/rep -L$(NAPA)/monl -L$(NAPA)/common
LDLIBS += -lstdc++ -lmon -lrep -ldclog -lcommon
CPPFLAGS += -DMONL
ifdef STATIC
CC=g++
endif
endif
LDLIBS += -levent
endif

OBJS += streaming.o
OBJS += input.o
OBJS += output.o 
OBJS += net_helpers.o 
OBJS += topology.o
OBJS += chunk_signaling.o
OBJS += chunklock.o
ifdef THREADS
OBJS += loop-mt.o
CFLAGS += -pthread
LDFLAGS += -pthread
else
OBJS += loop.o
endif

ifdef MONL
OBJS += measures.o
endif

ifndef DUMMY
FFDIR ?= ffmpeg
FFSRC ?= $(FFDIR)
OBJS += Chunkiser/input-stream-avs.o out-stream-avf.o
LDFLAGS += -L$(FFDIR)/libavcodec -L$(FFDIR)/libavformat -L$(FFDIR)/libavutil
LDLIBS += -lavformat -lavcodec -lavutil
LDLIBS += -lm
LDLIBS += $(call ld-option, -lz)
LDLIBS += $(call ld-option, -lbz2)
else
OBJS += input-stream-dummy.o out-stream-dummy.o
endif

EXECTARGET = offerstreamer
ifdef ML
EXECTARGET := $(EXECTARGET)-ml
endif
ifdef THREADS
EXECTARGET := $(EXECTARGET)-threads
endif

ifdef STATIC
LDFLAGS += -static
EXECTARGET := $(EXECTARGET)-static
endif

ifdef RELEASE
EXECTARGET := $(EXECTARGET)-$(RELEASE)
endif

all: $(EXECTARGET)

ifndef ML
$(EXECTARGET): $(OBJS) $(GRAPES)/som/net_helper.o
else
$(EXECTARGET): $(OBJS) $(NAPA)/som/net_helper-ml.o
endif

$(EXECTARGET).o: streamer.o
	ln -sf streamer.o $(EXECTARGET).o

out-stream-avf.o Chunkiser/input-stream-avs.o: CPPFLAGS += -I$(FFSRC) 

GRAPES:
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3

ffmpeg:
	(wget http://ffmpeg.org/releases/ffmpeg-checkout-snapshot.tar.bz2; tar xjf ffmpeg-checkout-snapshot.tar.bz2; mv ffmpeg-checkout-20* ffmpeg) || svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
	cd ffmpeg; ./configure

prepare: $(GRAPES) $(FFSRC)
	$(MAKE) -C $(GRAPES)/som -f Makefile
ifdef ML
	cd $(NAPA); ./autogen.sh; $(MAKE)
endif
	$(MAKE) -C $(FFSRC)

clean:
	rm -f $(EXECTARGET)
	rm -f $(NAPA)/som/net_helper-ml.o
	rm -f $(GRAPES)/som/net_helper.o
	rm -f *.o
<commit_msg>adding one more dependence (lrt) for the sake of libevent 2.0.3+<commit_after>include utils.mak

CFLAGS = -g -Wall
CFLAGS += $(call cc-option, -Wdeclaration-after-statement)
CFLAGS += $(call cc-option, -Wno-switch)
CFLAGS += $(call cc-option, -Wdisabled-optimization)
CFLAGS += $(call cc-option, -Wpointer-arith)
CFLAGS += $(call cc-option, -Wredundant-decls)
CFLAGS += $(call cc-option, -Wno-pointer-sign)
CFLAGS += $(call cc-option, -Wcast-qual)
CFLAGS += $(call cc-option, -Wwrite-strings)
CFLAGS += $(call cc-option, -Wtype-limits)
CFLAGS += $(call cc-option, -Wundef)

CFLAGS += $(call cc-option, -funit-at-a-time)

NAPA ?= NAPA
GRAPES ?= GRAPES

CPPFLAGS = -I$(NAPA)/include
CPPFLAGS += -I$(GRAPES)/include

ifdef DEBUG
CFLAGS += -O0
CPPFLAGS += -DDEBUG
OBJS += dbg.o
endif

ifdef DEBUGOUT
CPPFLAGS += -DDEBUGOUT
endif

LDFLAGS += -L$(GRAPES)/som
LDLIBS += -lgrapes
ifdef ML
LDFLAGS += -L$(NAPA)/ml -L$(LIBEVENT)/lib
LDLIBS += -lml -lm
CPPFLAGS += -I$(LIBEVENT)/include
ifdef MONL
LDFLAGS += -L$(NAPA)/dclog -L$(NAPA)/rep -L$(NAPA)/monl -L$(NAPA)/common
LDLIBS += -lstdc++ -lmon -lrep -ldclog -lcommon
CPPFLAGS += -DMONL
ifdef STATIC
CC=g++
endif
endif
LDLIBS += -levent -lrt
endif

OBJS += streaming.o
OBJS += input.o
OBJS += output.o 
OBJS += net_helpers.o 
OBJS += topology.o
OBJS += chunk_signaling.o
OBJS += chunklock.o
ifdef THREADS
OBJS += loop-mt.o
CFLAGS += -pthread
LDFLAGS += -pthread
else
OBJS += loop.o
endif

ifdef MONL
OBJS += measures.o
endif

ifndef DUMMY
FFDIR ?= ffmpeg
FFSRC ?= $(FFDIR)
OBJS += Chunkiser/input-stream-avs.o out-stream-avf.o
LDFLAGS += -L$(FFDIR)/libavcodec -L$(FFDIR)/libavformat -L$(FFDIR)/libavutil
LDLIBS += -lavformat -lavcodec -lavutil
LDLIBS += -lm
LDLIBS += $(call ld-option, -lz)
LDLIBS += $(call ld-option, -lbz2)
else
OBJS += input-stream-dummy.o out-stream-dummy.o
endif

EXECTARGET = offerstreamer
ifdef ML
EXECTARGET := $(EXECTARGET)-ml
endif
ifdef THREADS
EXECTARGET := $(EXECTARGET)-threads
endif

ifdef STATIC
LDFLAGS += -static
EXECTARGET := $(EXECTARGET)-static
endif

ifdef RELEASE
EXECTARGET := $(EXECTARGET)-$(RELEASE)
endif

all: $(EXECTARGET)

ifndef ML
$(EXECTARGET): $(OBJS) $(GRAPES)/som/net_helper.o
else
$(EXECTARGET): $(OBJS) $(NAPA)/som/net_helper-ml.o
endif

$(EXECTARGET).o: streamer.o
	ln -sf streamer.o $(EXECTARGET).o

out-stream-avf.o Chunkiser/input-stream-avs.o: CPPFLAGS += -I$(FFSRC) 

GRAPES:
	git clone http://www.disi.unitn.it/~kiraly/PublicGits/GRAPES.git
	cd GRAPES; git checkout -b for-streamer-0.8.3 origin/for-streamer-0.8.3

ffmpeg:
	(wget http://ffmpeg.org/releases/ffmpeg-checkout-snapshot.tar.bz2; tar xjf ffmpeg-checkout-snapshot.tar.bz2; mv ffmpeg-checkout-20* ffmpeg) || svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
	cd ffmpeg; ./configure

prepare: $(GRAPES) $(FFSRC)
	$(MAKE) -C $(GRAPES)/som -f Makefile
ifdef ML
	cd $(NAPA); ./autogen.sh; $(MAKE)
endif
	$(MAKE) -C $(FFSRC)

clean:
	rm -f $(EXECTARGET)
	rm -f $(NAPA)/som/net_helper-ml.o
	rm -f $(GRAPES)/som/net_helper.o
	rm -f *.o

{'fraction_non_alphanumeric': 0.174645987862441, 'fraction_numerical': 0.004551584625758598, 'mean_word_length': 4.154648132059079, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2285314', 'n_tokens_mistral': 2526, 'n_tokens_neox': 2458, 'n_words': 561}