This is an automated email from the ASF dual-hosted git repository.

ronny pushed a commit to branch use-gnu-make-vars
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit b77fa4f6445e511f729d5b9bea55c49ea8822f12
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Tue Aug 15 22:41:34 2023 +0200

    Use GNU make vars for paths
---
 Makefile     | 32 ++++++++++++++++----------------
 Makefile.win | 30 +++++++++++++++---------------
 2 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/Makefile b/Makefile
index 67971c45c..1dd26cab7 100644
--- a/Makefile
+++ b/Makefile
@@ -16,9 +16,9 @@
 
 include version.mk
 
-REBAR?=$(shell echo `pwd`/bin/rebar)
-REBAR3?=$(shell echo `pwd`/bin/rebar3)
-ERLFMT?=$(shell echo `pwd`/bin/erlfmt)
+REBAR?=$(CURDIR)/bin/rebar
+REBAR3?=$(CURDIR)/bin/rebar3
+ERLFMT?=$(CURDIR)/bin/erlfmt
 
 # Handle the following scenarios:
 #   1. When building from a tarball, use version.mk.
@@ -169,9 +169,9 @@ endif
 
 .PHONY: eunit
 # target: eunit - Run EUnit tests, use EUNIT_OPTS to provide custom options
-eunit: export BUILDDIR = $(shell pwd)
-eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
-eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell pwd)/bin/couchjs 
$(shell pwd)/share/server/main.js
+eunit: export BUILDDIR = $(CURDIR)
+eunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
+eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(CURDIR)/bin/couchjs 
$(CURDIR)/share/server/main.js
 eunit: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
 eunit: couch
        @COUCHDB_VERSION=$(COUCHDB_VERSION) COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) 
$(REBAR) setup_eunit 2> /dev/null
@@ -182,28 +182,28 @@ eunit: couch
 
 .PHONY: exunit
 # target: exunit - Run ExUnit tests, use EXUNIT_OPTS to provide custom options
-exunit: export BUILDDIR = $(shell pwd)
+exunit: export BUILDDIR = $(CURDIR)
 exunit: export MIX_ENV=test
-exunit: export ERL_LIBS = $(shell pwd)/src
-exunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
-exunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell pwd)/bin/couchjs 
$(shell pwd)/share/server/main.js
+exunit: export ERL_LIBS = $(CURDIR)/src
+exunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
+exunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(CURDIR)/bin/couchjs 
$(CURDIR)/share/server/main.js
 exunit: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
 exunit: couch elixir-init setup-eunit
        @mix test --trace $(EXUNIT_OPTS)
 
-setup-eunit: export BUILDDIR = $(shell pwd)
-setup-eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
+setup-eunit: export BUILDDIR = $(CURDIR)
+setup-eunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
 setup-eunit:
        @$(REBAR) setup_eunit 2> /dev/null
 
-just-eunit: export BUILDDIR = $(shell pwd)
-just-eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
+just-eunit: export BUILDDIR = $(CURDIR)
+just-eunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
 just-eunit:
        @$(REBAR) -r eunit $(EUNIT_OPTS)
 
 .PHONY: soak-eunit
-soak-eunit: export BUILDDIR = $(shell pwd)
-soak-eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
+soak-eunit: export BUILDDIR = $(CURDIR)
+soak-eunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
 soak-eunit: couch
        @$(REBAR) setup_eunit 2> /dev/null
        while [ $$? -eq 0 ] ; do $(REBAR) -r eunit $(EUNIT_OPTS) ; done
diff --git a/Makefile.win b/Makefile.win
index 23f5db632..2e67aedd7 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -17,9 +17,9 @@
 include version.mk
 
 SHELL=cmd.exe
-REBAR?=$(CURDIR)\bin\rebar.cmd
+REBAR?=$(CURDIR)/bin/rebar.cmd
 PYTHON=python.exe
-ERLFMT?=$(CURDIR)\bin\erlfmt.cmd
+ERLFMT?=$(CURDIR)/bin/erlfmt.cmd
 MAKE=make -f Makefile.win
 # REBAR?=$(shell where rebar.cmd)
 
@@ -89,7 +89,7 @@ DIALYZE_OPTS=$(shell powershell -command "('apps=${apps} 
skip_deps=${skip_deps}
 
 EXUNIT_OPTS=$(subst $(comma),$(space),$(tests))
 
-TEST_OPTS="-c 'startup_jitter=0' -c 'default_security=admin_local'"
+TEST_OPTS="-c startup_jitter=0 -c default_security=admin_local"
 
 
################################################################################
 # Main commands
@@ -154,9 +154,9 @@ endif
 
 .PHONY: eunit
 # target: eunit - Run EUnit tests, use EUNIT_OPTS to provide custom options
-eunit: export BUILDDIR = $(shell echo %cd%)
-eunit: export ERL_AFLAGS = -config $(shell echo %cd%)/rel/files/eunit.config
-eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell echo %cd%)/bin/couchjs 
$(shell echo %cd%)/share/server/main.js
+eunit: export BUILDDIR = $(CURDIR)
+eunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
+eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(CURDIR)/bin/couchjs 
$(CURDIR)/share/server/main.js
 eunit: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
 eunit: couch
        @set COUCHDB_VERSION=$(COUCHDB_VERSION) && set 
COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) && $(REBAR) setup_eunit 2> nul
@@ -164,22 +164,22 @@ eunit: couch
 
 .PHONY: exunit
 # target: exunit - Run ExUnit tests, use EXUNIT_OPTS to provide custom options
-exunit: export BUILDDIR = $(shell echo %cd%)
+exunit: export BUILDDIR = $(CURDIR)
 exunit: export MIX_ENV=test
-exunit: export ERL_LIBS = $(shell echo %cd%)/src
-exunit: export ERL_AFLAGS = -config $(shell echo %cd%)/rel/files/eunit.config
-exunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell echo 
%cd%)/bin/couchjs $(shell echo %cd%)/share/server/main.js
+exunit: export ERL_LIBS = $(CURDIR)/src
+exunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
+exunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(CURDIR)/bin/couchjs 
$(CURDIR)/share/server/main.js
 exunit: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
 exunit: couch elixir-init setup-eunit
        @mix test --trace $(EXUNIT_OPTS)
 
-setup-eunit: export BUILDDIR = $(shell echo %cd%)
-setup-eunit: export ERL_AFLAGS = -config $(shell echo 
%cd%)/rel/files/eunit.config
+setup-eunit: export BUILDDIR = $(CURDIR)
+setup-eunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
 setup-eunit:
        @$(REBAR) setup_eunit 2> nul
 
-just-eunit: export BUILDDIR = $(shell echo %cd%)
-just-eunit: export ERL_AFLAGS = -config $(shell echo 
%cd%)/rel/files/eunit.config
+just-eunit: export BUILDDIR = $(CURDIR)
+just-eunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
 just-eunit:
        @$(REBAR) -r eunit $(EUNIT_OPTS)
 
@@ -299,7 +299,7 @@ mango-test: devclean all
                python.exe -m venv .venv && \
                .venv\Scripts\pip.exe install -r requirements.txt
        @cd src\mango && \
-               ..\..\dev\run $(TEST_OPTS) \
+               ..\..\dev\run "$(TEST_OPTS)" \
                -n 1 \
                --admin=adm:pass \
                "env COUCH_USER=adm COUCH_PASS=pass .venv\Scripts\nose2 
$(MANGO_TEST_OPTS)"

Reply via email to