kbuild: add klibc/tests to kbuild Add a kbuild file so we now can build the test programs. A new dedicated target is used: make test Signed-off-by: Sam Ravnborg <sam@ravnborg.org> --- commit 5492ae07007399d8838dea5f44b3d9cf3603abc3 tree 4339d2d3aa0e80bc81ac0cd8ca3b7c89486b2150 parent 64dda666c087b6e537892ac9984aff57d2b32c47 author Sam Ravnborg <sam@mars.(none)> Sun, 07 Aug 2005 22:53:42 +0200 committer Sam Ravnborg <sam@mars.(none)> Sun, 07 Aug 2005 22:53:42 +0200 Kbuild | 2 +- Makefile | 3 +++ klibc/tests/Kbuild | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletions(-) diff --git a/Kbuild b/Kbuild --- a/Kbuild +++ b/Kbuild @@ -14,4 +14,4 @@ $(obj)/all: # Directories to visit during clean and install -subdir- := scripts/basic klcc klibc ash utils gzip usr/kinit +subdir- := scripts/basic klcc klibc ash utils gzip usr/kinit klibc/tests diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -86,6 +86,9 @@ klcc: klibc: $(Q)$(MAKE) $(klibc)=. +test: klibc + $(Q)$(MAKE) $(klibc)=klibc/tests + clean: $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.clean obj=. diff --git a/klibc/tests/Kbuild b/klibc/tests/Kbuild new file mode 100644 --- /dev/null +++ b/klibc/tests/Kbuild @@ -0,0 +1,43 @@ +# +# Kbuild file for all test files +# + +test-files := $(wildcard $(srctree)/$(src)/*.c) +test-files := $(notdir $(test-files)) + +# This particular file uses a bunch of formats gcc don't know of, in order +# to test the full range of our vsnprintf() function. This outputs a bunch +# of useless warnings unless we tell it not to. +KLIBCCFLAGS_testvsnp.o := -Wno-format + +static-y := $(test-files:.c=) +shared-y := $(addsuffix .shared, $(static-y)) + +environ.shared-y := environ.o +fcntl.shared-y := fcntl.o +getopttest.shared-y := getopttest.o +getpagesize.shared-y := getpagesize.o +hello.shared-y := hello.o +idtest.shared-y := idtest.o +malloctest.shared-y := malloctest.o +malloctest2.shared-y := malloctest2.o +memstrtest.shared-y := memstrtest.o +microhello.shared-y := microhello.o +minihello.shared-y := minihello.o +mmaptest.shared-y := mmaptest.o +nfs_no_rpc.shared-y := nfs_no_rpc.o +opentest.shared-y := opentest.o +rtsig.shared-y := rtsig.o +setenvtest.shared-y := setenvtest.o +setjmptest.shared-y := setjmptest.o +sigint.shared-y := sigint.o +stat.shared-y := stat.o +statfs.shared-y := statfs.o +strlcpycat.shared-y := strlcpycat.o +strtoimax.shared-y := strtoimax.o +strtotime.shared-y := strtotime.o +testrand48.shared-y := testrand48.o +testvsnp.shared-y := testvsnp.o + +# Cleaning +clean-files := $(static-y) $(shared-y) $(test-files:.c=.o)