summaryrefslogtreecommitdiffstats
path: root/share/mk/build/examples
diff options
context:
space:
mode:
Diffstat (limited to 'share/mk/build/examples')
-rw-r--r--share/mk/build/examples/_.mk19
-rw-r--r--share/mk/build/examples/cc.mk14
-rw-r--r--share/mk/build/examples/dir.mk27
-rw-r--r--share/mk/build/examples/ld.mk12
-rw-r--r--share/mk/build/examples/src.mk29
5 files changed, 57 insertions, 44 deletions
diff --git a/share/mk/build/examples/_.mk b/share/mk/build/examples/_.mk
index c01a952..f1e51e6 100644
--- a/share/mk/build/examples/_.mk
+++ b/share/mk/build/examples/_.mk
@@ -2,23 +2,8 @@
# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
-ifndef MAKEFILE_BUILD_EX_DIR_INCLUDED
-MAKEFILE_BUILD_EX_DIR_INCLUDED := 1
-
-
-include $(MAKEFILEDIR)/build/_.mk
-include $(MAKEFILEDIR)/configure/build-depends/coreutils.mk
-include $(MAKEFILEDIR)/configure/src.mk
-include $(MAKEFILEDIR)/src.mk
-
-
-_PAGEEXDIRS := $(patsubst $(MANDIR)/%,$(_MANDIR)/%.d/,$(NONSO_MAN))
-
-
-$(_PAGEEXDIRS):
- +$(info $(INFO_)MKDIR $@)
- +$(MKDIR) -p $@
- +$(TOUCH) $@
+ifndef MAKEFILE_BUILD_EX_INCLUDED
+MAKEFILE_BUILD_EX_INCLUDED := 1
.PHONY: build-ex
diff --git a/share/mk/build/examples/cc.mk b/share/mk/build/examples/cc.mk
index 6513fbe..f1524d4 100644
--- a/share/mk/build/examples/cc.mk
+++ b/share/mk/build/examples/cc.mk
@@ -8,12 +8,12 @@ MAKEFILE_BUILD_EX_CC_INCLUDED := 1
include $(MAKEFILEDIR)/build/_.mk
include $(MAKEFILEDIR)/build/examples/src.mk
-include $(MAKEFILEDIR)/configure/build-depends/cc.mk
-include $(MAKEFILEDIR)/configure/build-depends/cpp.mk
+include $(MAKEFILEDIR)/configure/build-depends/gcc/cc.mk
+include $(MAKEFILEDIR)/configure/build-depends/cpp/cpp.mk
include $(MAKEFILEDIR)/configure/xfail.mk
-_XFAIL_UNITS_ex_o := \
+_XFAIL_EX_TU_o := \
$(_MANDIR)/man2/bpf.2.d/bpf.o \
$(_MANDIR)/man2/seccomp.2.d/seccomp.o \
$(_MANDIR)/man2/sigaction.2.d/sigaction.o \
@@ -36,19 +36,19 @@ _XFAIL_UNITS_ex_o := \
$(_MANDIR)/man3head/printf.h.3head.d/register_printf_specifier.o
-_UNITS_ex_o := $(patsubst %.c,%.o,$(_UNITS_ex_c))
+_EX_TU_o := $(patsubst %.c, %.o, $(_EX_TU_c))
ifeq ($(SKIP_XFAIL),yes)
-_UNITS_ex_o := $(filter-out $(_XFAIL_UNITS_ex_o), $(_UNITS_ex_o))
+_EX_TU_o := $(filter-out $(_XFAIL_EX_TU_o), $(_EX_TU_o))
endif
-$(_UNITS_ex_o): %.o: %.c $(MK)
+$(_EX_TU_o): %.o: %.c $(MK)
$(info $(INFO_)CC $@)
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
.PHONY: build-ex-cc
-build-ex-cc: $(_UNITS_ex_o);
+build-ex-cc: $(_EX_TU_o);
endif # include guard
diff --git a/share/mk/build/examples/dir.mk b/share/mk/build/examples/dir.mk
new file mode 100644
index 0000000..8aaaad3
--- /dev/null
+++ b/share/mk/build/examples/dir.mk
@@ -0,0 +1,27 @@
+# Copyright 2021-2024, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
+
+
+ifndef MAKEFILE_BUILD_EX_DIR_INCLUDED
+MAKEFILE_BUILD_EX_DIR_INCLUDED := 1
+
+
+include $(MAKEFILEDIR)/build/man/man.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/mkdir.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/touch.mk
+
+
+_PAGEEXDIRS := $(patsubst %, %.d/, $(_NONSO_MAN))
+
+
+$(_PAGEEXDIRS):
+ +$(info $(INFO_)MKDIR $@)
+ +$(MKDIR) -p $@
+ +$(TOUCH) $@
+
+
+.PHONY: build-ex-dir
+build-ex-dir: $(_PAGEEXDIRS);
+
+
+endif # include guard
diff --git a/share/mk/build/examples/ld.mk b/share/mk/build/examples/ld.mk
index 9d5535d..6d63251 100644
--- a/share/mk/build/examples/ld.mk
+++ b/share/mk/build/examples/ld.mk
@@ -8,11 +8,11 @@ MAKEFILE_BUILD_EX_LD_INCLUDED := 1
include $(MAKEFILEDIR)/build/_.mk
include $(MAKEFILEDIR)/build/examples/cc.mk
-include $(MAKEFILEDIR)/configure/build-depends/ld.mk
+include $(MAKEFILEDIR)/configure/build-depends/binutils/ld.mk
include $(MAKEFILEDIR)/configure/xfail.mk
-_XFAIL_UNITS_ex_bin := \
+_XFAIL_EX_TU_bin := \
$(_MANDIR)/man2/add_key.2.d/add_key \
$(_MANDIR)/man2/keyctl.2.d/key_instantiate \
$(_MANDIR)/man2/request_key.2.d/t_request_key \
@@ -33,19 +33,19 @@ _XFAIL_UNITS_ex_bin := \
$(_MANDIR)/man3/tsearch.3.d/tsearch
-_UNITS_ex_bin := $(patsubst %.o,%,$(_UNITS_ex_o))
+_EX_TU_bin := $(patsubst %.o, %, $(_EX_TU_o))
ifeq ($(SKIP_XFAIL),yes)
-_UNITS_ex_bin := $(filter-out $(_XFAIL_UNITS_ex_bin), $(_UNITS_ex_bin))
+_EX_TU_bin := $(filter-out $(_XFAIL_EX_TU_bin), $(_EX_TU_bin))
endif
-$(_UNITS_ex_bin): %: %.o $(MK)
+$(_EX_TU_bin): %: %.o $(MK)
$(info $(INFO_)LD $@)
$(LD) $(LDFLAGS) -o $@ $< $(LDLIBS)
.PHONY: build-ex-ld
-build-ex-ld: $(_UNITS_ex_bin);
+build-ex-ld: $(_EX_TU_bin);
endif # include guard
diff --git a/share/mk/build/examples/src.mk b/share/mk/build/examples/src.mk
index f47a713..def626c 100644
--- a/share/mk/build/examples/src.mk
+++ b/share/mk/build/examples/src.mk
@@ -7,16 +7,17 @@ MAKEFILE_BUILD_EX_SRC_INCLUDED := 1
include $(MAKEFILEDIR)/build/_.mk
-include $(MAKEFILEDIR)/configure/build-depends/coreutils.mk
-include $(MAKEFILEDIR)/configure/build-depends/findutils.mk
-include $(MAKEFILEDIR)/configure/build-depends/grep.mk
-include $(MAKEFILEDIR)/configure/build-depends/mandoc.mk
-include $(MAKEFILEDIR)/configure/build-depends/sed.mk
-include $(MAKEFILEDIR)/configure/directory_variables.mk
-include $(MAKEFILEDIR)/src.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/head.mk
+include $(MAKEFILEDIR)/configure/build-depends/findutils/find.mk
+include $(MAKEFILEDIR)/configure/build-depends/findutils/xargs.mk
+include $(MAKEFILEDIR)/configure/build-depends/grep/grep.mk
+include $(MAKEFILEDIR)/configure/build-depends/mandoc/mandoc.mk
+include $(MAKEFILEDIR)/configure/build-depends/sed/sed.mk
+include $(MAKEFILEDIR)/configure/directory_variables/src.mk
+include $(MAKEFILEDIR)/src/sortman.mk
-_UNITS_ex_src := \
+_EX_TU_src := \
$(patsubst $(MANDIR)/%, $(_MANDIR)/%, \
$(shell \
$(FIND) $(MANDIR)/* -type f \
@@ -28,13 +29,13 @@ _UNITS_ex_src := \
| $(SED) 's,:,\\:,g' \
) \
)
-_UNITS_ex_h := $(filter %.h,$(_UNITS_ex_src))
-_UNITS_ex_c := $(filter %.c,$(_UNITS_ex_src))
+_EX_TU_h := $(filter %.h, $(_EX_TU_src))
+_EX_TU_c := $(filter %.c, $(_EX_TU_src))
-$(_UNITS_ex_src): $$(patsubst $(_MANDIR)/%.d,$(MANDIR)/%,$$(@D)) $(MK) | $$(@D)/
-$(_UNITS_ex_c): $$(filter $$(@D)/%.h,$(_UNITS_ex_h))
-$(_UNITS_ex_src):
+$(_EX_TU_src): $$(patsubst %.d, %, $$(@D)) $(MK) | $$(@D)/
+$(_EX_TU_c): $$(filter $$(@D)/%.h, $(_EX_TU_h))
+$(_EX_TU_src):
$(info $(INFO_)SED $@)
<$< \
$(SED) -n \
@@ -49,7 +50,7 @@ $(_UNITS_ex_src):
.PHONY: build-ex-src
-build-ex-src: $(_UNITS_ex_src);
+build-ex-src: $(_EX_TU_src);
endif # include guard