[PATCH 1/3] tools/vm: fix Makefile multi-targets

From: Sergey Senozhatsky
Date: Tue Nov 10 2015 - 08:33:51 EST


Build all of the $(TARGETS), not just the first one.

Without the patch (make -n)
==============================

make -C ../lib/api
gcc -Wall -Wextra -I../lib/ -o page-types page-types.c ...

Only 'page-types' target was built.

With the patch (make -n)
===========================

make -C ../lib/api
gcc -Wall -Wextra -O2 -I../lib/ -o page-types page-types.c ...
gcc -Wall -Wextra -O2 -I../lib/ -o slabinfo slabinfo.c ...
gcc -Wall -Wextra -O2 -I../lib/ -o page_owner_sort page_owner_sort.c ...

All 3 targets ('page-types', 'slabinfo', 'page_owner_sort') were
built.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx>
---
tools/vm/Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/vm/Makefile b/tools/vm/Makefile
index 93aadaf..51c3f8b 100644
--- a/tools/vm/Makefile
+++ b/tools/vm/Makefile
@@ -1,15 +1,15 @@
# Makefile for vm tools
#
-TARGETS=page-types slabinfo page_owner_sort
+TARGETS = page-types slabinfo page_owner_sort

LIB_DIR = ../lib/api
LIBS = $(LIB_DIR)/libapi.a

CC = $(CROSS_COMPILE)gcc
-CFLAGS = -Wall -Wextra -I../lib/
+CFLAGS = -Wall -Wextra -O2 -I../lib/
LDFLAGS = $(LIBS)

-$(TARGETS): $(LIBS)
+all: $(LIBS) $(TARGETS)

$(LIBS):
make -C $(LIB_DIR)
@@ -18,5 +18,5 @@ $(LIBS):
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)

clean:
- $(RM) page-types slabinfo page_owner_sort
+ $(RM) $(TARGETS)
make -C $(LIB_DIR) clean
--
2.6.2.280.g74301d6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/