Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: Use 'install' to install and respect DESTDIR #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ capnpc-java : $(CAPNPC_JAVA_SOURCES)
$(CXX) $(CAPNPC_JAVA_SOURCES) $(CXX_FLAGS) -o capnpc-java

install:
mkdir -p ${PREFIX}/bin
mkdir -p ${PREFIX}/include/capnp/
cp capnpc-java ${PREFIX}/bin
cp compiler/src/main/schema/capnp/java.capnp ${PREFIX}/include/capnp/
install -D capnpc-java "${DESTDIR}/${PREFIX}"/bin/capnpc-java
Copy link
Member

Choose a reason for hiding this comment

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

What if PREFIX is a relative path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this about PREFIX not starting with /? This would be uncommon, although I believe the current change would accept it and still do the right thing™, because there is an explicit / between DESTDIR and PREFIX.

Copy link
Member

Choose a reason for hiding this comment

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

If PREFIX is a relative path and DESTDIR is empty, then the / will make the result an incorrect absolute path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you are saying that I should remove the explicit / between DESTDIR and PREFIX, then I am happy to do so. :)

install -D compiler/src/main/schema/capnp/java.capnp "${DESTDIR}/${PREFIX}"/include/capnp/java.capnp

MINGW_LIBS=~/src/capnproto/c++/build-mingw/.libs/libcapnp.a ~/src/capnproto/c++/build-mingw/.libs/libkj.a
MINGW_CXX=i686-w64-mingw32-g++
Expand Down