aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@shadowen.org>2008-09-22 00:44:31 +0100
committerAndy Whitcroft <apw@shadowen.org>2008-10-14 17:36:08 +0100
commitbcc849e435c6765a0cde48d64add6b9c60202a0a (patch)
treeb46602e786e47f7076c595c2ff84729ca5d07816 /Makefile
parentf7730584678b50c21049f58079eda18d0c586bb6 (diff)
downloadlibhugetlbfs-bcc849e435c6765a0cde48d64add6b9c60202a0a.tar.gz
build: allow utilities to consist of more than one file
Allow a utility control which source files it is made up of. This allows us to reuse some of the utility functions from within libhugetlbfs directly without linking against the library. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Acked-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Adam Litke <agl@us.ibm.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c7b3319..09dabaa 100644
--- a/Makefile
+++ b/Makefile
@@ -249,8 +249,18 @@ obj64/%.s: %.c
@$(VECHO) CC64 -S $@
$(CC64) $(CPPFLAGS) $(CFLAGS) -o $@ -S $<
-$(INSTALL_BIN:%=$(BIN_OBJ_DIR)/%): $(BIN_OBJ_DIR)/%: %.c
- @$(VECHO) CC $@
+$(BIN_OBJ_DIR)/%.o: %.c
+ @$(VECHO) CCHOST $@
+ @mkdir -p $(BIN_OBJ_DIR)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
+
+$(BIN_OBJ_DIR)/hugectl: $(BIN_OBJ_DIR)/hugectl.o
+ @$(VECHO) LDHOST $@
+ mkdir -p $(BIN_OBJ_DIR)
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
+
+$(BIN_OBJ_DIR)/hugeedit: $(BIN_OBJ_DIR)/hugeedit.o
+ @$(VECHO) LDHOST $@
mkdir -p $(BIN_OBJ_DIR)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^