From: Keith Busch Date: Wed, 8 Jun 2016 15:59:41 +0000 (-0600) Subject: Use pattern rule for compiling objects X-Git-Tag: v0.8~25 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=23a7844d384202a41906c0c1cff0559c78e5a39b;p=users%2Fsagi%2Fnvme-cli.git Use pattern rule for compiling objects All the object files had the same pattern, though some of the targets were missing the correct dependency list. This fixes them all with a pattern rule. Signed-off-by: Keith Busch --- diff --git a/Makefile b/Makefile index 41c644e1..bf756f5b 100644 --- a/Makefile +++ b/Makefile @@ -36,26 +36,11 @@ OBJS := argconfig.o suffix.o parser.o nvme-print.o nvme-ioctl.o \ nvme: nvme.c ./linux/nvme.h $(OBJS) NVME-VERSION-FILE $(CC) $(CPPFLAGS) $(CFLAGS) nvme.c $(LDFLAGS) -o $(NVME) $(OBJS) -nvme-ioctl.o: nvme-ioctl.c nvme-ioctl.h - $(CC) $(CPPFLAGS) $(CFLAGS) -c nvme-ioctl.c +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 $< -fabrics.o: fabrics.c - $(CC) $(CPPFLAGS) $(CFLAGS) -c fabrics.c - -parser.o: parser.c - $(CC) $(CPPFLAGS) $(CFLAGS) -c parser.c - -argconfig.o: argconfig.c argconfig.h suffix.h - $(CC) $(CPPFLAGS) $(CFLAGS) -c argconfig.c - -suffix.o: suffix.c suffix.h - $(CC) $(CPPFLAGS) $(CFLAGS) -c suffix.c - -nvme-print.o: nvme-print.c nvme-print.h - $(CC) $(CPPFLAGS) $(CFLAGS) -c nvme-print.c - -nvme-lightnvm.o: nvme-lightnvm.h nvme-lightnvm.h - $(CC) $(CPPFLAGS) $(CFLAGS) -c nvme-lightnvm.c +%.o: %.c %.h + $(CC) $(CPPFLAGS) $(CFLAGS) -c $< doc: $(NVME) $(MAKE) -C Documentation