########################################################################
-# Copyright (C) 2021, 2022 Alejandro Colomar <alx@kernel.org>
-# SPDX-License-Identifier: GPL-2.0 OR LGPL-2.0
+# Copyright (C) 2021 - 2023 Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: GPL-3.0-or-later OR LGPL-3.0-or-later
########################################################################
MAN := man
-_SRCPAGEDIRS := $(patsubst $(MANDIR)/%,$(_SRCDIR)/%.d,$(NONSO_MAN))
+_SRCPAGEDIRS := $(patsubst $(MANDIR)/%,$(_MANDIR)/%.d,$(NONSO_MAN))
-_UNITS_src_src := $(patsubst $(MANDIR)/%,$(_SRCDIR)/%,$(shell \
+_UNITS_src_src := $(patsubst $(MANDIR)/%,$(_MANDIR)/%,$(shell \
$(FIND) $(MANDIR)/man*/ -type f \
| $(GREP) '$(MANEXT)' \
| $(XARGS) $(GREP) -l '^\.TH ' \
_UNITS_src_bin := $(patsubst %.c,%,$(_UNITS_src_c))
-$(_SRCPAGEDIRS): $(_SRCDIR)/%.d: $(MANDIR)/% | $$(@D)/
+$(_SRCPAGEDIRS): $(_MANDIR)/%.d: $(MANDIR)/% | $$(@D)/
+$(info MKDIR $@)
+$(MKDIR) $@
+touch $@
-$(_UNITS_src_src): $$(patsubst $(_SRCDIR)/%.d,$(MANDIR)/%,$$(@D)) | $$(@D)
+$(_UNITS_src_src): $$(patsubst $(_MANDIR)/%.d,$(MANDIR)/%,$$(@D)) | $$(@D)
$(_UNITS_src_c): $$(filter $$(@D)/%.h,$(_UNITS_src_h))
$(_UNITS_src_src):
$(info SED $@)
| $(SED) 's/^ //' \
>$@
-$(_UNITS_src_o): $(_SRCDIR)/%.o: $(_SRCDIR)/%.c
+$(_UNITS_src_o): %.o: %.c
$(info CC $@)
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-$(_UNITS_src_bin): $(_SRCDIR)/%: $(_SRCDIR)/%.o
+$(_UNITS_src_bin): %: %.o
$(info LD $@)
$(LD) $(LDFLAGS) -o $@ $< $(LDLIBS)
########################################################################
-# Copyright (C) 2021, 2022 Alejandro Colomar <alx@kernel.org>
-# SPDX-License-Identifier: GPL-2.0 OR LGPL-2.0
+# Copyright (C) 2021 - 2023 Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: GPL-3.0-or-later OR LGPL-3.0-or-later
########################################################################
SYSCONFDIR := $(srcdir)/etc
-_SRCDIR := $(builddir)/src
_MANDIR := $(builddir)/man
| $(XARGS) $(GREP) -l '^\.TH ' \
| $(SORT))
_MANDIRS := $(patsubst $(MANDIR)/%,$(_MANDIR)/%/,$(MANDIRS))
-_SRCDIRS := $(patsubst $(MANDIR)/%,$(_SRCDIR)/%/,$(MANDIRS))
$(_MANDIRS): %/: | $$(dir %) $(_MANDIR)/
-$(_SRCDIRS): %/: | $$(dir %) $(_SRCDIR)/
$(builddir)/%/:
MANDOC := mandoc
-_LINT_man_mandoc:=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.lint-man.mandoc.touch,$(NONSO_MAN))
-_LINT_man_tbl :=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.lint-man.tbl.touch,$(NONSO_MAN))
+_LINT_man_mandoc:=$(patsubst $(MANDIR)/%,$(_MANDIR)/%.lint-man.mandoc.touch,$(NONSO_MAN))
+_LINT_man_tbl :=$(patsubst $(MANDIR)/%,$(_MANDIR)/%.lint-man.tbl.touch,$(NONSO_MAN))
linters_man := mandoc tbl
lint_man := $(foreach x,$(linters_man),lint-man-$(x))
-$(_LINT_man_mandoc): $(_LINTDIR)/%.lint-man.mandoc.touch: $(MANDIR)/% | $$(@D)/
+$(_LINT_man_mandoc): $(_MANDIR)/%.lint-man.mandoc.touch: $(MANDIR)/% | $$(@D)/
$(info LINT (mandoc) $@)
! ($(MANDOC) $(MANDOCFLAGS) $< 2>&1 \
| $(GREP) -v 'STYLE: lower case character in document title:' \
| $(GREP) '.' >&2
touch $@
-$(_LINT_man_tbl): $(_LINTDIR)/%.lint-man.tbl.touch: $(MANDIR)/% | $$(@D)/
+$(_LINT_man_tbl): $(_MANDIR)/%.lint-man.tbl.touch: $(MANDIR)/% | $$(@D)/
$(info LINT (tbl comment) $@)
if $(GREP) -q '^\.TS$$' $< && ! $(HEAD) -n1 $< | $(GREP) -q '\\" t$$'; \
then \
########################################################################
-# Copyright (C) 2021, 2022 Alejandro Colomar <alx@kernel.org>
-# SPDX-License-Identifier: GPL-2.0 OR LGPL-2.0
+# Copyright (C) 2021 - 2023 Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: GPL-3.0-or-later OR LGPL-3.0-or-later
########################################################################
MAKEFILE_LINT_INCLUDED := 1
-include $(srcdir)/lib/build.mk
-include $(srcdir)/lib/src.mk
-
-
-_LINTDIR := $(builddir)/lint
-
-
-_LINTDIRS := $(patsubst $(MANDIR)/%,$(_LINTDIR)/%/,$(MANDIRS))
-
-
lint := lint-c lint-man
-$(_LINTDIRS): %/: | $$(dir %) $(_LINTDIR)/
-
-
.PHONY: lint
lint: $(lint)
@: