]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
Fix install make targets
authorKeith Busch <kbusch@kernel.org>
Sat, 15 Feb 2020 19:53:38 +0000 (11:53 -0800)
committerKeith Busch <kbusch@kernel.org>
Mon, 17 Feb 2020 20:36:09 +0000 (12:36 -0800)
The makefile needs to be updated to reflect the current layout after
shuffling some things around,

Signed-off-by: Keith Busch <kbusch@kernel.org>
.gitignore
Makefile
src/Makefile

index 37f41682a9ec4ccc0f00f03a33e913e9bfaf0987..c874c37600fa89fe6677e72ee538efc1f92fc5b5 100644 (file)
@@ -7,6 +7,8 @@ a.out
 *.a
 *.so.*
 
+libnvme.pc
+
 test/test
 test/cpp
 
index 32bc5afca13c8261dc227fa3f50c82eb07056642..030f9abf0561d0e94de54781d6643a58bd34c5f8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -31,19 +31,22 @@ ifneq ($(MAKECMDGOALS),clean)
 include config-host.mak
 endif
 
+SED_PROCESS = \
+       $(SED) -e "s%@prefix@%$(prefix)%g" \
+               -e "s%@libdir@%$(libdir)%g" \
+               -e "s%@includedir@%$(includedir)%g" \
+               -e "s%@NAME@%$(NAME)%g" \
+               -e "s%@VERSION@%$(VERSION)%g" \
+               $< >$@
+
 %.pc: %.pc.in config-host.mak $(SPECFILE)
-       sed -e "s%@prefix@%$(prefix)%g" \
-           -e "s%@libdir@%$(libdir)%g" \
-           -e "s%@includedir@%$(includedir)%g" \
-           -e "s%@NAME@%$(NAME)%g" \
-           -e "s%@VERSION@%$(VERSION)%g" \
-           $< >$@
+       $(SED_PROCESS)
 
 install: $(NAME).pc
        @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir)
        $(INSTALL) -D -m 644 $(NAME).pc $(DESTDIR)$(libdir)/pkgconfig/$(NAME).pc
        $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man2
-       $(INSTALL) -m 644 man/*.2 $(DESTDIR)$(mandir)/man2
+       $(INSTALL) -m 644 doc/man/*.2 $(DESTDIR)$(mandir)/man2
 
 install-tests:
        @$(MAKE) -C test install prefix=$(DESTDIR)$(prefix) datadir=$(DESTDIR)$(datadir)
index 541a8167fca5fd4e79341feb529420c44b8d72ca..2434f17ccbed904c7a45e40f36a7d42eae2704c1 100644 (file)
@@ -24,17 +24,6 @@ micro=1
 libname=$(soname).$(minor).$(micro)
 all_targets += $(NAME).a
 
-SED_PROCESS = \
-       $(SED) -e "s%@prefix@%$(prefix)%g" \
-               -e "s%@libdir@%$(libdir)%g" \
-               -e "s%@includedir@%$(includedir)%g" \
-               -e "s%@NAME@%$(NAME)%g" \
-               -e "s%@VERSION@%$(VERSION)%g" \
-               $< >$@
-
-%.pc: %.pc.in Makefile
-       $(SED_PROCESS)
-
 ifeq ($(ENABLE_SHARED),1)
 all_targets += $(libname)
 endif
@@ -77,12 +66,9 @@ libnvme.a: $(libnvme_objs) $(libccan_objs)
 $(libname): $(libnvme_sobjs) $(libccan_sobjs) libnvme.map
        $(QUIET_CC)$(CC) $(SO_CFLAGS) -Wl,--version-script=libnvme.map -Wl,-soname=$(soname) -o $@ $(libnvme_sobjs) $(libccan_sobjs) $(LINK_FLAGS)
 
-install: $(all_targets) $(NAME).pc
-       for i in $(libnvme_api); do \
-               $(INSTALL) -D -m 644 ${i} $(includedir)/${i}
-       done
+install: $(all_targets)
        $(INSTALL) -D -m 644 libnvme.a $(libdir)/libnvme.a
-       $(INSTALL) -D -m 644 $(NAME).pc $(DESTDIR)$(libdir)/pkgconfig/$(NAME).pc
+       for i in $(libnvme_api); do $(INSTALL) -D -m 644 $$i $(includedir)/$$i; done
 ifeq ($(ENABLE_SHARED),1)
        $(INSTALL) -D -m 755 $(libname) $(libdir)/$(libname)
        ln -sf $(libname) $(libdir)/$(soname)
@@ -93,7 +79,7 @@ $(libnvme_objs): $(libnvme_api) $(libnvme_private)
 $(libccan_objs): $(libccan_headers) $(CCANDIR)config.h
 
 clean:
-       rm -f $(all_targets) $(libnvme_objs) $(libnvme_sobjs) $(libccan_objs) $(libccan_sobjs) $(soname).new $(NAME).pc
+       rm -f $(all_targets) $(libnvme_objs) $(libnvme_sobjs) $(libccan_objs) $(libccan_sobjs) $(soname).new
        rm -f $(CCANDIR)config.h
        rm -f $(CCANDIR)tools/configurator/configurator
        rm -f *.so* *.a *.o