Skip to contentSkip to conversation

build system cleanup

RFC PATCH In review Cyril Hrubis 1 participant 4 messages Jul 3, 2009 – Jul 31, 2009 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 build system cleanup

Hi,
following patch introduces ltp buildsystem cleanup, not all the source are fixed but it's big enough to show you the direction. I would gladly write comprehensive HOWTO for creating makefiles the new way in case this cleanup patch will be accepted.

This patch introduces Makefile.include, where all the hard work is done. If you have any questions or edhancements don't hesitate to ask. Most of this file contains definitions of generic make rules so that you don't need to say make how to create binary test from source test.c. The rest of the file are rules for subdirectory handling. There are two rules, one for make and one for make install as quite lot of directories contains only shell scripts so make entering this directories only slows down building process. Also it turns on warnings for all sources, so furhter code cleanups are easier to do.

Every Makefile starts with definition of subdirectories to build and subdirectories to install followed by including the Makefile.include from the top of ltp directory. So if there are some directories to run make in; makefile should look like:

SUBDIRS=test_a test_b
SUBDIRS_INSTALL=$(SUBDIRS) test_c
TOPDIR=../../../../
include $(TOPDIR)Makefile.include

And that's it, nothing more is needed for running make in subdirectories. Also subdirs are defined as targets (in Makefile.include) so make can execute submakes in paralel.

If some directories are needed to build before the others (for example because they contain code used by the rest of the tests in subdirectories) one additional rule is needed.

SUBDIRS=test_a test_b libtest
SUBDIRS_INSTALL=$(SUBDIRS) test_c
TOPDIR=../../../../
include $(TOPDIR)Makefile.include
libtest: test_a test_b

This will work allways correctly with make -jN where N > 2 (when make runs in paralel).

When we need to create binaries, objectfiles or libraries we start with including Makefile.include. Then we define additional libraries here we need -lm and we use ltp tst_* calls. In the end we define what to build, binary names and source names must match.

TOPDIR=../../../../
include $(TOPDIR)Makefile.include

LDFLAGS+=-lm
LOADLIBES+=$(TOPDIR)lib/libltp.a

SOURCES=$(wildcard *.c)
TARGETS=$(SOURCES:.c=)

all: $(TARGETS)

If we need to add additional compile flags for one file, we need to add line:

test.c: LDFLAGS+=-lpthread

That's all folks! Now waiting for your comments.

Signature · 2 lines
Cyril Hrubis
[email protected]
Makefile.include new file +87 -0
Index: ltp-full-20090630/Makefile.include
===================================================================
@@ -0,0 +1,87 @@
+#
+# This file overrides default building rules in order to create much more
+# readable build messages.
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
+
+#
+# Suppress the long gcc line in order to have less noisy build output
+#
+%.o: %.c
+	@echo "CC  $@"
+	@$(CC) $(CFLAGS) -Wall -W -I$(TOPDIR)include -c $< -o $@
+
+%.o: %.cpp
+	@echo "CXX $@"
+	@$(CXX) $(CPPFLAGS) -Wall -W -c $< -o $@
+
+#
+# How to create binaries from object files
+#
+%: %.o
+	@echo "LN  $@"
+	@$(CC) $(LDFLAGS) $^ $(LOADLIBES) -o $@
+
+#
+# How to create binaries from C sources
+#
+%: %.c
+	@echo "CC  $@"
+	@$(CC) $^ -Wall -W -I$(TOPDIR)include $(CFLAGS) $(LDFLAGS) $(LOADLIBES) -o $@
+
+%:: %.cpp
+	@echo "CXX $@"
+	@$(CXX) -Wall -W $(LDFLAGS) $(CPPFLAGS) $< -o $@
+
+#
+# How to create static library
+#
+%.a:
+	@echo "AR  $@"
+	@$(AR) -cr $@ $^
+
+#
+# SUBDIRS MAKE MAGICK
+#
+#
+# We mangle SUBDIRS_INSTALL to be different from SUBDIRS
+#
+MANGLE=424242424242
+SUBDIRS_INSTALL_MANGLED=$(foreach SUBDIR,$(SUBDIRS_INSTALL),$(SUBDIR)$(MANGLE))
+.PHONY: all clean install uninstall subdirs $(SUBDIRS) $(SUBDIRS_INSTALL_MANGLED)
+
+all: export MAKE_CMD=
+all: subdirs
+clean: export MAKE_CMD=clean
+clean: subdirs
+subdirs: $(SUBDIRS)
+install: export MAKE_CMD=install
+install: $(SUBDIRS_INSTALL_MANGLED)
+uninstall: export MAKE_CMD=uninstall
+uninstall: $(SUBDIRS_INSTALL_MANGLED)
+
+#
+# Subdirs for make and make clean
+#
+$(SUBDIRS):
+	@export LTP_CUR_DIR="$$LTP_CUR_DIR/$@" &&\
+	echo "DIR $$LTP_CUR_DIR"               &&\
+	cd "$@" && $(MAKE) --no-print-directory $(MAKE_CMD)
+
+#
+# As some directories contain just bash scritps, make and make clean slowns down
+# building, so make install has it's own rule.
+#
+$(SUBDIRS_INSTALL_MANGLED):
+	@SUBDIR=`echo "$@" | sed s/$(MANGLE)//`     &&\
+	export LTP_CUR_DIR="$$LTP_CUR_DIR/$$SUBDIR" &&\
+	echo "DIR $$LTP_CUR_DIR install"            &&\
+	cd "$$SUBDIR" && $(MAKE) --no-print-directory $(MAKE_CMD)
+
+#
+# Printing functions
+#
+print_warn=@echo 'WAR ***${1} ****'
lib/Makefile +4 -4
Index: ltp-full-20090630/lib/Makefile
===================================================================
@@ -1,7 +1,8 @@
+TOPDIR=../
+include $(TOPDIR)Makefile.include
 
 PREFIX=/opt/ltp
 
-CFLAGS+= -Wall
 CPPFLAGS+= -I../include 
 ifeq ($(shell uname -s),HP-UX)
 CFLAGS+=-Ae -D_LARGEFILE64_SOURCE +DA1.1
@@ -9,13 +10,13 @@ endif
 ifeq ($(UCLINUX),1)
 CFLAGS+= -D_USC_LIB_ -D__UCLIBC__ -DUCLINUX
 endif
-LDFLAGS+=
 TARGET=libltp.a
 SRCS=$(wildcard *.c)
 OBJS=$(patsubst %.c,%.o,$(SRCS))
 
+all: $(TARGET)
+
 $(TARGET): $(OBJS)
-	$(AR) -cr $@ $^
 
 clean:
 	rm -f $(TARGET) $(OBJS)
@@ -23,4 +24,3 @@ clean:
 install: $(TARGET)
 	install -D -m 644 $(TARGET) $(DESTDIR)/$(PREFIX)/lib$(LIBSUFFIX)/$(TARGET)
 	install -D -m 644 ltp.pc $(DESTDIR)/$(PREFIX)/share/pkgconfig/ltp.pc
