summary refs log tree commit diff
path: root/package
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-02-05 04:37:51 +0000
committerLaurent Bercot <ska@appnovation.com>2023-02-05 04:37:51 +0000
commit4676457df2c8a73b4f589a66315b9b137ee89202 (patch)
treec9bc5310ed2930a9aa5c0b73b19cd174b8a7d43d /package
parent26152eb4dfe9b6ebb2360f855663d0e30177eba1 (diff)
downloadexecline-4676457df2c8a73b4f589a66315b9b137ee89202.tar.gz
execline-4676457df2c8a73b4f589a66315b9b137ee89202.tar.xz
execline-4676457df2c8a73b4f589a66315b9b137ee89202.zip
Simplify build system, add --enable-multicall
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'package')
-rw-r--r--package/targets.mak98
1 files changed, 22 insertions, 76 deletions
diff --git a/package/targets.mak b/package/targets.mak
index 37e8fa7..c8fe852 100644
--- a/package/targets.mak
+++ b/package/targets.mak
@@ -1,88 +1,34 @@
-BIN_TARGETS := \
-background \
-backtick \
-case \
-define \
-dollarat \
-elgetopt \
-elgetpositionals \
-elglob \
-eltest \
-emptyenv \
-envfile \
-exec \
-execlineb \
-execline-cd \
-execline-umask \
-exit \
-export \
-fdblock \
-fdclose \
-fdmove \
-fdswap \
-fdreserve \
-forbacktickx \
-foreground \
-forstdin \
-forx \
-getcwd \
-getpid \
-heredoc \
-homeof \
-if \
-ifelse \
-ifte \
-ifthenelse \
-importas \
-loopwhilex \
-multidefine \
-multisubstitute \
-pipeline \
-piperw \
-posix-cd \
-posix-umask \
-redirfd \
-runblock \
-shift \
-trap \
-tryexec \
-unexport \
-wait \
-withstdinas
-
 LIBEXEC_TARGETS :=
 
 LIB_DEFS := EXECLINE=execline
 
-ifeq ($(PEDANTIC_POSIX),1)
-PEDANTIC_PREFIX := posix
-else
-PEDANTIC_PREFIX := execline
-endif
-
-EXTRA_TARGETS := cd umask
-
-$(DESTDIR)$(bindir)/cd: $(DESTDIR)$(bindir)/$(PEDANTIC_PREFIX)-cd
-	exec ./tools/install.sh -l $(PEDANTIC_PREFIX)-cd $(DESTDIR)$(bindir)/cd
-
-$(DESTDIR)$(bindir)/umask: $(DESTDIR)$(bindir)/$(PEDANTIC_PREFIX)-umask
-	exec ./tools/install.sh -l $(PEDANTIC_PREFIX)-umask $(DESTDIR)$(bindir)/umask
-
+ifeq ($(MULTICALL),1)
 
-EXTRA_BINS := execline
+BIN_TARGETS := execline
+BIN_SYMLINKS := cd umask $(notdir $(wildcard src/execline/deps-exe/*))
 EXTRA_TEMP := src/multicall/execline.c
 
-multicall multicall-all: execline
+define symlink_definition
+SYMLINK_TARGET_$(1) := execline
+endef
+$(foreach name,$(BIN_SYMLINKS),$(eval $(call symlink_definition,$(name))))
 
-multicall-strip: execline
-	exec $(STRIP) -R .note -R .comment execline
+src/multicall/execline.c: tools/gen-multicall.sh src/execline/deps-exe
+	./tools/gen-multicall.sh > src/multicall/execline.c
 
-multicall-install: $(DESTDIR)$(bindir)/execline
-	for i in $(BIN_TARGETS) $(EXTRA_TARGETS) ; do ./tools/install.sh -l execline $(DESTDIR)$(bindir)/$$i ; done
+src/multicall/execline.o: src/multicall/execline.c src/include/execline/config.h src/include/execline/execline.h
 
-multicall-global-links: $(DESTDIR)$(sproot)/command/execline
+else
 
-.PHONY: multicall multicall-all multicall-strip multicall-install multicall-global-links
+BIN_TARGETS := $(notdir $(wildcard src/execline/deps-exe/*))
+BIN_SYMLINKS := cd umask
 
-src/multicall/execline.c: tools/gen-multicall.sh src/execline/deps-exe src/include/execline/config.h src/include/execline/execline.h
-	./tools/gen-multicall.sh > src/multicall/execline.c
+ifeq ($(PEDANTIC_POSIX),1)
+SYMLINK_TARGET_cd := posix-cd
+SYMLINK_TARGET_umask := posix-umask
+else
+SYMLINK_TARGET_cd := execline-cd
+SYMLINK_TARGET_umask := execline-umask
+endif
+
+endif