]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Fix linking order
authorJon Derrick <jonathan.derrick@intel.com>
Thu, 25 Aug 2016 15:19:13 +0000 (11:19 -0400)
committerKeith Busch <keith.busch@intel.com>
Thu, 25 Aug 2016 15:19:13 +0000 (11:19 -0400)
Linking to libraries needs to be last to resolve all missing symbols at
the final stage rather than just linking to object being compiled.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Makefile

index dbcce3e290f68bfbe84db7783da9848bfda24822..39597dc16d9d20ecaee0ed74ed53c5153cdf35c8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,7 @@ OBJS := argconfig.o suffix.o parser.o nvme-print.o nvme-ioctl.o \
        lnvm-nvme.o memblaze-nvme.o
 
 nvme: nvme.c nvme.h $(OBJS) NVME-VERSION-FILE
-       $(CC) $(CPPFLAGS) $(CFLAGS) nvme.c $(LDFLAGS) -o $(NVME) $(OBJS)
+       $(CC) $(CPPFLAGS) $(CFLAGS) nvme.c -o $(NVME) $(OBJS) $(LDFLAGS)
 
 nvme.o: nvme.c nvme.h nvme-print.h nvme-ioctl.h argconfig.h suffix.h nvme-lightnvm.h fabrics.h
        $(CC) $(CPPFLAGS) $(CFLAGS) -c $<