-
pan/Makefile +2 -0
Index: ltp-full-20090630/pan/Makefile
===================================================================
@@ -1,3 +1,5 @@
+TOPDIR=../
+include $(TOPDIR)/Makefile.include
 
 LOADLIBES += -lm
 LFLAGS += -l -w
testcases/kernel/containers/sysvipc/Makefile +6 -2
Index: ltp-full-20090630/testcases/kernel/containers/sysvipc/Makefile
===================================================================
@@ -1,6 +1,7 @@
 ################################################################################
 ##                                                                            ##
 ## Copyright (c) International Business Machines  Corp., 2007                 ##
+## Copyrignt (c) Cyril Hrubis [email protected] 2009                            ##
 ##                                                                            ##
 ## This program is free software;  you can redistribute it and#or modify      ##
 ## it under the terms of the GNU General Public License as published by       ##
@@ -18,8 +19,11 @@
 ##                                                                            ##
 ################################################################################
 
-CFLAGS += -I../../../../include -I../libclone -Wall
-LDLIBS += -L../../../../lib -L../libclone ../libclone/libclone.a -lltp
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS  += -I../libclone
+LDFLAGS += ../libclone/libclone.a $(TOPDIR)lib/libltp.a
 
 SRCS    := $(wildcard *.c)
 TARGETS := $(SRCS:%.c=%)
testcases/kernel/containers/libclone/Makefile +7 -11
Index: ltp-full-20090630/testcases/kernel/containers/libclone/Makefile
===================================================================
@@ -1,6 +1,7 @@
 ################################################################################
 ##                                                                            ##
 ## Copyright (c) International Business Machines  Corp., 2007                 ##
+## Copyrignt (c) Cyril Hrubis [email protected] 2009                            ##
 ##                                                                            ##
 ## This program is free software;  you can redistribute it and#or modify      ##
 ## it under the terms of the GNU General Public License as published by       ##
@@ -18,10 +19,8 @@
 ##                                                                            ##
 ################################################################################
 
-SRCS := $(wildcard *.c)
-OBJS := $(SRCS:%.c=%.o)
-
-CFLAGS += -I../../../../include
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
 
 HAS_UNSHARE ?= $(shell ../check_for_unshare && echo y)
 ifeq ($(HAS_UNSHARE),y)
@@ -30,16 +29,13 @@ else
 TARGET :=
 endif
 
+OBJS = libclone.o libnetns.o
+
 all: $(TARGET)
 
-libclone.a: $(OBJS)
-	$(AR) -cr $@ libclone.o
+libclone.a: libclone.o
 
-libnetns.a: $(OBJS)
-	$(AR) -cr $@ libnetns.o 
-#	$(AR) -cr $@ $^
+libnetns.a: libnetns.o
 
 clean:
 	rm -f $(TARGET) $(OBJS)
-
-install:
testcases/kernel/containers/mqns/Makefile +6 -3
Index: ltp-full-20090630/testcases/kernel/containers/mqns/Makefile
===================================================================
@@ -2,6 +2,7 @@
 ##                                                                            ##
 ## Copyright (c) International Business Machines  Corp., 2009                 ##
 ## Copyright (c) Nadia Derbey, 2009                                           ##
+## Copyrignt (c) Cyril Hrubis [email protected] 2009                            ##
 ##                                                                            ##
 ## This program is free software;  you can redistribute it and#or modify      ##
 ## it under the terms of the GNU General Public License as published by       ##
@@ -19,9 +20,11 @@
 ##                                                                            ##
 ################################################################################
 
-CFLAGS += -Wall
-CPPFLAGS += -I../../../../include -I../libclone
-LDLIBS += -L../../../../lib -L../libclone ../libclone/libclone.a -lltp -lrt
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS  += -I../libclone
+LDFLAGS += ../libclone/libclone.a $(TOPDIR)lib/libltp.a -lrt
 
 SRCS    := $(wildcard *.c)
 TARGETS := $(SRCS:%.c=%)
testcases/kernel/containers/netns/Makefile +7 -3
Index: ltp-full-20090630/testcases/kernel/containers/netns/Makefile
===================================================================
@@ -1,6 +1,7 @@
 ################################################################################
 ##                                                                            ##
 ## Copyright (c) International Business Machines  Corp., 2008                 ##
+## Copyrignt (c) Cyril Hrubis [email protected] 2009                            ##
 ##                                                                            ##
 ## This program is free software;  you can redistribute it and#or modify      ##
 ## it under the terms of the GNU General Public License as published by       ##
@@ -19,9 +20,12 @@
 ## Author:      Veerendra <[email protected]>                         ##
 ################################################################################
 
-CFLAGS += -Wall
-CPPFLAGS += -I../../../../include -I../libclone
-LDLIBS += -L../../../../lib -L../libclone ../libclone/libnetns.a -lltp
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS  += -I../libclone
+LDFLAGS += ../libclone/libnetns.a $(TOPDIR)lib/libltp.a
+
 SCRIPTS = initialize.sh parentns.sh childns.sh                  \
 parent.sh child.sh                                              \
 parent_view.sh parent_share.sh  child_propagate.sh              \
testcases/kernel/containers/pidns/Makefile +6 -3
Index: ltp-full-20090630/testcases/kernel/containers/pidns/Makefile
===================================================================
@@ -1,6 +1,7 @@
 ################################################################################
 ##                                                                            ##
 ## Copyright (c) International Business Machines  Corp., 2007                 ##
+## Copyrignt (c) Cyril Hrubis [email protected] 2009                            ##
 ##                                                                            ##
 ## This program is free software;  you can redistribute it and#or modify      ##
 ## it under the terms of the GNU General Public License as published by       ##
@@ -18,9 +19,11 @@
 ##                                                                            ##
 ################################################################################
 
-CFLAGS += -Wall
-CPPFLAGS += -I../../../../include -I../libclone
-LDLIBS += -L../../../../lib -L../libclone ../libclone/libclone.a -lltp -lrt
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS  += -I../libclone
+LDFLAGS += ../libclone/libclone.a $(TOPDIR)lib/libltp.a -lrt
 
 SRCS    := $(wildcard *.c)
 TARGETS := $(SRCS:%.c=%)
testcases/kernel/containers/utsname/Makefile +6 -3
Index: ltp-full-20090630/testcases/kernel/containers/utsname/Makefile
===================================================================
@@ -1,6 +1,7 @@
 ################################################################################
 ##                                                                            ##
 ## Copyright (c) International Business Machines  Corp., 2007                 ##
+## Copyrignt (c) Cyril Hrubis [email protected] 2009                            ##
 ##                                                                            ##
 ## This program is free software;  you can redistribute it and#or modify      ##
 ## it under the terms of the GNU General Public License as published by       ##
@@ -18,9 +19,11 @@
 ##                                                                            ##
 ################################################################################
 
