Skip to contentSkip to conversation

out of tree build

LTP In review Gilles Chanteperdrix 2 participants 4 messages Mar 9, 2014 – Mar 26, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi,

I have tried building LTP january release, and found that the following changes were necessary.

Regards.

Makefile +1 -1
diff -Naurdp ltp-full-20140115.orig/Makefile ltp-full-20140115/Makefile
@@ -176,7 +176,7 @@ Version:
 	if git describe >/dev/null 2>&1; then \
 		git describe > "$@"; \
 	else \
-		cp VERSION "$@"; \
+		cp $(top_srcdir)/VERSION "$@"; \
 	fi
 
 $(INSTALL_DIR)/Version: Version
testcases/kernel/include/lib.mk +7 -4
diff -Naurdp ltp-full-20140115.orig/testcases/kernel/include/lib.mk ltp-full-20140115/testcases/kernel/include/lib.mk
@@ -16,10 +16,13 @@
 #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 
-KERNEL_DIR		:= $(top_srcdir)/testcases/kernel
+KERNEL_SRCDIR		:= $(top_srcdir)/testcases/kernel
+LIBKERNTEST_SRCDIR	:= $(KERNEL_SRCDIR)/lib
+
+KERNEL_DIR		:= $(top_builddir)/testcases/kernel
 LIBKERNTEST_DIR		:= $(KERNEL_DIR)/lib
 LIBKERNTEST		:= $(KERNEL_DIR)/libkerntest.a
-CPPFLAGS		+= $(NUMA_CPPFLAGS) -I$(KERNEL_DIR)/include
+CPPFLAGS		+= $(NUMA_CPPFLAGS) -I$(KERNEL_SRCDIR)/include
 LDLIBS			+= $(NUMA_LIBS) -lkerntest -lltp
 LDFLAGS			+= -L$(LIBKERNTEST_DIR)
 
