diff options
author | Eric Biggers <ebiggers@google.com> | 2020-10-28 11:51:00 -0700 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2020-10-28 11:59:06 -0700 |
commit | 5ca4c55e3382284406ececd909e02ef4f99e9210 (patch) | |
tree | 4b16216b0b85f3375af79d4a5d5bb45afb614b5e | |
parent | 97bc1aa3775ab4ebcf59560b5d4b26f3c6fcc750 (diff) | |
download | fsverity-utils-5ca4c55e3382284406ececd909e02ef4f99e9210.tar.gz |
Makefile: generate libfsverity.pc during 'make install'
The current approach doesn't really work as expected because 'make &&
make PREFIX=/usr install' causes a rebuild due to PREFIX changing.
Avoid this for now by generating libfsverity.pc during 'make install'.
Signed-off-by: Eric Biggers <ebiggers@google.com>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 21 |
2 files changed, 6 insertions, 16 deletions
@@ -6,7 +6,6 @@ /.build-config /fsverity /fsverity.sig -/libfsverity.pc /run-tests.log /test_* cscope.* @@ -70,10 +70,6 @@ PKGCONF ?= pkg-config echo 'LDFLAGS=$(LDFLAGS)'; \ echo 'LDLIBS=$(LDLIBS)'; \ echo 'USE_SHARED_LIB=$(USE_SHARED_LIB)'; \ - echo 'PREFIX=$(PREFIX)'; \ - echo 'LIBDIR=$(LIBDIR)'; \ - echo 'INCDIR=$(INCDIR)'; \ - echo 'BINDIR=$(BINDIR)'; \ ); \ if [ "$$flags" != "`cat $@ 2>/dev/null`" ]; then \ [ -e $@ ] && echo "Rebuilding due to new settings"; \ @@ -131,15 +127,6 @@ libfsverity.so:libfsverity.so.$(SOVERSION) DEFAULT_TARGETS += libfsverity.so -# Create the pkg-config file -libfsverity.pc: lib/libfsverity.pc.in .build-config - $(QUIET_GEN) sed -e "s|@PREFIX@|$(PREFIX)|" \ - -e "s|@LIBDIR@|$(LIBDIR)|" \ - -e "s|@INCDIR@|$(INCDIR)|" \ - $< > $@ - -DEFAULT_TARGETS += libfsverity.pc - ############################################################################## #### Programs @@ -216,8 +203,12 @@ install:all install -m644 libfsverity.a $(DESTDIR)$(LIBDIR) install -m755 libfsverity.so.$(SOVERSION) $(DESTDIR)$(LIBDIR) ln -sf libfsverity.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)/libfsverity.so - install -m644 libfsverity.pc $(DESTDIR)$(LIBDIR)/pkgconfig - install -m644 include/libfsverity.h $(DESTDIR)$(INCDIR) + sed -e "s|@PREFIX@|$(PREFIX)|" \ + -e "s|@LIBDIR@|$(LIBDIR)|" \ + -e "s|@INCDIR@|$(INCDIR)|" \ + lib/libfsverity.pc.in \ + > $(DESTDIR)$(LIBDIR)/pkgconfig/libfsverity.pc + chmod 644 $(DESTDIR)$(LIBDIR)/pkgconfig/libfsverity.pc uninstall: rm -f $(DESTDIR)$(BINDIR)/fsverity |