-CFLAGS += -Wall
-CPPFLAGS += -I../../../../include -I../libclone
-LDLIBS += -L../../../../lib -L../libclone ../libclone/libclone.a -lltp
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS  += -I../libclone
+LDFLAGS += ../libclone/libclone.a $(TOPDIR)lib/libltp.a
 
 SRCS    := $(wildcard *.c)
 TARGETS := $(SRCS:%.c=%)
Makefile +9 -23
Index: ltp-full-20090630/Makefile
===================================================================
@@ -1,5 +1,9 @@
 # See toplevel INSTALL for build info
 
+SUBDIRS=pan lib testcases tools utils
+SUBDIRS_INSTALL=$(SUBDIRS) include m4 doc/man1 doc/man2
+include Makefile.include
+
 ifdef CROSS_COMPILE
 CROSS_COMPILER = $(CROSS_COMPILE)
 endif
@@ -17,33 +21,19 @@ export CC AR RANLIB CPPFLAGS LDFLAGS HAS
 -include config.mk
 
 VPATH += include m4
-all: config.h config.mk libltp.a 
-	@$(MAKE) -C pan $@
-	@$(MAKE) -C testcases $@
-	@$(MAKE) -C tools $@
-	@$(MAKE) -C utils $@
+
+
+all: config.h config.mk libltp.a $(SUBDIRS)
 	@echo
 	@echo "***********************************************"
 	@echo "** You now need to do a make install as root **"
 	@echo "***********************************************"
 
 install: all
-	@$(MAKE) -C testcases install
-	@$(MAKE) -C tools install
-	@$(MAKE) -C lib install
-	@$(MAKE) -C include install
-	@$(MAKE) -C pan install
-	@$(MAKE) -C m4 install
-	@$(MAKE) -C doc/man1 install
-	@$(MAKE) -C doc/man3 install
-
 	@./IDcheck.sh
 
-libltp.a: config.h
-	@$(MAKE) -C lib $@
-
 uclinux: uclinux_libltp.a
-	#@$(MAKE) -C pan all
+	@$(MAKE) -C pan all
 	@$(MAKE) -C testcases uclinux
 	@$(MAKE) -C tools all
 	@echo
@@ -63,11 +53,7 @@ menuconfig:
 	@./ltpmenu
 
 clean: ac-clean
-	@$(MAKE) -C lib $@
-	@$(MAKE) -C pan $@
-	@$(MAKE) -C tools $@
-	@$(MAKE) -C testcases $@
-	@$(MAKE) -C utils $@
+	$(call submake, $(SUBDIRS), clean)
 
 distclean: clean ac-distclean
 	@$(MAKE) -C include $@
testcases/kernel/connectors/pec/Makefile +4 -2
Index: ltp-full-20090630/testcases/kernel/connectors/pec/Makefile
===================================================================
@@ -1,5 +1,7 @@
-CFLAGS += -I../../../../include -Wall
-LDLIBS += -L../../../../lib -lltp
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+LDLIBS += $(TOPDIR)lib/libltp.a
 
 SRCS:=$(wildcard *.c)
 TARGETS:=$(patsubst %.c,%,$(SRCS))
testcases/kernel/controllers/cgroup/Makefile +2 -3
Index: ltp-full-20090630/testcases/kernel/controllers/cgroup/Makefile
===================================================================
@@ -1,6 +1,5 @@
-CFLAGS += -Wall
-CPPFLAGS += -I../../../../include -I../libcontrollers
-LDLIBS += -L../../../../lib/ -lltp
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
 
 SRCS    = $(wildcard *.c)
 
testcases/kernel/controllers/cpuctl/Makefile +5 -3
Index: ltp-full-20090630/testcases/kernel/controllers/cpuctl/Makefile
===================================================================
@@ -1,6 +1,8 @@
-CFLAGS += -Wall
-CPPFLAGS += -I../../../../include -I../libcontrollers
-LDLIBS += -lm -L../../../../lib/ -L../libcontrollers -lcontrollers -lltp
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS  += -I../libcontrollers
+LDFLAGS += ../libcontrollers/libcontrollers.a $(TOPDIR)lib/libltp.a -lm
 
 SRCS    = $(wildcard *.c)
 
testcases/kernel/controllers/cpuset/cpuset_lib/Makefile +16 -6
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_lib/Makefile
===================================================================
@@ -1,14 +1,24 @@
-CFLAGS += -Wall -g -Wextra
-CPPFLAGS += -I../../../../include
-LDLIBS += -lm -L../../../../lib/ -lcontrollers -lltp
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
+
+TOPDIR=../../../../../
+include $(TOPDIR)Makefile.include
+
+LDFLAGS += -lm
 
 SRCS=$(wildcard *.c)
-TARGETS=$(patsubst %.c,%.o,$(SRCS))
+OBJS=$(SRCS:.c=.o)
+TARGET=cpuset_lib.a
+
+all: $(TARGET)
 
-all: $(TARGETS)
+$(TARGET): $(OBJS)
 
 clean:
-	rm -f $(TARGETS)
+	rm -f $(TARGET) $(OBJS)
 
 install:
 	@set -e; \
