preeny icon indicating copy to clipboard operation
preeny copied to clipboard

Makefile always rebuilds the libraries

Open d33tah opened this issue 9 years ago • 8 comments

This is probably an easy fix - I used to find myself hacking preeny for my own needs quite a lot once and I found it a bit annoying that "make" would try to rebuild all of the libraries even if I changed just one. Tested on Fedora 21.

d33tah avatar Sep 02 '15 02:09 d33tah

Unfortunately, I don't have the cycles to look into this at the moment, but I'd be happy to take a PR if someone does :-)

zardus avatar Sep 02 '15 02:09 zardus

Here's the source of the problem: http://stackoverflow.com/q/32386112/1091116

d33tah avatar Sep 03 '15 22:09 d33tah

Here's a partial fix that doesn't remove the symlinks on "make clean":

diff --git a/src/build_so.sh b/src/build_so.sh
index dc2e1f1..d6386ea 100755
--- a/src/build_so.sh
+++ b/src/build_so.sh
@@ -27,4 +27,5 @@ shift 2

 $CC $IN -o $OUT -shared $OPTS "$@" &&
 mkdir -p ../$MACHINE &&
-mv $OUT ../$MACHINE/
+rm -f ../$MACHINE/$OUT &&
+ln -s ../src/$OUT ../$MACHINE/

d33tah avatar Sep 03 '15 22:09 d33tah

Ah, but this way it won't support building multiple architectures in the same checked out repository :-(

zardus avatar Sep 04 '15 02:09 zardus

What's your workflow? Perhaps this should be done by "make install"?

d33tah avatar Sep 05 '15 17:09 d33tah

I think just removing the move from build.sh and having it done by "make dist" would be perfect, actually. Good idea!

zardus avatar Sep 08 '15 03:09 zardus

Ok, I ended up rewriting the whole makefile so that we don't need build_so.sh anymore.

Doing make from the top-level dir will still blow the libs away (I want to avoid confusion between architectures when cross-compiling), but running make in src will have the expected behavior. Let me know if that works for you.

zardus avatar Sep 08 '15 05:09 zardus

Would be solved by https://github.com/zardus/preeny/pull/46

ZetaTwo avatar Oct 14 '18 13:10 ZetaTwo