<commit_before>#
# Enhanced Seccomp Library Makefile
#
# Copyright (c) 2012 Red Hat <<EMAIL>>
# Author: <NAME> <<EMAIL>>
#

#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License as
# published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, see <http://www.gnu.org/licenses>.
#

#
# macros
#

include macros.mk

#
# configuration
#

-include version_info.mk
-include configure.mk
include install.mk

#
# targets
#

CONFIGS = configure.mk configure.h version_info.mk libseccomp.pc
SUBDIRS_BUILD = include src tests tools
SUBDIRS_INSTALL = include src tools doc

.PHONY: tarball install ctags cstags clean dist-clean $(SUBDIRS_BUILD)

all: $(SUBDIRS_BUILD)

$(CONFIGS): version_info
	@$(ECHO_INFO) "automatically generating configuration ..."
	@./configure

tarball: clean
	@ver=$(VERSION_RELEASE); \
	tarball=libseccomp-$$ver.tar.gz; \
	$(ECHO_INFO) "creating the tarball ../$$tarball"; \
	tmp_dir=$$(mktemp -d /tmp/libseccomp.XXXXX); \
	rel_dir=$$tmp_dir/libseccomp-$$ver; \
	$(MKDIR) $$rel_dir; \
	$(TAR) cf - --exclude=*~ --exclude=.git* --exclude=.stgit* . | \
		(cd $$rel_dir; tar xf -); \
	(cd $$tmp_dir; $(TAR) zcf $$tarball libseccomp-$$ver); \
	$(MV) $$tmp_dir/$$tarball ..; \
	$(RM) -rf $$tmp_dir;

$(VERSION_HDR): version_info.mk
	@$(ECHO_INFO) "creating the version header file"
	@hdr="$(VERSION_HDR)"; \
	$(ECHO) "/* automatically generated - do not edit */" > $$hdr; \
	$(ECHO) "#ifndef _VERSION_H" >> $$hdr; \
	$(ECHO) "#define _VERSION_H" >> $$hdr; \
	$(ECHO) "#define VERSION_RELEASE \"$(VERSION_RELEASE)\"" >> $$hdr; \
	$(ECHO) "#define VERSION_MAJOR $(VERSION_MAJOR)" >> $$hdr; \
	$(ECHO) "#define VERSION_MINOR $(VERSION_MINOR)" >> $$hdr; \
	$(ECHO) "#define VERSION_MICRO $(VERSION_MICRO)" >> $$hdr; \
	$(ECHO) "#endif" >> $$hdr;

include: $(VERSION_HDR) $(CONFIGS)
	@$(ECHO_INFO) "building in directory $@/ ..."
	@$(MAKE) -C $@

src: $(VERSION_HDR) $(CONFIGS)
	@$(ECHO_INFO) "building in directory $@/ ..."
	@$(MAKE) -C $@

tests: src
	@$(ECHO_INFO) "building in directory $@/ ..."
	@$(MAKE) -C $@

tools: src
	@$(ECHO_INFO) "building in directory $@/ ..."
	@$(MAKE) -C $@

install: $(SUBDIRS_BUILD)
	@$(ECHO_INFO) "installing in $(INSTALL_PREFIX) ..."
	$(INSTALL_PC_MACRO) libseccomp.pc
	@for dir in $(SUBDIRS_INSTALL); do \
		$(ECHO_INFO) "installing from $$dir/"; \
		$(MAKE) -C $$dir install; \
	done

ctags:
	@$(ECHO_INFO) "generating ctags for the project ..."
	@ctags -R *<commit_msg>build: correct some build dependencies<commit_after>#
# Enhanced Seccomp Library Makefile
#
# Copyright (c) 2012 Red Hat <<EMAIL>>
# Author: <NAME> <<EMAIL>>
#

#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License as
# published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, see <http://www.gnu.org/licenses>.
#

#
# macros
#

include macros.mk

#
# configuration
#

-include version_info.mk
-include configure.mk
include install.mk

#
# targets
#

CONFIGS = configure.mk configure.h version_info.mk libseccomp.pc
SUBDIRS_BUILD = include src tests tools
SUBDIRS_INSTALL = include src tools doc

.PHONY: tarball install ctags cstags clean dist-clean $(SUBDIRS_BUILD)

all: $(SUBDIRS_BUILD)

$(CONFIGS): version_info
	@$(ECHO_INFO) "automatically generating configuration ..."
	@./configure

tarball: clean
	@ver=$(VERSION_RELEASE); \
	tarball=libseccomp-$$ver.tar.gz; \
	$(ECHO_INFO) "creating the tarball ../$$tarball"; \
	tmp_dir=$$(mktemp -d /tmp/libseccomp.XXXXX); \
	rel_dir=$$tmp_dir/libseccomp-$$ver; \
	$(MKDIR) $$rel_dir; \
	$(TAR) cf - --exclude=*~ --exclude=.git* --exclude=.stgit* . | \
		(cd $$rel_dir; tar xf -); \
	(cd $$tmp_dir; $(TAR) zcf $$tarball libseccomp-$$ver); \
	$(MV) $$tmp_dir/$$tarball ..; \
	$(RM) -rf $$tmp_dir;

$(VERSION_HDR): version_info.mk
	@$(ECHO_INFO) "creating the version header file"
	@hdr="$(VERSION_HDR)"; \
	$(ECHO) "/* automatically generated - do not edit */" > $$hdr; \
	$(ECHO) "#ifndef _VERSION_H" >> $$hdr; \
	$(ECHO) "#define _VERSION_H" >> $$hdr; \
	$(ECHO) "#define VERSION_RELEASE \"$(VERSION_RELEASE)\"" >> $$hdr; \
	$(ECHO) "#define VERSION_MAJOR $(VERSION_MAJOR)" >> $$hdr; \
	$(ECHO) "#define VERSION_MINOR $(VERSION_MINOR)" >> $$hdr; \
	$(ECHO) "#define VERSION_MICRO $(VERSION_MICRO)" >> $$hdr; \
	$(ECHO) "#endif" >> $$hdr;

include: $(VERSION_HDR) $(CONFIGS)
	@$(ECHO_INFO) "building in directory $@/ ..."
	@$(MAKE) -C $@

src: $(VERSION_HDR) $(CONFIGS) include
	@$(ECHO_INFO) "building in directory $@/ ..."
	@$(MAKE) -C $@

tests: src include
	@$(ECHO_INFO) "building in directory $@/ ..."
	@$(MAKE) -C $@

tools: src include
	@$(ECHO_INFO) "building in directory $@/ ..."
	@$(MAKE) -C $@

install: $(SUBDIRS_BUILD)
	@$(ECHO_INFO) "installing in $(INSTALL_PREFIX) ..."
	$(INSTALL_PC_MACRO) libseccomp.pc
	@for dir in $(SUBDIRS_INSTALL); do \
		$(ECHO_INFO) "installing from $$dir/"; \
		$(MAKE) -C $$dir install; \
	done

ctags:
	@$(ECHO_INFO) "generating ctags for the project ..."
	@ctags -R *
{'fraction_non_alphanumeric': 0.1751432043048082, 'fraction_numerical': 0.0020829717063009894, 'mean_word_length': 4.181654676258993, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 45, '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': '2285254', 'n_tokens_mistral': 2199, 'n_tokens_neox': 2070, 'n_words': 599}