diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2021-08-31 19:05:59 -0700 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2021-08-31 19:05:59 -0700 |
commit | 15a3d49bf12b24c0a353525acb93e188f67e7581 (patch) | |
tree | 0188c91f43fa103af90a60bfe74c49cef400d152 /progs | |
parent | 264b784089bfb56b0039c1ebfc5e92912f0284ce (diff) | |
download | libcap2-15a3d49bf12b24c0a353525acb93e188f67e7581.tar.gz |
Move $(LDFLAGS) earlier in build command lines.
As explained (thanks David Seifert) there are some LDFLAGS that
need to precede actual linked libraries. For example, -Wl,--as-needed.
Given this, I've tried it and it appears to work for the default
build cases as captured in 'make distcheck'.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'progs')
-rw-r--r-- | progs/Makefile | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/progs/Makefile b/progs/Makefile index 0917dd3..2f887c8 100644 --- a/progs/Makefile +++ b/progs/Makefile @@ -28,7 +28,7 @@ endif $(MAKE) -C ../libcap libcap.so $(BUILD): %: %.o $(DEPS) - $(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBCAPLIB) %.o: %.c $(INCS) $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ @@ -49,8 +49,10 @@ capshdoc.h.cf: capshdoc.h ./mkcapshdoc.sh diff -u capshdoc.h $@ || (rm $@ ; exit 1) capsh: capsh.c capshdoc.h.cf $(DEPS) - $(CC) $(CFLAGS) $(CPPFLAGS) $(CAPSH_SHELL) -o $@ $< $(LIBCAPLIB) $(LDFLAGS) + $(CC) $(CFLAGS) $(CPPFLAGS) $(CAPSH_SHELL) $(LDFLAGS) -o $@ $< $(LIBCAPLIB) +# Statically linked with minimal linkage flags to enable running in a +# chroot and in other in-tree testing contexts. tcapsh-static: capsh.c capshdoc.h.cf $(DEPS) $(CC) $(CFLAGS) $(CPPFLAGS) $(CAPSH_SHELL) -o $@ $< $(LIBCAPLIB) --static |