All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] open_posix_testsuite: Fix recursive build
Date: Thu, 6 Apr 2017 17:24:49 +0200	[thread overview]
Message-ID: <20170406152448.GA4977@rei.lan> (raw)
In-Reply-To: <20170405085821.13121-1-pvorel@suse.cz>

Hi!
> -top_srcdir?=		.
> +open_posix_srcdir := $(if $(top_srcdir),$(top_srcdir)/testcases/open_posix_testsuite,$(abspath .))

I wonder if we want to be consistent with the rest of the LTP
buildsystem define the top_srcdir ?= ../.. here so that we could use
it below in both cases when the make is executed in the open posix
directory or from the top level Makefile.

Then we could define the open_posix_srcdir := $(top_srcdir)/testcases/open_posix_testsuite

> -prefix?=		`$(top_srcdir)/scripts/print_prefix.sh`
> +prefix?=		`$(open_posix_srcdir)/scripts/print_prefix.sh`
>  
>  datadir?=		$(prefix)/share
>  
> @@ -35,13 +35,13 @@ exec_prefix?=		$(prefix)
>  all: conformance-all functional-all stress-all tools-all
>  
>  ifeq ($(shell uname -s), Linux)
> -include Makefile.linux
> +include $(open_posix_srcdir)/Makefile.linux
>  endif
>  
>  clean: $(CRITICAL_MAKEFILE)
>  	@rm -f $(LOGFILE)*
>  	@for dir in $(SUBDIRS) tools; do \
> -	    $(MAKE) -C $$dir clean >/dev/null; \
> +	    $(MAKE) -C $(open_posix_srcdir)/$$dir clean >/dev/null; \
>  	done
>  
>  distclean: distclean-makefiles
> @@ -49,12 +49,12 @@ distclean: distclean-makefiles
>  # Clean out all of the generated Makefiles.
>  distclean-makefiles:
>  	@for dir in $(SUBDIRS); do \
> -		$(MAKE) -C $$dir $@; \
> +		$(MAKE) -C $(open_posix_srcdir)/$$dir $@; \
>  	done
>  
>  generate-makefiles: distclean-makefiles
> -	@env top_srcdir=$(top_srcdir) \
> -	    $(top_srcdir)/scripts/generate-makefiles.sh
> +	@env top_srcdir=$(open_posix_srcdir) \
> +	    $(open_posix_srcdir)/scripts/generate-makefiles.sh

Thinking of this, we still put the generated makefiles into the source
directory. I wonder if it's a good idea to even try to put the makefiles
into the build directory and overcomplicate the already overcomplicated
makefile generator.

And don't forget that the generate-makefile.sh script needs to get a
path to the config-openposix.mk which is located in the build directory
under include/mk/ otherwise the top level CFLAGS are not propagated.

Looks like this is really can of worms...

>  install: bin-install conformance-install functional-install stress-install
>  
> @@ -63,47 +63,47 @@ test: conformance-test functional-test stress-test
>  # Test build and execution targets.
>  conformance-all: $(CRITICAL_MAKEFILE)
>  	@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
> -	@$(BUILD_MAKE) -C conformance -j1 all
> +	@$(BUILD_MAKE) -C $(open_posix_srcdir)/conformance -j1 all
>  
>  conformance-install:
> -	@$(MAKE) -C conformance install
> +	@$(MAKE) -C $(open_posix_srcdir)/conformance install
>  
>  conformance-test:
>  	@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
> -	@$(TEST_MAKE) -C conformance test
> +	@$(TEST_MAKE) -C $(open_posix_srcdir)/conformance test
>  
>  functional-all: $(CRITICAL_MAKEFILE)
>  	@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
> -	@$(BUILD_MAKE) -C functional -j1 all
> +	@$(BUILD_MAKE) -C $(open_posix_srcdir)/functional -j1 all
>  
>  functional-install:
> -	@$(MAKE) -C functional install
> +	@$(MAKE) -C $(open_posix_srcdir)/functional install
>  
>  functional-test:
>  	@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
> -	@$(TEST_MAKE) -C functional test
> +	@$(TEST_MAKE) -C $(open_posix_srcdir)/functional test
>  
>  stress-all: $(CRITICAL_MAKEFILE)
>  	@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
> -	@$(BUILD_MAKE) -C stress -j1 all
> +	@$(BUILD_MAKE) -C $(open_posix_srcdir)/stress -j1 all
>  
>  stress-install:
> -	@$(MAKE) -C stress install
> +	@$(MAKE) -C $(open_posix_srcdir)/stress install
>  
>  stress-test:
>  	@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
> -	@$(TEST_MAKE) -C stress test
> +	@$(TEST_MAKE) -C $(open_posix_srcdir)/stress test
>  
>  # Tools build and install targets.
>  bin-install:
> -	@$(MAKE) -C bin install
> +	@$(MAKE) -C $(open_posix_srcdir)/bin install
>  
>  tools-all:
> -	@$(MAKE) -C tools all
> +	@$(MAKE) -C $(open_posix_srcdir)/tools all top_srcdir=$(open_posix_srcdir)
>  
>  $(CRITICAL_MAKEFILE): \
> -    $(top_srcdir)/scripts/generate-makefiles.sh	\
> -    $(top_srcdir)/CFLAGS			\
> -    $(top_srcdir)/LDFLAGS			\
> -    $(top_srcdir)/LDLIBS
> -	@$(MAKE) generate-makefiles
> +    $(open_posix_srcdir)/scripts/generate-makefiles.sh	\
> +    $(open_posix_srcdir)/CFLAGS			\
> +    $(open_posix_srcdir)/LDFLAGS			\
> +    $(open_posix_srcdir)/LDLIBS
> +	@$(MAKE) -f $(open_posix_srcdir)/Makefile generate-makefiles
> diff --git a/testcases/open_posix_testsuite/Makefile.linux b/testcases/open_posix_testsuite/Makefile.linux
> index 77e20a958..adef565a8 100644
> --- a/testcases/open_posix_testsuite/Makefile.linux
> +++ b/testcases/open_posix_testsuite/Makefile.linux
> @@ -8,7 +8,7 @@ cmd_disable = @set -e; \
>  
>  BROKEN :=
>  
> -kver_cmp = $(shell $(top_srcdir)/scripts/tst_kvercmp.sh 2 6 22)
> +kver_cmp = $(shell $(open_posix_srcdir)/scripts/tst_kvercmp.sh 2 6 22)
>  ifeq ($(kver_cmp), 1)
>  BROKEN += t_sigaction_16-1
>  endif
> diff --git a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
> index 67a60c8cb..d50d517ae 100755
> --- a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
> +++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
> @@ -22,7 +22,7 @@ generate_locate_test_makefile() {
>  
>  	echo "Generating $maketype Makefiles"
>  
> -	locate-test --$maketype | sed -e 's,^./,,g' > make-gen.$maketype
> +	locate-test --$maketype $top_srcdir | sed -e 's,^./,,g' > make-gen.$maketype
>  
>  	generate_makefiles make-gen.$maketype $*
>  
> -- 
> 2.12.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

  parent reply	other threads:[~2017-04-06 15:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05  8:58 [LTP] [PATCH 1/2] open_posix_testsuite: Fix recursive build Petr Vorel
2017-04-05  8:58 ` [LTP] [PATCH 2/2] travis: Add out-of-tree build Petr Vorel
2017-04-06 15:24 ` Cyril Hrubis [this message]
2017-04-10 12:31   ` [LTP] [PATCH 1/2] open_posix_testsuite: Fix recursive build Domenico Andreoli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170406152448.GA4977@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.