Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ check: all
# 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
Copy link
Copy Markdown
Contributor

@iilyak iilyak Nov 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use ${BUILDDIR} instead of calling $(shell pwd) several times.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iilyak I guess we can, but it's inconsistent with usage pwd everywhere else and feels kind of flimsy, setting env var in one step then depending on it in another.

Why do you want this change? It's not like here is a performance penalty we care about.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it's inconsistent with usage pwd everywhere else and feels kind of flimsy, setting env var in one step then depending on it in another.

I looked only at a diff and missed the fact that is used everywhere. It looked strange to see export BUILDIR and $(shell pwd) two lines bellow.

Why do you want this change?

It is just a suggestion I am fine with the way you wrote it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looked strange to see export BUILDIR and $(shell pwd) two lines bellow.

and one line above too 😄

Well, I agree it's not the best way to write Makefiles and better way to go about it would be something like ROOTDIR := $(shell pwd) to expand current dir at top of Makefile and then just use make's var ${ROOTDIR} everywhere else. But this is a bit bigger change for a quick fix I intended to do, so since you don't have strong feelings about it I'll go ahead with how it is.

eunit: couch
@$(REBAR) setup_eunit 2> /dev/null
@$(REBAR) -r eunit $(EUNIT_OPTS)
Expand Down