@@ -27,11 +30,11 @@ $(LIBKERNTEST_DIR):
 	mkdir -p "$@"
 
 $(LIBKERNTEST): $(LIBKERNTEST_DIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
+	$(MAKE) -C $^ -f "$(LIBKERNTEST_SRCDIR)/Makefile" all
 
 MAKE_DEPS		+= $(LIBKERNTEST)
 
 trunk-clean:: | lib-clean
 
 lib-clean:: $(LIBKERNTEST_DIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
+	$(MAKE) -C $^ -f "$(LIBKERNTEST_SRCDIR)/Makefile" clean
testcases/kernel/lib/Makefile +1 -1
diff -Naurdp ltp-full-20140115.orig/testcases/kernel/lib/Makefile ltp-full-20140115/testcases/kernel/lib/Makefile
@@ -22,7 +22,7 @@ top_srcdir		?= ../../..
 
 include $(top_srcdir)/include/mk/env_pre.mk
 
-CPPFLAGS		+= $(NUMA_CPPFLAGS) -I../include
+CPPFLAGS		+= $(NUMA_CPPFLAGS) -I$(abs_srcdir)/../include
 INTERNAL_LIB		:= libkerntest.a
 
 include $(top_srcdir)/include/mk/lib.mk
testcases/kernel/mem/include/libmem.mk +7 -4
diff -Naurdp ltp-full-20140115.orig/testcases/kernel/mem/include/libmem.mk ltp-full-20140115/testcases/kernel/mem/include/libmem.mk
@@ -16,11 +16,14 @@
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 #
 
-MEM_DIR			:= $(top_srcdir)/testcases/kernel/mem
+MEM_SRCDIR		:= $(top_srcdir)/testcases/kernel/mem
+LIBMEM_SRCDIR		:= $(MEM_SRCDIR)/lib
+
+MEM_DIR			:= $(top_builddir)/testcases/kernel/mem
 LIBMEM_DIR		:= $(MEM_DIR)/lib
 LIBMEM			:= $(LIBMEM_DIR)/libmem.a
 FILTER_OUT_DIRS		:= $(LIBMEM_DIR)
-CFLAGS			+= -I$(MEM_DIR)/include
+CFLAGS			+= -I$(MEM_SRCDIR)/include
 LDLIBS			+= $(NUMA_LIBS) -lmem -lltp
 LDFLAGS			+= -L$(LIBMEM_DIR)
 
@@ -28,13 +31,13 @@ $(LIBMEM_DIR):
 	mkdir -p "$@"
 
 $(LIBMEM): $(LIBMEM_DIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
+	$(MAKE) -C $^ -f "$(LIBMEM_SRCDIR)/Makefile" all
 
 MAKE_DEPS		+= $(LIBMEM)
 
 trunk-clean:: | lib-clean
 
 lib-clean:: $(LIBMEM_DIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
+	$(MAKE) -C $^ -f "$(LIBMEM_SRCDIR)/Makefile" clean
 
 include $(top_srcdir)/testcases/kernel/include/lib.mk
testcases/kernel/mem/lib/Makefile +1 -1
diff -Naurdp ltp-full-20140115.orig/testcases/kernel/mem/lib/Makefile ltp-full-20140115/testcases/kernel/mem/lib/Makefile
@@ -20,7 +20,7 @@ top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/env_pre.mk
 
-CFLAGS			+= -I../include
+CPPFLAGS		+= -I$(abs_srcdir)/../include
 INTERNAL_LIB		:= libmem.a
 
 include $(top_srcdir)/testcases/kernel/include/lib.mk
utils/ffsb-6.0-rc2/stamp-h +1 -0
diff -Naurdp ltp-full-20140115.orig/utils/ffsb-6.0-rc2/stamp-h ltp-full-20140115/utils/ffsb-6.0-rc2/stamp-h
@@ -0,0 +1 @@
+timestamp
utils/Makefile +7 -7
diff -Naurdp ltp-full-20140115.orig/utils/Makefile ltp-full-20140115/utils/Makefile
@@ -28,18 +28,18 @@ FFSBDIR			:= ffsb-6.0-rc2
 FILTER_OUT_DIRS		:= $(FFSBDIR)
 FFSB			:= $(FFSBDIR)/ffsb
 
-$(FFSB): $(FFSBDIR)
-	cd $^; ./configure
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
-	cp $(FFSBDIR)/ffsb ffsb
+unexport MAKEFLAGS
+
+$(FFSB): $(abs_srcdir)/$(FFSBDIR)
+	mkdir -p $(FFSBDIR)
+	cd $(FFSBDIR) && "$^/configure" && $(MAKE) all
 
 trunk-all: $(FFSB)
 
 trunk-clean:: | ffsb-clean
 
-ffsb-clean:: $(FFSBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
-	rm -rf ffsb
+ffsb-clean:: $(abs_srcdir)/$(FFSBDIR)
+	cd $(FFSBDIR); $(MAKE) clean
 
 
 include $(top_srcdir)/include/mk/generic_trunk_target.mk
Signature · 12 lines
                                                                Gilles.

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi!

Quoted 4 lines

Hi,

I have tried building LTP january release, and found that the following changes were necessary.

We did not test it for some time (I've looked at the history and it has been broken for at least two years) sorry.

Now to the patch. Generally it looks good to me, most of the changes are fixes in paths that should not break anything.

Have you tried in tree build with the changes, was it working fine?

Does the patch apply over the latest git? Ideally you should send a signed patch against latest git (output from git format-patch).

And it would be a good idea to add out-of-tree build instructions into the doc/mini-howto-building-ltp-from-git.txt too.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#2 lore raw

PATCH 1/1 build: fix out-of-tree build

---
 Makefile                                         |    2 +-
 testcases/kernel/include/lib.mk                  |   11 +++++++----
 testcases/kernel/lib/Makefile                    |    2 +-
 testcases/kernel/mem/include/libmem.mk           |   11 +++++++----
 testcases/kernel/mem/lib/Makefile                |    2 +-
 testcases/network/rpc/basic_tests/rpc01/Makefile |    2 +-
 utils/Makefile                                   |   14 +++++++-------
 7 files changed, 25 insertions(+), 19 deletions(-)
Makefile +1 -1
index 71efca4..297f8e7 100644
@@ -176,7 +176,7 @@ Version:
 	if git describe >/dev/null 2>&1; then \
 		git describe > "$@"; \
 	else \
-		cp VERSION "$@"; \
+		cp $(top_srcdir)/VERSION "$@"; \
 	fi
 
 $(INSTALL_DIR)/Version: Version
testcases/kernel/include/lib.mk +7 -4
index 624134b..c193ca3 100644
@@ -16,10 +16,13 @@
 #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 
-KERNEL_DIR		:= $(top_srcdir)/testcases/kernel
+KERNEL_SRCDIR		:= $(abs_top_srcdir)/testcases/kernel
+LIBKERNTEST_SRCDIR	:= $(KERNEL_SRCDIR)/lib
+
+KERNEL_DIR		:= $(abs_top_builddir)/testcases/kernel
 LIBKERNTEST_DIR		:= $(KERNEL_DIR)/lib
 LIBKERNTEST		:= $(KERNEL_DIR)/libkerntest.a
-CPPFLAGS		+= $(NUMA_CPPFLAGS) -I$(KERNEL_DIR)/include
+CPPFLAGS		+= $(NUMA_CPPFLAGS) -I$(KERNEL_SRCDIR)/include
 LDLIBS			+= $(NUMA_LIBS) -lkerntest -lltp
 LDFLAGS			+= -L$(LIBKERNTEST_DIR)
 
@@ -27,11 +30,11 @@ $(LIBKERNTEST_DIR):
 	mkdir -p "$@"
 
 $(LIBKERNTEST): $(LIBKERNTEST_DIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
+	$(MAKE) -C $^ -f "$(LIBKERNTEST_SRCDIR)/Makefile" all
 
 MAKE_DEPS		+= $(LIBKERNTEST)
 
 trunk-clean:: | lib-clean
 
 lib-clean:: $(LIBKERNTEST_DIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
+	$(MAKE) -C $^ -f "$(LIBKERNTEST_SRCDIR)/Makefile" clean
testcases/kernel/lib/Makefile +1 -1
index db094e8..c4af8df 100644
@@ -22,7 +22,7 @@ top_srcdir		?= ../../..
 
 include $(top_srcdir)/include/mk/env_pre.mk
 
-CPPFLAGS		+= $(NUMA_CPPFLAGS) -I../include
+CPPFLAGS		+= $(NUMA_CPPFLAGS) -I$(abs_srcdir)/../include
 INTERNAL_LIB		:= libkerntest.a
 
 include $(top_srcdir)/include/mk/lib.mk
testcases/kernel/mem/include/libmem.mk +7 -4
index fdf38a1..7ebcf05 100644
@@ -16,11 +16,14 @@
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 #
 
-MEM_DIR			:= $(top_srcdir)/testcases/kernel/mem
+MEM_SRCDIR		:= $(top_srcdir)/testcases/kernel/mem
+LIBMEM_SRCDIR		:= $(MEM_SRCDIR)/lib
+
+MEM_DIR			:= $(top_builddir)/testcases/kernel/mem
 LIBMEM_DIR		:= $(MEM_DIR)/lib
 LIBMEM			:= $(LIBMEM_DIR)/libmem.a
 FILTER_OUT_DIRS		:= $(LIBMEM_DIR)
-CFLAGS			+= -I$(MEM_DIR)/include
+CFLAGS			+= -I$(MEM_SRCDIR)/include
 LDLIBS			+= $(NUMA_LIBS) -lmem -lltp
 LDFLAGS			+= -L$(LIBMEM_DIR)
 
@@ -28,13 +31,13 @@ $(LIBMEM_DIR):
 	mkdir -p "$@"
 
 $(LIBMEM): $(LIBMEM_DIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
+	$(MAKE) -C $^ -f "$(LIBMEM_SRCDIR)/Makefile" all
 
 MAKE_DEPS		+= $(LIBMEM)
 
 trunk-clean:: | lib-clean
 
 lib-clean:: $(LIBMEM_DIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
+	$(MAKE) -C $^ -f "$(LIBMEM_SRCDIR)/Makefile" clean
 
 include $(top_srcdir)/testcases/kernel/include/lib.mk
testcases/kernel/mem/lib/Makefile +1 -1
index 6bc5863..d4624e9 100644
@@ -20,7 +20,7 @@ top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/env_pre.mk
 
-CFLAGS			+= -I../include
+CPPFLAGS		+= -I$(abs_srcdir)/../include
 INTERNAL_LIB		:= libmem.a
 
 include $(top_srcdir)/testcases/kernel/include/lib.mk
testcases/network/rpc/basic_tests/rpc01/Makefile +1 -1
index 68ea85e..7815cbb 100644
@@ -32,7 +32,7 @@ SUBDIRS			:= datafiles
 
 LIBSRCS			:= $(abs_srcdir)/librpc01.c
 INTERNAL_LIB		:= librpc01.a
-LDFLAGS			+= -L$(abs_srcdir)
+LDFLAGS			+= -L$(abs_builddir)
 LDLIBS			+= -lrpc01
 
 MAKE_TARGETS		:= rpc1 rpc_server
utils/Makefile +7 -7
index 58cec7c..d2d4324 100644
@@ -28,18 +28,18 @@ FFSBDIR			:= ffsb-6.0-rc2
 FILTER_OUT_DIRS		:= $(FFSBDIR)
 FFSB			:= $(FFSBDIR)/ffsb
 
-$(FFSB): $(FFSBDIR)
-	cd $^; ./configure
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
-	cp $(FFSBDIR)/ffsb ffsb
+unexport MAKEFLAGS
+
+$(FFSB): $(abs_srcdir)/$(FFSBDIR)
+	mkdir -p $(FFSBDIR)
+	cd $(FFSBDIR) && "$^/configure" && $(MAKE) all
 
 trunk-all: $(FFSB)
 
 trunk-clean:: | ffsb-clean
 
-ffsb-clean:: $(FFSBDIR)
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" clean
-	rm -rf ffsb
+ffsb-clean:: $(abs_srcdir)/$(FFSBDIR)
+	cd $(FFSBDIR); $(MAKE) clean
 
 
 include $(top_srcdir)/include/mk/generic_trunk_target.mk
Signature · 13 lines
1.7.10.4


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#3 lore raw

Re: [LTP] [PATCH] build: fix out-of-tree build

Hi!

utils/Makefile FFSBDIR := ffsb-6.0-rc2 · line 35

Quoted 9 lines

-$(FFSB): $(FFSBDIR)

utils/Makefile +5 -3
-	cd $^; ./configure
-	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
-	cp $(FFSBDIR)/ffsb ffsb
+unexport MAKEFLAGS
+
+$(FFSB): $(abs_srcdir)/$(FFSBDIR)
+	mkdir -p $(FFSBDIR)
+	cd $(FFSBDIR) && "$^/configure" && $(MAKE) all

The GNU Make manual suggests to use $(MAKE) all MAKEFLAGS= instead of the unexport, the rest looks ok.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list