[stgt] [PATCH 1/2] usr/Makefile: define object lists for tgtadm and tgtimg targets

Alexander Nezhinsky alexandern at mellanox.com
Tue Feb 21 17:58:43 CET 2012


When object lists are defined for each target, the lists of dependencies
may be generated automatically.

For instance, before this patch is applied, in the list of dependencies
for tgtimg one file was missing (not added manually). This patch ensures
such slip won't happen.

Signed-off-by: Alexander Nezhinsky <alexandern at mellanox.com>
---
 usr/Makefile |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/usr/Makefile b/usr/Makefile
index 13f6cf8..14d5b06 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -54,15 +54,21 @@ tgtd: $(TGTD_OBJS)
 
 -include $(TGTD_DEP)
 
-tgtadm: tgtadm.o
+TGTADM_OBJS = tgtadm.o
+TGTADM_DEP = $(TGTADM_OBJS:.o=.d)
+
+tgtadm: $(TGTADM_OBJS)
 	$(CC) $^ -o $@
 
--include tgtadm.d
+-include $(TGTADM_DEP)
+
+TGTIMG_OBJS = tgtimg.o libssc.o libcrc32c.o
+TGTIMG_DEP = $(TGTIMG_OBJS:.o=.d)
 
-tgtimg: tgtimg.o libssc.o libcrc32c.o
+tgtimg: $(TGTIMG_OBJS)
 	$(CC) $^ -o $@
 
--include tgtimg.d libssc.d
+-include $(TGTIMG_DEP)
 
 %.o: %.c
 	$(CC) -c $(CFLAGS) $*.c -o $*.o
-- 
1.7.3.2

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list