2020-11-27 05:29:53 -05:00
|
|
|
SUBDIRS = include
|
|
|
|
|
2020-12-06 01:51:11 -05:00
|
|
|
AM_CFLAGS = \
|
|
|
|
-std=c99 \
|
2021-12-13 16:10:38 -05:00
|
|
|
-pedantic \
|
2020-12-06 01:51:11 -05:00
|
|
|
-Wall \
|
|
|
|
-Wextra \
|
2022-02-01 03:28:23 -05:00
|
|
|
-I$(top_builddir)/include \
|
2020-12-06 01:51:11 -05:00
|
|
|
-I$(top_srcdir)/include
|
2020-11-27 04:28:13 -05:00
|
|
|
|
|
|
|
lib_LIBRARIES = libkernaux.a
|
|
|
|
|
2020-12-05 19:23:07 -05:00
|
|
|
noinst_PROGRAMS = $(TESTS)
|
2020-11-27 11:04:15 -05:00
|
|
|
|
2020-11-27 04:28:13 -05:00
|
|
|
libkernaux_a_SOURCES = \
|
2021-12-14 15:37:11 -05:00
|
|
|
src/assert.c \
|
2022-01-17 04:54:44 -05:00
|
|
|
src/libc.c
|
2020-11-27 11:04:15 -05:00
|
|
|
|
2022-05-24 07:14:12 -04:00
|
|
|
CLEANFILES = \
|
2022-05-26 22:03:05 -04:00
|
|
|
tests/test_printf_fmt_gen.c \
|
2022-05-24 07:14:12 -04:00
|
|
|
tests/test_printf_gen.c
|
|
|
|
|
2021-12-20 01:14:40 -05:00
|
|
|
if ASM_I386
|
|
|
|
libkernaux_a_SOURCES += src/asm/i386.S
|
2020-11-29 22:29:58 -05:00
|
|
|
endif
|
|
|
|
|
2022-01-15 05:09:45 -05:00
|
|
|
if ASM_RISCV64
|
|
|
|
libkernaux_a_SOURCES += src/asm/riscv64.S
|
|
|
|
endif
|
|
|
|
|
2021-12-20 01:14:40 -05:00
|
|
|
if ASM_X86_64
|
|
|
|
libkernaux_a_SOURCES += src/asm/x86_64.S
|
2020-12-06 23:37:16 -05:00
|
|
|
endif
|
|
|
|
|
2022-05-24 13:46:19 -04:00
|
|
|
TESTS =
|
|
|
|
|
2022-02-01 21:26:35 -05:00
|
|
|
if ENABLE_TESTS
|
2022-05-24 13:46:19 -04:00
|
|
|
TESTS += \
|
2022-02-01 21:26:35 -05:00
|
|
|
examples/assert_guards \
|
|
|
|
examples/assert_simple \
|
|
|
|
examples/panic_guards \
|
|
|
|
examples/panic_simple
|
|
|
|
endif
|
|
|
|
|
2022-02-01 22:28:19 -05:00
|
|
|
if ENABLE_PIC
|
|
|
|
AM_CFLAGS += -fpic
|
|
|
|
else
|
|
|
|
AM_CFLAGS += -fno-pic
|
|
|
|
endif
|
|
|
|
|
2022-02-01 21:38:45 -05:00
|
|
|
if ENABLE_WERROR
|
|
|
|
AM_CFLAGS += -Werror
|
|
|
|
endif
|
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
if WITH_CMDLINE
|
2020-12-05 19:23:07 -05:00
|
|
|
libkernaux_a_SOURCES += src/cmdline.c
|
2022-01-17 07:33:28 -05:00
|
|
|
if ENABLE_TESTS
|
2020-12-05 19:23:07 -05:00
|
|
|
TESTS += \
|
|
|
|
examples/cmdline \
|
|
|
|
tests/test_cmdline
|
|
|
|
endif
|
2022-01-17 07:33:28 -05:00
|
|
|
endif
|
2020-12-05 19:23:07 -05:00
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
if WITH_CONSOLE
|
2022-01-09 23:45:02 -05:00
|
|
|
libkernaux_a_SOURCES += src/console.c
|
2020-12-05 19:23:07 -05:00
|
|
|
endif
|
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
if WITH_ELF
|
2021-12-13 17:07:00 -05:00
|
|
|
libkernaux_a_SOURCES += src/elf.c
|
2022-01-17 07:33:28 -05:00
|
|
|
if ENABLE_TESTS
|
2021-12-13 17:07:00 -05:00
|
|
|
TESTS += tests/test_elf
|
|
|
|
endif
|
2022-01-17 07:33:28 -05:00
|
|
|
endif
|
2021-12-13 17:07:00 -05:00
|
|
|
|
2022-01-11 03:58:47 -05:00
|
|
|
if WITH_FRAMEBUFFER
|
|
|
|
libkernaux_a_SOURCES += src/framebuffer.c
|
|
|
|
endif
|
|
|
|
|
2022-01-17 00:58:47 -05:00
|
|
|
if WITH_MBR
|
|
|
|
libkernaux_a_SOURCES += src/mbr.c
|
2022-01-17 07:33:28 -05:00
|
|
|
if ENABLE_TESTS
|
2022-01-17 01:34:42 -05:00
|
|
|
TESTS += tests/test_mbr
|
2022-01-17 00:58:47 -05:00
|
|
|
endif
|
2022-01-17 07:33:28 -05:00
|
|
|
endif
|
2022-01-17 00:58:47 -05:00
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
if WITH_MULTIBOOT2
|
2020-12-05 19:23:07 -05:00
|
|
|
libkernaux_a_SOURCES += \
|
2022-01-13 09:07:13 -05:00
|
|
|
src/multiboot2/enums_to_str.c \
|
2022-01-13 07:44:22 -05:00
|
|
|
src/multiboot2/header_helpers.c \
|
2022-01-13 08:50:51 -05:00
|
|
|
src/multiboot2/header_is_valid.c \
|
|
|
|
src/multiboot2/header_print.c \
|
2022-01-12 22:25:09 -05:00
|
|
|
src/multiboot2/info_helpers.c \
|
2022-01-12 22:10:33 -05:00
|
|
|
src/multiboot2/info_is_valid.c \
|
2022-01-12 22:12:28 -05:00
|
|
|
src/multiboot2/info_print.c
|
2022-01-17 07:33:28 -05:00
|
|
|
if ENABLE_TESTS
|
2020-12-05 19:23:07 -05:00
|
|
|
TESTS += \
|
2022-01-13 08:31:06 -05:00
|
|
|
tests/test_multiboot2_header_helpers \
|
2022-01-13 08:50:51 -05:00
|
|
|
tests/test_multiboot2_header_print \
|
|
|
|
tests/test_multiboot2_header_validation \
|
2022-01-12 22:25:09 -05:00
|
|
|
tests/test_multiboot2_info_helpers \
|
2022-01-12 22:12:28 -05:00
|
|
|
tests/test_multiboot2_info_print \
|
2022-01-12 22:10:33 -05:00
|
|
|
tests/test_multiboot2_info_validation
|
2020-12-05 19:23:07 -05:00
|
|
|
noinst_PROGRAMS += \
|
2022-01-13 08:37:37 -05:00
|
|
|
tests/multiboot2_header_print1 \
|
|
|
|
tests/multiboot2_header_print2 \
|
2022-01-12 22:12:28 -05:00
|
|
|
tests/multiboot2_info_print1 \
|
|
|
|
tests/multiboot2_info_print2
|
2020-12-05 19:23:07 -05:00
|
|
|
endif
|
2022-01-17 07:33:28 -05:00
|
|
|
endif
|
2020-12-05 19:23:07 -05:00
|
|
|
|
2022-01-19 05:35:02 -05:00
|
|
|
if WITH_NTOA
|
|
|
|
libkernaux_a_SOURCES += src/ntoa.c
|
|
|
|
if ENABLE_TESTS
|
2022-05-30 16:43:58 -04:00
|
|
|
TESTS += \
|
|
|
|
examples/ntoa \
|
|
|
|
tests/test_ntoa
|
2022-01-19 05:35:02 -05:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
if WITH_PFA
|
2020-12-05 19:23:07 -05:00
|
|
|
libkernaux_a_SOURCES += src/pfa.c
|
2022-01-17 07:33:28 -05:00
|
|
|
if ENABLE_TESTS
|
2021-12-13 18:56:31 -05:00
|
|
|
TESTS += \
|
|
|
|
examples/pfa \
|
2021-12-14 17:10:28 -05:00
|
|
|
tests/test_pfa \
|
|
|
|
tests/test_pfa_assert
|
2020-12-05 19:23:07 -05:00
|
|
|
endif
|
2022-01-17 07:33:28 -05:00
|
|
|
endif
|
2020-12-05 19:23:07 -05:00
|
|
|
|
2022-01-17 10:00:29 -05:00
|
|
|
if WITH_PRINTF
|
|
|
|
libkernaux_a_SOURCES += src/printf.c
|
|
|
|
if ENABLE_TESTS
|
|
|
|
TESTS += \
|
|
|
|
examples/printf \
|
|
|
|
examples/printf_va \
|
2022-01-20 05:28:24 -05:00
|
|
|
examples/snprintf \
|
2022-05-24 08:33:54 -04:00
|
|
|
examples/snprintf_va
|
2022-05-24 13:46:19 -04:00
|
|
|
endif
|
2022-05-24 07:14:12 -04:00
|
|
|
if ENABLE_TESTS_PYTHON
|
|
|
|
TESTS += tests/test_printf_gen
|
|
|
|
endif
|
2022-01-17 10:00:29 -05:00
|
|
|
endif
|
|
|
|
|
2022-05-26 18:17:09 -04:00
|
|
|
if WITH_PRINTF_FMT
|
2022-05-26 18:13:02 -04:00
|
|
|
libkernaux_a_SOURCES += src/printf_fmt.c
|
2022-05-26 19:17:29 -04:00
|
|
|
if ENABLE_TESTS
|
|
|
|
TESTS += examples/printf_fmt
|
|
|
|
endif
|
2022-05-26 22:03:05 -04:00
|
|
|
if ENABLE_TESTS_PYTHON
|
|
|
|
TESTS += tests/test_printf_fmt_gen
|
|
|
|
endif
|
2022-05-26 18:13:02 -04:00
|
|
|
endif
|
|
|
|
|
2021-12-17 20:27:45 -05:00
|
|
|
if WITH_UNITS
|
2021-12-13 14:36:36 -05:00
|
|
|
libkernaux_a_SOURCES += src/units.c
|
2022-01-17 07:33:28 -05:00
|
|
|
if ENABLE_TESTS
|
2021-12-13 15:23:22 -05:00
|
|
|
TESTS += \
|
|
|
|
examples/units_human \
|
|
|
|
tests/test_units_human
|
2021-12-13 14:36:36 -05:00
|
|
|
endif
|
2022-01-17 07:33:28 -05:00
|
|
|
endif
|
2021-12-13 14:36:36 -05:00
|
|
|
|
2021-12-19 21:22:43 -05:00
|
|
|
examples_assert_guards_SOURCES = \
|
2021-12-17 19:51:12 -05:00
|
|
|
$(libkernaux_a_SOURCES) \
|
2021-12-19 21:22:43 -05:00
|
|
|
examples/assert_guards.c
|
2021-12-17 19:51:12 -05:00
|
|
|
|
|
|
|
examples_assert_simple_SOURCES = \
|
2021-12-14 15:37:11 -05:00
|
|
|
$(libkernaux_a_SOURCES) \
|
2021-12-17 19:51:12 -05:00
|
|
|
examples/assert_simple.c
|
2021-12-14 15:37:11 -05:00
|
|
|
|
2020-12-05 17:58:34 -05:00
|
|
|
examples_cmdline_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/cmdline.c
|
|
|
|
|
2022-05-30 16:43:58 -04:00
|
|
|
examples_ntoa_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/ntoa.c
|
|
|
|
|
2022-01-20 12:18:18 -05:00
|
|
|
examples_panic_guards_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/panic_guards.c
|
|
|
|
|
2022-01-20 11:51:54 -05:00
|
|
|
examples_panic_simple_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/panic_simple.c
|
|
|
|
|
2021-12-13 18:56:31 -05:00
|
|
|
examples_pfa_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/pfa.c
|
|
|
|
|
2020-12-06 17:24:43 -05:00
|
|
|
examples_printf_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/printf.c
|
|
|
|
|
2022-05-26 19:17:29 -04:00
|
|
|
examples_printf_fmt_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/printf_fmt.c
|
|
|
|
|
2020-12-06 19:27:42 -05:00
|
|
|
examples_printf_va_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/printf_va.c
|
|
|
|
|
2022-01-20 05:28:24 -05:00
|
|
|
examples_snprintf_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/snprintf.c
|
|
|
|
|
|
|
|
examples_snprintf_va_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/snprintf_va.c
|
|
|
|
|
2021-12-13 14:36:36 -05:00
|
|
|
examples_units_human_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
examples/units_human.c
|
|
|
|
|
2022-01-13 08:37:37 -05:00
|
|
|
tests_multiboot2_header_print1_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/multiboot2_header_print1.c \
|
|
|
|
tests/multiboot2_header_example1.h
|
|
|
|
|
|
|
|
tests_multiboot2_header_print2_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/multiboot2_header_print2.c \
|
|
|
|
tests/multiboot2_header_example2.h
|
|
|
|
|
2022-01-12 22:12:28 -05:00
|
|
|
tests_multiboot2_info_print1_SOURCES = \
|
2020-11-28 16:24:50 -05:00
|
|
|
$(libkernaux_a_SOURCES) \
|
2022-01-12 22:12:28 -05:00
|
|
|
tests/multiboot2_info_print1.c \
|
2022-01-12 23:05:34 -05:00
|
|
|
tests/multiboot2_info_example1.h
|
2020-11-29 07:57:34 -05:00
|
|
|
|
2022-01-12 22:12:28 -05:00
|
|
|
tests_multiboot2_info_print2_SOURCES = \
|
2020-11-29 07:57:34 -05:00
|
|
|
$(libkernaux_a_SOURCES) \
|
2022-01-12 22:12:28 -05:00
|
|
|
tests/multiboot2_info_print2.c \
|
2022-01-12 23:05:34 -05:00
|
|
|
tests/multiboot2_info_example2.h
|
2020-11-28 16:24:50 -05:00
|
|
|
|
2020-12-01 14:55:16 -05:00
|
|
|
tests_test_cmdline_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_cmdline.c
|
|
|
|
|
2021-12-12 15:30:27 -05:00
|
|
|
tests_test_elf_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_elf.c
|
|
|
|
|
2022-01-17 01:34:42 -05:00
|
|
|
tests_test_mbr_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_mbr.c
|
|
|
|
|
2022-01-13 08:31:06 -05:00
|
|
|
tests_test_multiboot2_header_helpers_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_multiboot2_header_helpers.c \
|
|
|
|
tests/multiboot2_header_example1.h \
|
|
|
|
tests/multiboot2_header_example2.h
|
|
|
|
|
2022-01-13 08:50:51 -05:00
|
|
|
tests_test_multiboot2_header_print_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_multiboot2_header_print.c
|
|
|
|
|
|
|
|
tests_test_multiboot2_header_validation_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_multiboot2_header_validation.c \
|
|
|
|
tests/multiboot2_header_example1.h \
|
|
|
|
tests/multiboot2_header_example2.h
|
|
|
|
|
2022-01-12 22:25:09 -05:00
|
|
|
tests_test_multiboot2_info_helpers_SOURCES = \
|
2020-11-29 13:02:19 -05:00
|
|
|
$(libkernaux_a_SOURCES) \
|
2022-01-12 22:25:09 -05:00
|
|
|
tests/test_multiboot2_info_helpers.c \
|
2022-01-12 23:05:34 -05:00
|
|
|
tests/multiboot2_info_example1.h \
|
|
|
|
tests/multiboot2_info_example2.h
|
2020-11-29 13:02:19 -05:00
|
|
|
|
2022-01-12 22:12:28 -05:00
|
|
|
tests_test_multiboot2_info_print_SOURCES = \
|
2020-11-28 16:24:50 -05:00
|
|
|
$(libkernaux_a_SOURCES) \
|
2022-01-12 22:12:28 -05:00
|
|
|
tests/test_multiboot2_info_print.c
|
2020-11-28 16:24:50 -05:00
|
|
|
|
2022-01-12 22:10:33 -05:00
|
|
|
tests_test_multiboot2_info_validation_SOURCES = \
|
2020-11-27 16:48:50 -05:00
|
|
|
$(libkernaux_a_SOURCES) \
|
2022-01-12 22:10:33 -05:00
|
|
|
tests/test_multiboot2_info_validation.c \
|
2022-01-12 23:05:34 -05:00
|
|
|
tests/multiboot2_info_example1.h \
|
|
|
|
tests/multiboot2_info_example2.h
|
2020-11-29 19:25:30 -05:00
|
|
|
|
2022-01-19 05:38:29 -05:00
|
|
|
tests_test_ntoa_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_ntoa.c
|
|
|
|
|
2020-11-30 13:32:27 -05:00
|
|
|
tests_test_pfa_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_pfa.c
|
|
|
|
|
2021-12-14 17:10:28 -05:00
|
|
|
tests_test_pfa_assert_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_pfa_assert.c
|
|
|
|
|
2022-05-26 22:03:05 -04:00
|
|
|
tests_test_printf_fmt_gen_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_printf_fmt_gen.c \
|
|
|
|
tests/printf_fmt_gen.py \
|
|
|
|
tests/printf_fmt_gen.jinja \
|
2022-05-26 22:25:10 -04:00
|
|
|
common/printf_fmt.yml
|
2022-05-26 22:03:05 -04:00
|
|
|
|
2022-05-24 07:14:12 -04:00
|
|
|
tests_test_printf_gen_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
2022-05-24 09:30:00 -04:00
|
|
|
tests/test_printf_gen.c \
|
|
|
|
tests/printf_gen.py \
|
|
|
|
tests/printf_gen.jinja \
|
2022-05-24 14:02:46 -04:00
|
|
|
common/printf.yml \
|
|
|
|
common/printf_orig.yml
|
2022-05-24 07:14:12 -04:00
|
|
|
|
2021-12-13 15:23:22 -05:00
|
|
|
tests_test_units_human_SOURCES = \
|
|
|
|
$(libkernaux_a_SOURCES) \
|
|
|
|
tests/test_units_human.c
|
2022-05-24 07:14:12 -04:00
|
|
|
|
2022-05-26 22:03:05 -04:00
|
|
|
tests/test_printf_fmt_gen.c: tests/printf_fmt_gen.py tests/printf_fmt_gen.jinja common/printf_fmt.yml
|
|
|
|
python3 tests/printf_fmt_gen.py
|
|
|
|
|
2022-05-24 14:02:46 -04:00
|
|
|
tests/test_printf_gen.c: tests/printf_gen.py tests/printf_gen.jinja common/printf.yml common/printf_orig.yml
|
2022-05-24 07:14:12 -04:00
|
|
|
python3 tests/printf_gen.py
|