Skip to content

Commit

Permalink
Makefile: add several shell targets
Browse files Browse the repository at this point in the history
This adds several shell targets for the most used shells.

Note: The target runs dosh -c "$SHELL", i.e. it does not run the $SHELL
directly. As a consequence, dosh does not go in interactive mode and
does not allocate a pseudo-TTY as not interactive flag is explicitly set
and the shell command has arguments. Thus, the interactive $SHELL ends.
The targets appends explicitly the interactive option via the variable
.SHELLFLAGS[1].

[1]: https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html
  • Loading branch information
gportay committed Feb 4, 2025
1 parent 5611d3f commit 199cac7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2017-2020,2023-2024 Gaël PORTAY
# Copyright 2017-2020,2023-2025 Gaël PORTAY
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
Expand Down Expand Up @@ -196,6 +196,13 @@ aur-git: PKGBUILD.tmp
PKGBUILD.tmp: PKGBUILD-git
cp $< $@

.PHONY: sh dash bash zsh
sh dash bash zsh: PATH := $(CURDIR):$(PATH)
sh dash bash zsh: .SHELLFLAGS := -c -i
sh dash bash zsh: SHELL := dosh
sh dash bash zsh:
$@

%.1: %.1.adoc
asciidoctor -b manpage -o $@ $<

Expand Down

0 comments on commit 199cac7

Please sign in to comment.