# # Copyright (c) 2018-2019 Gavin D. Howard and contributors. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # *** WARNING: Autogenerated from Makefile.in. DO NOT MODIFY *** # .POSIX: VERSION = 2.1.3 SRC = bc.c OBJ = bc.o GCDA = bc.gcda GCNO = bc.gcno BC_ENABLED_NAME = BC_ENABLED BC_ENABLED = 1 DC_ENABLED_NAME = DC_ENABLED DC_ENABLED = 1 BIN = bin LOCALES = locales EXEC_SUFFIX = EXEC_PREFIX = BC = bc DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) MANUALS = manuals BC_MANPAGE_NAME = $(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX).1 BC_MANPAGE = $(MANUALS)/$(BC).1 BC_RONN = $(BC_MANPAGE).ronn DC_MANPAGE_NAME = $(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX).1 DC_MANPAGE = $(MANUALS)/$(DC).1 DC_RONN = $(DC_MANPAGE).ronn MANPAGE_INSTALL_ARGS = -Dm644 BINDIR = /usr/local/bin MAN1DIR = /usr/local/share/man/man1 MAIN_EXEC = $(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX) EXEC = $(BC_EXEC) NLSPATH = /usr/share/locale/%L/%N BC_ENABLE_SIGNALS = 1 BC_ENABLE_HISTORY = 1 BC_ENABLE_EXTRA_MATH_NAME = BC_ENABLE_EXTRA_MATH BC_ENABLE_EXTRA_MATH = 1 BC_ENABLE_NLS = 1 BC_ENABLE_PROMPT = 1 BC_LONG_BIT = RM = rm MKDIR = mkdir INSTALL = ./install.sh SAFE_INSTALL = ./safe-install.sh LINK = ./link.sh KARATSUBA = ./karatsuba.py LOCALE_INSTALL = ./locale_install.sh LOCALE_UNINSTALL = ./locale_uninstall.sh VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all RONN_ARGS = --roff --organization="Gavin D. Howard" --manual="General Commands Manual" BC_NUM_KARATSUBA_LEN = 64 CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) CPPFLAGS2 = $(CPPFLAGS1) -I./include/ -DVERSION=$(VERSION) CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC) CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_SIGNALS=$(BC_ENABLE_SIGNALS) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) CFLAGS = $(CPPFLAGS) -DNDEBUG -flto -march=native -O3 LDFLAGS = -s HOSTCFLAGS = -flto -march=native CC = clang HOSTCC = clang .c.o: $(CC) $(CFLAGS) -o $@ -c $< all: make_bin $(OBJ) $(CC) $(CFLAGS) $(OBJ) $(LDFLAGS) -o $(EXEC) $(LINK) $(BIN) $(EXEC_PREFIX)$(DC) $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help dc.h "" $(DC_ENABLED_NAME) make_bin: $(MKDIR) -p $(BIN) help: @printf 'available targets:\n' @printf '\n' @printf ' all (default) builds bc and dc\n' @printf ' check alias for `make test`\n' @printf ' clean removes all build files\n' @printf ' clean_config removes all build files as well as the generated Makefile\n' @printf ' clean_tests removes all build files, the generated Makefile,\n @printf ' and generated tests\n' @printf ' install installs binaries to "%s%s"\n' "$(DESTDIR)" "$(BINDIR)" @printf ' and (if enabled) manpages to "%s%s"\n' "$(DESTDIR)" "$(MAN1DIR)" @printf ' karatsuba runs the karatsuba script (requires Python 3)\n' @printf ' karatsuba_test runs the karatsuba script while running tests\n' @printf ' (requires Python 3)\n' @printf ' uninstall uninstalls binaries from "%s%s"\n' "$(DESTDIR)" "$(BINDIR)" @printf ' and (if enabled) manpages from "%s%s"\n' "$(DESTDIR)" "$(MAN1DIR)" @printf ' test runs the test suite\n' @printf ' test_bc runs the bc test suite, if bc has been built\n' @printf ' test_dc runs the dc test suite, if dc has been built\n' @printf ' time_test runs the test suite, displaying times for some things\n' @printf ' time_test_bc runs the bc test suite, displaying times for some things\n' @printf ' time_test_dc runs the dc test suite, displaying times for some things\n' @printf ' timeconst runs the test on the Linux timeconst.bc script,\n' @printf ' if it exists and bc has been built\n' @printf ' valgrind runs the test suite through valgrind\n' @printf ' valgrind_bc runs the bc test suite, if bc has been built,\n' @printf ' through valgrind\n' @printf ' valgrind_dc runs the dc test suite, if dc has been built,\n' @printf ' through valgrind\n' check: test test: test_bc timeconst test_dc test_bc: @tests/all.sh bc 1 1 1 0 $(BC_EXEC) test_dc: @tests/all.sh dc 1 1 1 0 $(DC_EXEC) time_test: time_test_bc timeconst time_test_dc time_test_bc: @tests/all.sh bc 1 1 1 1 $(BC_EXEC) time_test_dc: @tests/all.sh dc 1 1 1 1 $(DC_EXEC) timeconst: @tests/bc/timeconst.sh tests/bc/scripts/timeconst.bc $(BC_EXEC) valgrind: valgrind_bc valgrind_dc valgrind_bc: @printf 'Cannot run valgrind without debug flags\n' valgrind_dc: @printf 'Cannot run valgrind without debug flags\n' karatsuba: @$(KARATSUBA) 0 $(BC_EXEC) karatsuba_test: @$(KARATSUBA) 100 $(BC_EXEC) coverage: @printf 'Coverage not generated\n' version: @printf '%s' "$(VERSION)" libcname: @printf '%s' "$(BC_LIB_C)" extra_math: @printf '%s' "$(BC_ENABLE_EXTRA_MATH)" manpages: ronn $(RONN_ARGS) $(BC_RONN) ronn $(RONN_ARGS) $(DC_RONN) clean_gen: @$(RM) -f $(GEN_EXEC) clean: clean_gen @printf 'Cleaning files...\n' @$(RM) -f $(OBJ) @$(RM) -f $(BC_OBJ) @$(RM) -f $(DC_OBJ) @$(RM) -f $(HISTORY_OBJ) @$(RM) -f $(BC_EXEC) @$(RM) -f $(DC_EXEC) @$(RM) -fr $(BIN) @$(RM) -f *.gcov @$(RM) -f *.html @$(RM) -f *.gcda *.gcno @$(RM) -f *.profraw @$(RM) -f $(LOCALES)/*.cat @$(RM) -f $(BC_LIB_C) $(BC_LIB_O) @$(RM) -f $(BC_LIB2_C) $(BC_LIB2_O) @$(RM) -f $(BC_HELP_C) $(BC_HELP_O) @$(RM) -f $(DC_HELP_C) $(DC_HELP_O) clean_config: clean @printf 'Cleaning config...\n' @$(RM) -f Makefile clean_tests: clean clean_config @printf 'Cleaning test files...\n' @$(RM) -f tests/bc/parse.txt tests/bc/parse_results.txt @$(RM) -f tests/bc/print.txt tests/bc/print_results.txt @$(RM) -f tests/bc/bessel.txt tests/bc/bessel_results.txt @$(RM) -f tests/bc/scripts/bessel.txt @$(RM) -f tests/bc/scripts/parse.txt @$(RM) -f tests/bc/scripts/print.txt @$(RM) -f tests/bc/scripts/add.txt @$(RM) -f tests/bc/scripts/divide.txt @$(RM) -f tests/bc/scripts/multiply.txt @$(RM) -f tests/bc/scripts/subtract.txt @$(RM) -f tests/dc/scripts/prime.txt tests/dc/scripts/stream.txt @$(RM) -f .log_*.txt @$(RM) -f .math.txt .results.txt .ops.txt @$(RM) -f .test.txt @$(RM) -f $(GCDA) $(GCNO) @$(RM) -f $(BC_GCDA) $(BC_GCNO) @$(RM) -f $(DC_GCDA) $(DC_GCNO) @$(RM) -f $(HISTORY_GCDA) $(HISTORY_GCNO) @$(RM) -f $(BC_LIB_GCDA) $(BC_LIB_GCNO) @$(RM) -f $(BC_LIB2_GCDA) $(BC_LIB2_GCNO) @$(RM) -f $(BC_HELP_GCDA) $(BC_HELP_GCNO) @$(RM) -f $(DC_HELP_GCDA) $(DC_HELP_GCNO) install_locales: $(LOCALE_INSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR) install_bc_manpage: $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(BC_MANPAGE_NAME) install_dc_manpage: $(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(DC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(DC_MANPAGE_NAME) install: install_locales install_bc_manpage install_dc_manpage $(INSTALL) $(DESTDIR)$(BINDIR) "$(EXEC_SUFFIX)" uninstall_locales: $(LOCALE_UNINSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR) uninstall_bc_manpage: $(RM) -f $(DESTDIR)$(MAN1DIR)/$(BC_MANPAGE_NAME) uninstall_bc: $(RM) -f $(DESTDIR)$(BINDIR)/$(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX) uninstall_dc_manpage: $(RM) -f $(DESTDIR)$(MAN1DIR)/$(DC_MANPAGE_NAME) uninstall_dc: $(RM) -f $(DESTDIR)$(BINDIR)/$(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX) uninstall: uninstall_locales uninstall_bc_manpage uninstall_dc_manpage uninstall_bc uninstall_dc