testcases/kernel/controllers/cpuset/cpuset_syscall_test/Makefile +13 -5
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_syscall_test/Makefile
===================================================================
@@ -1,11 +1,19 @@
-SRCS = $(wildcard *.sh)
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-LIBSRCS=$(wildcard ../cpuset_lib/*.c)
-LIBOBJECTS=$(patsubst %.c,%.o,$(LIBSRCS))
+TOPDIR=../../../../../
+include $(TOPDIR)Makefile.include
 
-all:cpuset_syscall_test
+LOADLIBES = ../cpuset_lib/cpuset_lib.a
 
-cpuset_syscall_test: %: %.o $(LIBOBJECTS)
+SRC = $(wildcard *.sh)
+
+all: cpuset_syscall_test
+
+cpuset_syscall_test: cpuset_syscall_test.c
 
 clean:
 	rm -rf cpuset_syscall_test
testcases/kernel/controllers/freezer/Makefile +7 -6
Index: ltp-full-20090630/testcases/kernel/controllers/freezer/Makefile
===================================================================
@@ -1,5 +1,6 @@
 # Copyright (c) International Business Machines  Corp., 2008
 # Author: Matt Helsley <[email protected]>
+# Copyrignt (c) Cyril Hrubis [email protected] 2009
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -15,18 +16,18 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
-CFLAGS := -Wall -O3
-PROGS := timed_forkbomb #  vfork fork_exec_loop
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS += -O3
+PROGS = timed_forkbomb #  vfork fork_exec_loop
 
 .PHONY: all install clean
 
 all: $(PROGS)
-	chmod u+x *.sh
+	@chmod u+x *.sh
 
 install:
 
-$(PROGS): %: %.c
-	gcc $(CFLAGS) -o $@ $^
-
 clean:
 	rm -f $(PROGS)
testcases/kernel/controllers/io-throttle/Makefile +2 -3
Index: ltp-full-20090630/testcases/kernel/controllers/io-throttle/Makefile
===================================================================
@@ -1,6 +1,5 @@
-CFLAGS += -Wall
-CPPFLAGS += -I../../../../include -I../libcontrollers
-LDLIBS += -lm -L../../../../lib/ -L../libcontrollers -lcontrollers -lltp
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
 
 SRCS    = $(wildcard *.c)
 
testcases/kernel/controllers/libcontrollers/Makefile +4 -3
Index: ltp-full-20090630/testcases/kernel/controllers/libcontrollers/Makefile
===================================================================
@@ -1,3 +1,6 @@
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
 TARGET=libcontrollers.a
 SRCS=$(wildcard *.c)
 OBJS=$(patsubst %.c,%.o,$(SRCS))
@@ -5,11 +8,9 @@ OBJS=$(patsubst %.c,%.o,$(SRCS))
 all : $(TARGET)
 
 $(TARGET): $(OBJS)
-	$(AR) -cr $@ $^
 
 clean:
 	rm -f $(TARGET) $(OBJS)
 
 install:
-
-
+	@true
testcases/kernel/controllers/memctl/Makefile +5 -3
Index: ltp-full-20090630/testcases/kernel/controllers/memctl/Makefile
===================================================================
@@ -1,6 +1,8 @@
-CFLAGS += -Wall
-CPPFLAGS += -I../../../../include -I../libcontrollers
-LDLIBS += -lm -L../../../../lib/ -L../libcontrollers -lcontrollers -lltp
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS  += -I../libcontrollers
+LDFLAGS += ../libcontrollers/libcontrollers.a $(TOPDIR)lib/libltp.a -lm
 
 SRCS    = $(wildcard *.c)
 
testcases/kernel/containers/Makefile +12 -7
Index: ltp-full-20090630/testcases/kernel/containers/Makefile
===================================================================
@@ -1,6 +1,7 @@
 ################################################################################
 ##                                                                            ##
 ## Copyright (c) International Business Machines  Corp., 2007                 ##
+## Copyrignt (c) Cyril Hrubis [email protected] 2009                            ##
 ##                                                                            ##
 ## This program is free software;  you can redistribute it and#or modify      ##
 ## it under the terms of the GNU General Public License as published by       ##
@@ -18,20 +19,24 @@
 ##                                                                            ##
 ################################################################################
 
-SUBDIRS := libclone utsname sysvipc pidns netns mqns
+SUBDIRS=libclone utsname sysvipc pidns netns mqns
+SUBDIRS_INSTALL=utsname sysvipc pidns netns mqns
+TOPDIR=../../../
+include $(TOPDIR)Makefile.include
+LDFLAGS+=-rdynamic -ldl
 
-all: check_for_unshare
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
+all:
+	$(call print_warn, check_for_unshare is compiled the same way as the rest of ltp this will broke crosscompilation)
 
-check_for_unshare: check_for_unshare.c
-	$(CC) $(CFLAGS) -rdynamic -o $@ $< ../../../lib/tst_kvercmp.c -I../../../include -ldl
+$(SUBDIRS): check_for_unshare
+
+#check_for_unshare: check_for_unshare.c
+#	$(CC) $(CFLAGS) -rdynamic -o $@ $< -ldl
 
 install: check_for_unshare
 	@set -e; ln -f check_for_unshare ../../bin/check_for_unshare; \
 	ln -f container_test.sh ../../bin/container_test.sh; \
-	for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done; \
 	chmod ugo+x container_test.sh
 
 clean:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done
 	rm -f check_for_unshare
testcases/kernel/fs/Makefile +9 -11
Index: ltp-full-20090630/testcases/kernel/fs/Makefile
===================================================================
@@ -1,12 +1,10 @@
-SUBDIRS = acls doio fs_inod fsstress fs_perms fsx-linux ftest inode lftest linktest openfile proc stream fs_di fs_bind racer quota_remount
-
-all:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
-
-install:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done
-
-clean:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done
-
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
+SUBDIRS=acls doio fsstress fs_perms fsx-linux ftest inode lftest openfile proc stream fs_di fs_bind
+SUBDIRS_INSTALL=acls doio fs_inod fsstress fs_perms fsx-linux ftest inode lftest linktest openfile proc stream fs_di fs_bind racer quota_remount
+TOPDIR=../../../
+include $(TOPDIR)Makefile.include
testcases/kernel/fs/acls/Makefile +3 -5
Index: ltp-full-20090630/testcases/kernel/fs/acls/Makefile
===================================================================
@@ -1,3 +1,6 @@
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
 check_header = $(shell \
 	if echo "\#include <$(1)>" | $(CC) -E - > /dev/null 2>&1 ; \
 	then echo yes ; \
@@ -11,11 +14,6 @@ endif
 
 all: $(TARGETS)
 
-acl_file_test: acl_file_test.c
-	$(CC) $(CFLAGS) $(LDFLAGS) -o acl_file_test acl_file_test.c
-acl_link_test: acl_link_test.c
-	$(CC) $(CFLAGS) $(LDFLAGS) -o acl_link_test acl_link_test.c
-
 install:
 	chmod 755 acl_test01
 	@set -e; for i in $(TARGETS) acl_test01 ; do ln -f $$i ../../../bin/ ; done
testcases/kernel/fs/doio/Makefile +11 -12
Index: ltp-full-20090630/testcases/kernel/fs/doio/Makefile
===================================================================
@@ -1,6 +1,14 @@
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-CFLAGS+= -Wall -I../../../../include -D_LARGEFILE64_SOURCE
-LDLIBS+= -L../../../../lib -lltp -lrt -lpthread
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS  += -D_LARGEFILE64_SOURCE
+LDFLAGS += $(TOPDIR)lib/libltp.a -lrt -lpthread
 
 TARGETS=doio growfiles rwtest iogen
 SRCS=$(wildcard *.c)
@@ -8,15 +16,6 @@ OBJS=$(patsubst %.c,%.o,$(SRCS))
 
 all: $(TARGETS)
 
-doio: doio.o
-		 $(CC) -o $@ $^ -I. $(CFLAGS) $(LDFLAGS) $(LDLIBS)
-
-growfiles: growfiles.o
-		 $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LDLIBS)
-
-iogen: iogen.o
-		 $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LDLIBS)
-
 rwtest: rwtest.sh doio iogen
 	cp rwtest.sh rwtest
 	chmod a+rx rwtest
@@ -25,4 +24,4 @@ install:
 	@set -e; for i in $(TARGETS) ; do ln -f $$i ../../../bin/$$i ; done ;
 
 clean:
-	rm -f $(OBJS) $(TARGETS)
+	rm -f $(TARGETS)
testcases/Makefile +11 -15
Index: ltp-full-20090630/testcases/Makefile
===================================================================
@@ -1,21 +1,17 @@
-	SUBDIRS = `ls */Makefile | sed "s/Makefile//g" | grep -v open | grep -v pounder | grep -v DOTS | grep -v kdump | grep -v realtime | grep -v audit-test` 
-UCLINUX_SUBDIRS = kernel
-all:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-install:
-	mkdir -p bin
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done
-
-uclinux:
-	@set -e; for i in $(UCLINUX_SUBDIRS); do $(MAKE) -C $$i uclinux; done
+SUBDIRS=ballista commands kernel misc network
+SUBDIRS_INSTALL=ballista commands kernel misc network
+SUBDIRS_UCLINUX=kernel
+TOPDIR=../
+include $(TOPDIR)Makefile.include
 
-uclinux_install:
+install:
 	mkdir -p bin
-	@set -e; for i in $(UCLINUX_SUBDIRS); \
-		do $(MAKE) -C $$i uclinux_install ; done
 
 clean:
 	rm -rf bin/
-	@set -e; for i in $(SUBDIRS) ; do $(MAKE) -C $$i clean ; done
-
testcases/ballista/ballista/Makefile +11 -52

91 lines not on this page · raw message

testcases/commands/Makefile +9 -11
Index: ltp-full-20090630/testcases/commands/Makefile
===================================================================
@@ -1,12 +1,10 @@
-#SUBDIRS = `ls */Makefile | sed "s/Makefile//g" | grep -v at | grep -v unzip`
-SUBDIRS = `ls */Makefile | sed "s/Makefile//g"`
-
-all:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
-
-install:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done
-
-clean:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
+SUBDIRS=ade cron eject unzip
+SUBDIRS_INSTALL=ade at cpio cron eject fileutils gzip logrotate mail su tar tpm-tools unzip
+TOPDIR=../../
+include $(TOPDIR)Makefile.include
testcases/commands/ade/Makefile +9 -9
Index: ltp-full-20090630/testcases/commands/ade/Makefile
===================================================================
@@ -1,10 +1,10 @@
-SUBDIRS = ar objdump size ld ldd nm file
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-all:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
-
-install:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done
-
-clean:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done
+SUBDIRS=ar objdump size ld ldd nm
+SUBDIRS_INSTALL=ar objdump size ld ldd nm file
+TOPDIR=../../../
+include $(TOPDIR)Makefile.include
testcases/commands/ade/ldd/Makefile +4 -1
Index: ltp-full-20090630/testcases/commands/ade/ldd/Makefile
===================================================================
@@ -1,4 +1,7 @@
-CFLAGS += -c -O -fpic
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS += -O -fpic
 LDFLAGS += 
 
 SRCS:=$(wildcard *.c)
testcases/commands/ade/nm/Makefile +4 -2
Index: ltp-full-20090630/testcases/commands/ade/nm/Makefile
===================================================================
@@ -1,5 +1,7 @@
-CFLAGS += -O -Wall
-LOADLIBES += 
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS += -O
 
 SRCS=$(wildcard *.c)
 OBJECTS=$(patsubst %.c,%.o,$(SRCS))
testcases/commands/ade/objdump/Makefile +26 -11
Index: ltp-full-20090630/testcases/commands/ade/objdump/Makefile
===================================================================
@@ -1,10 +1,25 @@
-CFLAGS += -w -o
-LDFLAGS +=
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
+
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+TARGETS=test test_arch.o test_D
+
+all: $(TARGETS)
+
+#
+# Create symlinks so make can use default rules
+#
+test_arch.c:
+	@if [ -e test_arch.c ]; then true; else ln -s test.c test_arch.c; fi
 
-SRCS=$(wildcard *.c)
-TESTS= test test_arch.o test_D
+test_D.c:
+	@if [ -e test_D.c ]; then true; else ln -s test.c test_D.c; fi
 
-all: $(TESTS)
 
 install:
 	ln -f objdump01 ../../../bin
@@ -12,11 +27,11 @@ install:
 	ln -f test ../../../bin
 	ln -f test_D ../../../bin
 
+#
+# Extra flags for test binary, I'm not sure why, but
+# it was in previous Makefile.
+#
+test: CFLAGS+=-O
 
 clean:
-	rm -f $(TESTS)
-
-$(TESTS): 
-	$(CC) -O $(CFLAGS) $(cflags) test $(LDFLAGS) ./test.c
-	$(CC) -c $(CFLAGS) $(cflags) test_arch.o ./test.c
-	$(CC) $(CFLAGS) $(cflags) test_D $(LDFLAGS) ./test.c
+	rm -f $(TARGETS) test_arch.c test_D.c
testcases/commands/ade/size/Makefile +3 -0
Index: ltp-full-20090630/testcases/commands/ade/size/Makefile
===================================================================
@@ -1,3 +1,6 @@
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
 CFLAGS += -w -O
 LDFLAGS += 
 
testcases/commands/cron/Makefile +3 -3
Index: ltp-full-20090630/testcases/commands/cron/Makefile
===================================================================
@@ -1,7 +1,7 @@
-all: cron_dirs_check
+TOPDIR=../../../
+include $(TOPDIR)Makefile.include
 
-cron_dirs_check:
-	$(CC) $(CROSS_CFLAGS) $(LDFLAGS) -o cron_dirs_check cron_dirs_check.c
+all: cron_dirs_check
 
 install:
 	chmod 755 cron_tests.sh
testcases/commands/eject/Makefile +2 -2
Index: ltp-full-20090630/testcases/commands/eject/Makefile
===================================================================
@@ -1,5 +1,5 @@
-CFLAGS+=    -I../../../include -Wall
-LOADLIBES+= -L../../../lib
+TOPDIR=../../../
+include $(TOPDIR)Makefile.include
 
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
testcases/commands/unzip/Makefile +1 -1
Index: ltp-full-20090630/testcases/commands/unzip/Makefile
===================================================================
@@ -17,7 +17,7 @@ tst_unzip_file.zip: tst_unzip.dir
 # This target should be auto-removed by Make
 .INTERMEDIATE: tst_unzip.dir
 tst_unzip.dir: unzip_genfile.sh
-	./unzip_genfile.sh tst_unzip.dir
+	@./unzip_genfile.sh tst_unzip.dir
 
 install: all
 	@set -e; for i in $(BINS); do \
testcases/kernel/Makefile +9 -15
Index: ltp-full-20090630/testcases/kernel/Makefile
===================================================================
@@ -1,17 +1,11 @@
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
+
 SUBDIRS = power_management numa containers controllers connectors include fs io ipc mem pty sched security syscalls timers
+SUBDIRS_INSTALL=$(SUBDIRS)
 UCLINUX_SUBDIRS = include syscalls
-
-all:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
-
-install:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done
-
-uclinux:
-	@set -e; for i in $(UCLINUX_SUBDIRS); do $(MAKE) -C $$i uclinux ; done
-
-uclinux_install:
-	@set -e; for i in $(UCLINUX_SUBDIRS); do $(MAKE) -C $$i uclinux_install ; done
-
-clean:
-	@set -e; for i in $(SUBDIRS) timers; do $(MAKE) -C $$i clean ; done
+TOPDIR=../../
+include $(TOPDIR)Makefile.include
testcases/kernel/power_management/Makefile +5 -7
Index: ltp-full-20090630/testcases/kernel/power_management/Makefile
===================================================================
@@ -1,6 +1,7 @@
 ################################################################################
 ##                                                                            ##
 ## Copyright (c) International Business Machines  Corp., 2008                 ##
+## Copyrignt (c) Cyril Hrubis [email protected] 2009                            ##
 ##                                                                            ##
 ## This program is free software;  you can redistribute it and#or modify      ##
 ## it under the terms of the GNU General Public License as published by       ##
@@ -18,14 +19,12 @@
 ##                                                                            ##
 ################################################################################
 
-SUBDIRS := 
+TOPDIR=../../../
+include $(TOPDIR)Makefile.include
 
-all: 
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done;
-	$(MAKE) check_kv_arch ;
+LDFLAGS += $(TOPDIR)lib/libltp.a
 
-check_kv_arch: check_kv_arch.c
-	$(CC) -o $@ $< ../../../lib/tst_kvercmp.c -I../../../include
+all: check_kv_arch
 
 install:
 	@set -e; ln -f check_kv_arch ../../bin/check_kv_arch; \
@@ -45,6 +44,5 @@ install:
 	ln -f  sched_domain.py ../../bin/sched_domain.py
 	chmod ugo+x *.sh
 clean:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ; done
 	rm -f check_kv_arch
 
testcases/kernel/fs/fs_perms/Makefile +4 -4
Index: ltp-full-20090630/testcases/kernel/fs/fs_perms/Makefile
===================================================================
@@ -1,7 +1,7 @@
-CFLAGS += -Wall
-CPPFLAGS += -I../../../../include
-LDLIBS += -lltp
-LDFLAGS += -L../../../../lib
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+LDFLAGS=$(TOPDIR)lib/libltp.a
 
 TARGETS = fs_perms testx
 
testcases/kernel/fs/fsstress/Makefile +4 -2
Index: ltp-full-20090630/testcases/kernel/fs/fsstress/Makefile
===================================================================
@@ -1,5 +1,7 @@
-CFLAGS += -Wall -g -DNO_XFS -I. -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
-LDFLAGS += 
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS += -DNO_XFS -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
 
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
testcases/kernel/fs/fsx-linux/Makefile +3 -1
Index: ltp-full-20090630/testcases/kernel/fs/fsx-linux/Makefile
===================================================================
@@ -1,5 +1,7 @@
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
 CFLAGS += -w -O
-LDFLAGS += 
 
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
testcases/kernel/numa/Makefile +6 -3
Index: ltp-full-20090630/testcases/kernel/numa/Makefile
===================================================================
@@ -1,5 +1,6 @@
 #
 #  Copyright (c) International Business Machines  Corp., 2007
+#  Copyrignt (c) Cyril Hrubis [email protected] 2009
 #
 #  This program is free software;  you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -16,12 +17,14 @@
 #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 
-CFLAGS += -I../../../include -Wall -DNUMA_VERSION1_COMPATIBILITY
+TOPDIR=../../../
+include $(TOPDIR)Makefile.include
 
-LDLIBS += -L../../../lib -lltp 
+CFLAGS += -DNUMA_VERSION1_COMPATIBILITY
+LDFLAGS += $(TOPDIR)lib/libltp.a
 
 ifeq ($(HAS_NUMA),yes)    #its a numa machine
-LDLIBS += -L../../../lib  -lnuma
+LDFLAGS += -lnuma
 SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS))
 else                                    #its not a numa machine
testcases/kernel/fs/inode/Makefile +6 -2
Index: ltp-full-20090630/testcases/kernel/fs/inode/Makefile
===================================================================
@@ -1,5 +1,6 @@
 #
 #  Copyright (c) International Business Machines  Corp., 2001
+#  Copyright (c) Cyril Hrubis [email protected] 2009
 #
 #  This program is free software;  you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -16,11 +17,14 @@
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
 ###########################################################################
 # name of file	: Makefile						  #
 ###########################################################################
-CFLAGS+=	-I../../../../include -g -O -Wall -DLINUX
-LOADLIBES+=	-L../../../../lib -lltp 
+CFLAGS += -O -DLINUX
+LDFLAGS+= $(TOPDIR)lib/libltp.a
 
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
testcases/kernel/fs/lftest/Makefile +3 -0
Index: ltp-full-20090630/testcases/kernel/fs/lftest/Makefile
===================================================================
@@ -1,3 +1,6 @@
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
 CFLAGS+= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
testcases/kernel/fs/fs_di/Makefile +4 -1
Index: ltp-full-20090630/testcases/kernel/fs/fs_di/Makefile
===================================================================
@@ -1,4 +1,7 @@
-CFLAGS+= -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS+=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
 
testcases/kernel/fs/stream/Makefile +6 -2
Index: ltp-full-20090630/testcases/kernel/fs/stream/Makefile
===================================================================
@@ -1,5 +1,6 @@
 #
 #  Copyright (c) International Business Machines  Corp., 2001
+#  Copyright (c) Cyril Hrubis [email protected] 2009
 #
 #  This program is free software;  you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -16,12 +17,15 @@
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
 ###########################################################################
 # name of file	: Makefile						  #
 # description	: make(1) description file for the send(2) tests.	  #
 ###########################################################################
-CFLAGS+=	-I../../../../include -Wall -g
-LOADLIBES+=	-L../../../../lib -lltp
+
+LDFLAGS+= $(TOPDIR)lib/libltp.a
 
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
testcases/kernel/fs/fs_bind/Makefile +12 -8
Index: ltp-full-20090630/testcases/kernel/fs/fs_bind/Makefile
===================================================================
@@ -1,11 +1,15 @@
-# Propagate make "commands" (TARGETS) to subdirs
-TARGETS=all clean install uninstall
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
+
 SUBDIRS=bin
+SUBDIRS_INSTALL=bin
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
 
-.PHONY: $(TARGETS)
+$(SUBDIRS): do_warning
 
-$(TARGETS):%:
-	@set -e ; \
-	for dir in $(SUBDIRS); do \
-		$(MAKE) -C $$dir $@ ; \
-	done
+do_warning:
+	$(call print_warn, testcases/fs/fs_bind/ directory contains tests that are newer installed)
testcases/kernel/fs/fs_bind/bin/Makefile +10 -18
Index: ltp-full-20090630/testcases/kernel/fs/fs_bind/bin/Makefile
===================================================================
@@ -1,28 +1,20 @@
-.PHONY: all clean install
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-LTP_SRC_ROOT=../../../../..
-LTP_BIN=$(LTP_SRC_ROOT)/testcases/bin
-#CFLAGS+= -I$(LTP_SRC_ROOT)/include -Wall -g
-CFLAGS+= -Wall -g
-#LIBS+= -L$(LTP_SRC_ROOT)/lib -lltp
-LIBS+=
+TOPDIR=../../../../../
+include $(TOPDIR)Makefile.include
+
+LTP_BIN=$(TOPDIR)/testcases/bin
 
 all: smount nsclone
+	$(call print_warn, for some reason install target is commented; so this test is effectively disabled)
 
 install: all
 	#@ln -f nsclone $(LTP_BIN)/nsclone
 	#@ln -f smount $(LTP_BIN)/smount
-	@/bin/true
-
-uninstall:
-	#rm -f $(LTP_BIN)/nsclone $(LTP_BIN)/smount
-	@/bin/true
-
-nsclone: nsclone.c
-	$(CC) $(CFLAGS) $(LIBS) -o nsclone nsclone.c
-
-smount: smount.c
-	$(CC) $(CFLAGS) $(LIBS) -o smount smount.c
 
 clean:
 	rm -f smount nsclone
testcases/kernel/fs/openfile/Makefile +3 -1
Index: ltp-full-20090630/testcases/kernel/fs/openfile/Makefile
===================================================================
@@ -1,4 +1,6 @@
-CFLAGS += -Wall
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
 LOADLIBES += -lpthread
 
 SRCS=$(wildcard *.c)
testcases/kernel/fs/proc/Makefile +5 -2
Index: ltp-full-20090630/testcases/kernel/fs/proc/Makefile
===================================================================
@@ -1,5 +1,6 @@
 #
 #  Copyright (c) International Business Machines  Corp., 2001
+#  Copyright (c) Cyril Hrubis [email protected] 2009
 #
 #  This program is free software;  you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -16,10 +17,12 @@
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
 include ../../../../config.mk
 
-CFLAGS+=	-I../../../../include
-LDLIBS+=	-L../../../../lib -lltp $(SELINUX_LIBS)
+LDFLAGS += $(SELINUX_LIBS) $(TOPDIR)lib/libltp.a
 
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
testcases/kernel/io/Makefile +9 -9
Index: ltp-full-20090630/testcases/kernel/io/Makefile
===================================================================
@@ -1,10 +1,10 @@
-SUBDIRS = direct_io disktest stress_cd stress_floppy writetest aio
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-all:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
-
-install:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done
-
-clean:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done
+SUBDIRS=direct_io disktest stress_cd stress_floppy writetest aio
+SUBDIRS_INSTALL=$(SUBDIRS)
+TOPDIR=../../../
+include $(TOPDIR)Makefile.include
testcases/kernel/io/direct_io/Makefile +10 -42

65 lines not on this page · raw message

testcases/kernel/io/disktest/Makefile +8 -139

168 lines not on this page · raw message

testcases/kernel/io/disktest/disktest.c new file +509 -0

509 lines not on this page · raw message

testcases/kernel/io/disktest/main.c deleted +0 -509

509 lines not on this page · raw message

testcases/kernel/controllers/cpuset/Makefile +23 -13
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/Makefile
===================================================================
@@ -1,17 +1,27 @@
-SUBDIRS = cpuset_base_ops_test cpuset_lib cpuset_inherit_test
-SUBDIRS += cpuset_exclusive_test cpuset_hierarchy_test cpuset_syscall_test
-SUBDIRS += cpuset_hotplug_test cpuset_load_balance_test
-SUBDIRS += cpuset_memory_pressure_test cpuset_memory_spread_test
-SUBDIRS += cpuset_memory_test
-all:
-	@set -e; \
-	for i in $(SUBDIRS); do $(MAKE) -C $$i $@ ;done;
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
+
+#SUBDIRS = cpuset_base_ops_test cpuset_lib cpuset_inherit_test
+#SUBDIRS += cpuset_exclusive_test cpuset_hierarchy_test cpuset_syscall_test
+#SUBDIRS += cpuset_hotplug_test cpuset_load_balance_test
+#SUBDIRS += cpuset_memory_pressure_test cpuset_memory_spread_test
+#SUBDIRS += cpuset_memory_test
+
+DIRS=cpuset_hotplug_test cpuset_load_balance_test cpuset_memory_test
+SUBDIRS=cpuset_lib $(DIRS) cpuset_memory_pressure_test cpuset_memory_spread_test
+SUBDIRS_INSTALL=$(SUBDIRS) cpuset_base_ops_test cpuset_exclusive_test cpuset_hierarchy_test cpuset_inherit_test
+
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+#
+# Some tests depends on cpuset_lib library, this fixes fails under "make -jN" for N > 2
+#
+$(DIRS): cpuset_lib
 
 install:
-	@set -e; \
-	for i in $(SUBDIRS); do $(MAKE) -C $$i install ; done;
 	ln -f run_cpuset_test.sh ../../../bin/run_cpuset_test.sh;
 	chmod +x run_cpuset_test.sh;
-
-clean:
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean ; done
testcases/commands/ade/ld/Makefile +10 -2
Index: ltp-full-20090630/testcases/commands/ade/ld/Makefile
===================================================================
@@ -1,5 +1,13 @@
-CFLAGS += -O -Wall -fPIC
-LOADLIBES += 
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
+
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS += -O -fPIC
 
 SRCS=$(wildcard *.c)
 OBJECTS=$(patsubst %.c,%.o,$(SRCS))
testcases/commands/ade/ar/Makefile +10 -5
Index: ltp-full-20090630/testcases/commands/ade/ar/Makefile
===================================================================
@@ -1,5 +1,13 @@
-CFLAGS += -w -O
-LDFLAGS += 
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
+
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
+
+CFLAGS += -O
 
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
@@ -11,9 +19,6 @@ install:
 	ln -f file*.in ../../../bin
 	ln -f file1.o ../../../bin
 
-$(TARGETS):
-	$(CC) -o $@ [email protected] $(CFLAGS) $(LDFLAGS)
-
 clean:
 	rm -f $(TARGETS) file1.o
 
testcases/kernel/controllers/cpuset/cpuset_base_ops_test/Makefile +6 -6
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_base_ops_test/Makefile
===================================================================
@@ -1,10 +1,10 @@
-SRCS = $(wildcard *.sh)
-
-all:
-	@true
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-clean:
-	@true
+SRCS = $(wildcard *.sh)
 
 install:
 	@set -e; \
testcases/kernel/controllers/cpuset/cpuset_exclusive_test/Makefile +6 -6
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_exclusive_test/Makefile
===================================================================
@@ -1,10 +1,10 @@
-SRCS = $(wildcard *.sh)
-
-all:
-	@true
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-clean:
-	@true
+SRCS = $(wildcard *.sh)
 
 install:
 	@set -e; \
testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/Makefile +6 -6
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/Makefile
===================================================================
@@ -1,10 +1,10 @@
-SRCS = $(wildcard *.sh)
-
-all:
-	@true
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-clean:
-	@true
+SRCS = $(wildcard *.sh)
 
 install:
 	@set -e; \
testcases/kernel/controllers/cpuset/cpuset_hotplug_test/Makefile +12 -9
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/Makefile
===================================================================
@@ -1,19 +1,22 @@
-CFLAGS += -Wall -g -Wextra
-LDLIBS := -lm
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-LIBSRCS=$(wildcard ../cpuset_lib/*.c)
-LIBOBJECTS=$(patsubst %.c,%.o,$(LIBSRCS))
+TOPDIR=../../../../../
+include $(TOPDIR)Makefile.include
+
+LDFLAGS += -lm
+LOADLIBES = ../cpuset_lib/cpuset_lib.a
 
 SRCS=$(wildcard *.c)
-OBJECTS=$(patsubst %.c,%.o,$(SRCS))
-TARGETS=$(patsubst %.c,%,$(SRCS))
+TARGETS=$(SRCS:.c=)
 
 all: $(TARGETS)
 
-$(TARGETS): %: %.o $(LIBOBJECTS)
-
 clean:
-	rm -f $(TARGETS) $(OBJECTS) $(LIBOBJECTS)
+	rm -f $(TARGETS)
 
 install:
 	@set -e; \
testcases/kernel/controllers/cpuset/cpuset_inherit_test/Makefile +6 -6
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_inherit_test/Makefile
===================================================================
@@ -1,10 +1,10 @@
-SRCS = $(wildcard *.sh)
-
-all:
-	@true
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-clean:
-	@true
+SRCS = $(wildcard *.sh)
 
 install:
 	@set -e; \
testcases/kernel/controllers/cpuset/cpuset_load_balance_test/Makefile +12 -9
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_load_balance_test/Makefile
===================================================================
@@ -1,19 +1,22 @@
-CFLAGS += -Wall -g -Wextra
-LDLIBS := -lm
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-LIBSRCS=$(wildcard ../cpuset_lib/*.c)
-LIBOBJECTS=$(patsubst %.c,%.o,$(LIBSRCS))
+TOPDIR=../../../../../
+include $(TOPDIR)Makefile.include
+
+LDFLAGS += -lm
+LOADLIBES = ../cpuset_lib/cpuset_lib.a
 
 SRCS=$(wildcard *.c)
-OBJECTS=$(patsubst %.c,%.o,$(SRCS))
-TARGETS=$(patsubst %.c,%,$(SRCS))
+TARGETS=$(SRCS:.c=)
 
 all: $(TARGETS)
 
-$(TARGETS): %: %.o $(LIBOBJECTS)
-
 clean:
-	rm -f $(TARGETS) $(OBJECTS) $(LIBOBJECTS)
+	rm -f $(TARGETS) $(OBJECTS)
 
 install:
 	@set -e; \
testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/Makefile +9 -5
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/Makefile
===================================================================
@@ -1,12 +1,16 @@
-CFLAGS += -Wall -g -Wextra
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-all: cpuset_memory_pressure
+TOPDIR=../../../../../
+include $(TOPDIR)Makefile.include
 
-cpuset_memory_pressure: cpuset_memory_pressure.o
-	cc cpuset_memory_pressure.o -o cpuset_memory_pressure
+all: cpuset_memory_pressure
 
 clean:
-	rm -f cpuset_memory_pressure.o cpuset_memory_pressure
+	rm -f cpuset_memory_pressure
 
 install:
 	@set -e;
testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/Makefile +9 -5
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/Makefile
===================================================================
@@ -1,12 +1,16 @@
-CFLAGS += -Wall -g -Wextra
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-all: cpuset_mem_hog
+TOPDIR=../../../../../
+include $(TOPDIR)Makefile.include
 
-cpuset_mem_hog: cpuset_mem_hog.o
-	cc cpuset_mem_hog.o -o cpuset_mem_hog
+all: cpuset_mem_hog
 
 clean:
-	rm -f cpuset_mem_hog.o cpuset_mem_hog
+	rm -f cpuset_mem_hog
 
 install:
 	@set -e;
testcases/kernel/controllers/cpuset/cpuset_memory_test/Makefile +11 -8
Index: ltp-full-20090630/testcases/kernel/controllers/cpuset/cpuset_memory_test/Makefile
===================================================================
@@ -1,16 +1,19 @@
-CFLAGS += -Wall -g -Wextra
+#
+# Copyright (c) 2009 Cyril Hrubis [email protected]
+#
+# Distributed under GPLv2 or any later
+#
 
-LIBSRCS=$(wildcard ../cpuset_lib/*.c)
-LIBOBJECTS=$(patsubst %.c,%.o,$(LIBSRCS))
+TOPDIR=../../../../../
+include $(TOPDIR)Makefile.include
 
-all: cpuset_memory_test
+LOADLIBES = ../cpuset_lib/cpuset_lib.a
+LDFLAGS = -lpthread
 
-cpuset_memory_test: cpuset_memory_test.o $(LIBOBJECTS)
-	cc cpuset_memory_test.o $(LIBOBJECTS) -o cpuset_memory_test -lpthread
+all: cpuset_memory_test
 
 clean:
-	rm -f cpuset_memory_test cpuset_memory_test.o
-	rm -f $(LIBOBJECTS)
+	rm -f cpuset_memory_test
 
 install:
 	@set -e;
testcases/kernel/fs/ftest/Makefile +5 -8
Index: ltp-full-20090630/testcases/kernel/fs/ftest/Makefile
===================================================================
@@ -1,6 +1,8 @@
 #
 #  Copyright (c) International Business Machines  Corp., 2001
 #
+#  Copyright (c) 2009 Cyril Hrubis [email protected]
+#
 #  This program is free software;  you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
 #  the Free Software Foundation; either version 2 of the License, or
@@ -16,15 +18,12 @@
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-###########################################################################
-# name of file	: Makefile						  #
-# description	: make(1) description file for the send(2) tests.	  #
-###########################################################################
-CFLAGS+=	-I../../../../include -Wall -g
-LOADLIBES+=	-L../../../../lib -lltp
+TOPDIR=../../../../
+include $(TOPDIR)Makefile.include
 
 SRCS=$(wildcard *.c)
 TARGETS=$(patsubst %.c,%,$(SRCS))
+LOADLIBES=$(TOPDIR)lib/libltp.a
 
 all: $(TARGETS)
 
@@ -33,5 +32,3 @@ install:
 
 clean:
 	rm -f $(TARGETS)
-
-

------------------------------------------------------------------------------

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi!

Quoted 5 lines

This is what I have to do over the following month (along with a
coworker) at Cisco because we have to migrate and this time we're going to contribute back the changes. Please join in if you have the resources and the time. LTP is huge and the quicker we can chip away at the required work, the better.

This is exactly the reason why I have send nonfinished and partially broken patch here. LTP is too big for one person and you know everybody has sometimes silly thoughts about something being good for everybody. I'm glad it raised disscusion here. I'll try to create new patch this week.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#3 lore raw
In reply to a message not in the archive

Hi!
I've seen quite a progress on ltp mailing list. What's the current state? I'm back here and would like to help. (There is quite a lot of patches and I'm too lazy to apply them all).

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Hi!

Quoted 2 lines

runltp was also looking for ltp-pan in the wrong spot (the build
tree) instead of the install root, so that needs to be fixed too.

Well that's IMHO because it's intended to be executed from buildroot. I have patch for that. I'll send it ASAP to ltp mailing list.

Signature · 12 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list