<commit_before>include ../Makefile.config

.PHONY: all
all: ../simlib.a

$(eval $(call dependencies))

# Because source file is generated we may not generate dependencies
# automatically (the file may not be already created), that is why we have to
# do it manually
syscall_name_32.o: syscall_name_32.cc.deps
syscall_name_64.o: syscall_name_64.cc.deps

syscall_name_32.cc: UNISTD_32 = /usr/include/x86_64-linux-gnu/asm/unistd_32.h
syscall_name_32.cc: Makefile $(UNISTD_32)
	$(GEN)
	$(Q)echo "// WARNING: file generated automatically; changes will not be permanent." > $@
	$(Q)echo "#include \"../include/syscall_name.h\"" >> $@
	$(Q)echo "#include \"$(UNISTD_32)\"" >> $@
	$(Q)echo "" >> $@
	# 32 bit
	$(Q) [ -f $(UNISTD_32) ] || \
		{ echo "Error: $(UNISTD_32): No such file or directory"; $(RM) $@; exit 1; }
	$(Q)echo "SyscallNameSet x86_syscall_name {" >> $@
	$(Q)grep __NR_ $(UNISTD_32) | \
		sed 's/#define\s*__NR_//' | \
		awk '{ printf "\t{"; if (2<=NF) printf $$2; for (i=3; i<=NF; ++i) printf " " $$i; print ", \"" $$1 "\"}," }' >> $@
	$(Q)echo "};" >> $@

syscall_name_64.cc: UNISTD_64 = /usr/include/x86_64-linux-gnu/asm/unistd_64.h
syscall_name_64.cc: Makefile $(UNISTD_64)
	$(GEN)
	$(Q)echo "// WARNING: file generated automatically; changes will not be permanent." > $@
	$(Q)echo "#include \"../include/syscall_name.h\"" >> $@
	$(Q)echo "#include \"$(UNISTD_64)\"" >> $@
	$(Q)echo "" >> $@
	# 64 bit
	$(Q)echo "SyscallNameSet x86_64_syscall_name {" >> $@
	$(Q) [ -f $(UNISTD_64) ] || \
		{ echo "Error: $(UNISTD_64): No such file or directory"; $(RM) $@; exit 1; }
	$(Q)grep __NR_ $(UNISTD_64) | \
		sed 's/#define\s*__NR_//' | \
		awk '{ printf "\t{"; if (2<=NF) printf $$2; for (i=3; i<=NF; ++i) printf " " $$i; print ", \"" $$1 "\"}," }' >> $@
	$(Q)echo "};" >> $@

.PHONY: sim http
sim http:
	$(Q)$(MAKE) -C $@/

sim/sim.o: sim
	@
<commit_msg>Try to fix a bug with src/syscall_name*<commit_after>include ../Makefile.config

.PHONY: all
all: ../simlib.a

$(eval $(call dependencies))

# Because source file is generated we may not generate dependencies
# automatically (the file may not be already created), that is why we have to
# do it manually
syscall_name_32.o: syscall_name_32.cc.deps
syscall_name_64.o: syscall_name_64.cc.deps

syscall_name_32.cc: UNISTD_32 = /usr/include/x86_64-linux-gnu/asm/unistd_32.h
syscall_name_32.cc: Makefile $(UNISTD_32)
	$(GEN)
	$(Q)echo "// WARNING: file generated automatically; changes will not be permanent." > $@
	$(Q)echo "#include \"../include/syscall_name.h\"" >> $@
	$(Q)echo "#include \"$(UNISTD_32)\"" >> $@
	$(Q)echo "" >> $@
	# 32 bit
	$(Q) [ -f $(UNISTD_32) ] || \
		{ echo "Error: $(UNISTD_32): No such file or directory"; $(RM) $@; exit 1; }
	$(Q)echo "SyscallNameSet x86_syscall_name {" >> $@
	$(Q)grep -E "^\s*#\s*define\s*__NR_" $(UNISTD_32) | \
		sed 's/#define\s*__NR_//' | \
		awk '{ printf "\t{"; if (2<=NF) printf $$2; for (i=3; i<=NF; ++i) printf " " $$i; print ", \"" $$1 "\"}," }' >> $@
	$(Q)echo "};" >> $@

syscall_name_64.cc: UNISTD_64 = /usr/include/x86_64-linux-gnu/asm/unistd_64.h
syscall_name_64.cc: Makefile $(UNISTD_64)
	$(GEN)
	$(Q)echo "// WARNING: file generated automatically; changes will not be permanent." > $@
	$(Q)echo "#include \"../include/syscall_name.h\"" >> $@
	$(Q)echo "#include \"$(UNISTD_64)\"" >> $@
	$(Q)echo "" >> $@
	# 64 bit
	$(Q)echo "SyscallNameSet x86_64_syscall_name {" >> $@
	$(Q) [ -f $(UNISTD_64) ] || \
		{ echo "Error: $(UNISTD_64): No such file or directory"; $(RM) $@; exit 1; }
	$(Q)grep -E "^\s*#\s*define\s*__NR_" $(UNISTD_64) | \
		sed 's/#define\s*__NR_//' | \
		awk '{ printf "\t{"; if (2<=NF) printf $$2; for (i=3; i<=NF; ++i) printf " " $$i; print ", \"" $$1 "\"}," }' >> $@
	$(Q)echo "};" >> $@

.PHONY: sim http
sim http:
	$(Q)$(MAKE) -C $@/

sim/sim.o: sim
	@

{'fraction_non_alphanumeric': 0.23668950975224037, 'fraction_numerical': 0.037954665260938325, 'mean_word_length': 3.815989847715736, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 55, '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': '2520505', 'n_tokens_mistral': 1742, 'n_tokens_neox': 1555, 'n_words': 362}