Changeset a748603 in rtems


Ignore:
Timestamp:
05/14/17 01:52:52 (7 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
5, master
Children:
ff781cc
Parents:
86ae03c
git-author:
Chris Johns <chrisj@…> (05/14/17 01:52:52)
git-committer:
Chris Johns <chrisj@…> (05/24/17 09:59:22)
Message:

build-system: Parallel build all subdirs.

Files:
31 edited

Legend:

Unmodified
Added
Removed
  • c/Makefile.am

    r86ae03c ra748603  
    1212
    1313## Let all RTEMS' make targets depend on ${RTEMS_BSP}
    14 all-local: ${RTEMS_BSP}
    15 preinstall-am: ${RTEMS_BSP}
     14all-local: $(RTEMS_BSP)
     15preinstall-am: $(RTEMS_BSP)
    1616
    1717## Pull in extra files intro the distribution
  • c/src/Makefile.am

    r86ae03c ra748603  
    11ACLOCAL_AMFLAGS = -I aclocal
    22
    3 SUBDIRS = . @BSP_SUBDIRS@
     3_SUBDIRS = . @BSP_SUBDIRS@
    44DIST_SUBDIRS = @BSP_SUBDIRS@
    55
  • c/src/automake/subdirs.am

    r86ae03c ra748603  
    1 ## Borrowed from automake-1.4 and adapted to RTEMS
     1## Copyright 2017 Chris Johns <chrisj@rtems.org>
    22
    3 ## NOTE: This is a temporary work-around to keep
    4 ## RTEMS's non automake standard make targets working.
    5 ## Once automake is fully integrated these make targets
    6 ## and this file will probably be removed
     3##
     4## The following builds in parallel. The subdirectories are
     5## expanded into separate rules and all the targets are listed
     6## and make runs as many as it can.
     7##
     8## A macro is defined and evaluated once for each directory. This
     9## creates the instance of the rule. Use $(info ...) to print them.
     10##
    711
    8 preinstall-recursive:
    9         @set fnord $(MAKEFLAGS); amf=$$2; \
    10         dot_seen=no; \
    11         target=`echo $@ | sed s/-recursive//`; \
    12         list='$(SUBDIRS)'; for subdir in $$list; do \
    13           echo "Making $$target in $$subdir"; \
    14           if test "$$subdir" = "."; then \
    15             dot_seen=yes; \
    16             local_target="$$target-am"; \
    17           else \
    18             local_target="$$target"; \
    19           fi; \
    20           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
    21 ## This trick allows "-k" to keep its natural meaning when running a
    22 ## recursive rule.
    23            || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
    24         done; \
    25         if test "$$dot_seen" = "no"; then \
    26           $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
    27         fi; test -z "$$fail"
     12SUBDIRS_dot                            = $(filter     .,$(_SUBDIRS))
     13SUBDIRS_no_dot                         = $(filter-out .,$(_SUBDIRS))
     14SUBDIRS_no_dot_no_wrapup               = $(filter-out wrapup,$(SUBDIRS_no_dot))
     15SUBDIRS_no_dot_no_testsuites           = $(filter-out testsuites,$(SUBDIRS_no_dot))
     16SUBDIRS_no_dot_no_wrapup_no_testsuites = $(filter-out testsuites,$(SUBDIRS_no_dot_no_wrapup))
     17SUBDIRS_wrapup                         = $(filter     wrapup,$(SUBDIRS_no_dot))
     18SUBDIRS_testsuites                     = $(filter     testsuites,$(SUBDIRS_no_dot))
    2819
    29 preinstall: preinstall-recursive
    30 .PHONY: preinstall-recursive
     20SUBDIR_TARGET     = $(subst /,-,$1)
     21PREINSTALL_TARGET = preinstall-$(call SUBDIR_TARGET,$(1))
     22
     23preintstall_targets  = $(if "$(SUBDIRS_dot)" ".",preinstall-dot) $(foreach D,$(SUBDIRS_no_dot),$(call PREINSTALL_TARGET,$(D)))
     24
     25define PREINSTALL_DIR
     26.PHONY: $1
     27$1:
     28        @+set fnord $(MAKEFLAGS); amf=$$$$2; \
     29        subdir=$(2); \
     30        subdir_label=`echo $(1) | sed -e 's/preinstall-//'`; \
     31        target=`echo $$@ | sed -e 's/-recursive//' -e "s/-$$$${subdir_label}//"`$(3); \
     32        echo "Making $$$$target in $$$$subdir"; \
     33        (cd $$$$subdir && $(MAKE) $(AM_MAKEFLAGS) $$$$target) \
     34         || case "$$$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac;
     35endef
     36
     37$(if "$(SUBDIRS_dot)" ".",$(eval $(call PREINSTALL_DIR,preinstall-dot,.,-am)))
     38
     39$(foreach D,$(SUBDIRS_no_dot),$(eval $(call PREINSTALL_DIR,$(call PREINSTALL_TARGET,$(D)),$(D))))
     40
     41preinstall: $(preintstall_targets)
     42.PHONY: preinstall
     43
     44define CPUKITDIR
     45.PHONY: $1
     46$1: $(preintstall_targets)
     47        @+set fnord $(MAKEFLAGS); amf=$$$$2; \
     48        subdir=$(2); \
     49        target=`echo $(MAKECMDGOALS) | sed s/-recursive//`; \
     50        if test "$$$$target" = "all-local-am"; then \
     51          target="all-am"; \
     52        fi; \
     53        if test "$$$$target" = "all-local"; then \
     54          target="all"; \
     55        fi; \
     56        echo "Making $$$$target in $$$$subdir"; \
     57        if test "$$$$subdir" != "."; then \
     58          cd $$$$subdir; \
     59          $(MAKE) $(AM_MAKEFLAGS) $$$$local_target; \
     60        fi;
     61endef
     62
     63#
     64# This GNU make syntax is being used to stop automake thinking the code is for
     65# it.
     66#
     67$(if "$(SUBDIRS_dot)" ".",$(eval $(call CPUKITDIR,dot,.)))
     68
     69$(foreach D,$(SUBDIRS_no_dot),$(eval $(call CPUKITDIR,$(D),$(D))))
     70
     71#
     72# If there is a wrapup make it depend on all other directories except the
     73# testsuite so it is not entered until everything but the testsuite has
     74# finished.
     75#
     76$(if "$(SUBDIRS_wrapup)" "wrapup",wrapup: dot $(SUBDIRS_no_dot_no_wrapup_no_testsuites))
     77
     78#
     79# If there is a testsuite make it depend on all other directories so it is not
     80# entered until everything else has finished.
     81#
     82$(if "$(SUBDIRS_testsuites)" "testsuites",testsuites: dot $(SUBDIRS_no_dot_no_testsuites))
     83
     84#
     85# The general build all rule for automake.
     86#
     87all-local: preinstall $(if "$(SUBDIRS_dot)" ".",dot) $(SUBDIRS_no_dot)
  • c/src/lib/Makefile.am

    r86ae03c ra748603  
    1 SUBDIRS = libcpu libbsp
     1_SUBDIRS = libcpu libbsp
    22
    33include $(top_srcdir)/automake/subdirs.am
    44include $(top_srcdir)/automake/local.am
     5
     6#
     7# The libsp cannot be built until libcpu is built.
     8#
     9libbsp: libcpu
  • c/src/lib/libbsp/Makefile.am

    r86ae03c ra748603  
    11include $(top_srcdir)/automake/compile.am
    22
    3 SUBDIRS = @libbsp_cpu_subdir@
     3_SUBDIRS = @libbsp_cpu_subdir@
    44DIST_SUBDIRS = @libbsp_cpu_subdir@
    55
     
    4343
    4444include $(srcdir)/preinstall.am
     45include $(top_srcdir)/automake/local.am
    4546include $(top_srcdir)/automake/subdirs.am
    46 include $(top_srcdir)/automake/local.am
  • c/src/lib/libbsp/arm/Makefile.am

    r86ae03c ra748603  
    44## Currently, the shared directory is not explicitly
    55## added but it is present in the source tree.
    6 SUBDIRS = @RTEMS_BSP_FAMILY@
     6_SUBDIRS = @RTEMS_BSP_FAMILY@
    77
    88include_bspdir = $(includedir)/bsp
  • c/src/lib/libbsp/bfin/Makefile.am

    r86ae03c ra748603  
    22
    33# Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66include $(top_srcdir)/../../../automake/subdirs.am
  • c/src/lib/libbsp/epiphany/Makefile.am

    r86ae03c ra748603  
    33## Currently, the shared directory is not explicitly
    44## added but it is present in the source tree.
    5 SUBDIRS = @RTEMS_BSP_FAMILY@
     5_SUBDIRS = @RTEMS_BSP_FAMILY@
    66include $(srcdir)/preinstall.am
    77include $(top_srcdir)/../../../automake/subdirs.am
  • c/src/lib/libbsp/i386/Makefile.am

    r86ae03c ra748603  
    22
    33## Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66EXTRA_DIST =
  • c/src/lib/libbsp/i386/pc386/Makefile.am

    r86ae03c ra748603  
    2424noinst_PROGRAMS =
    2525
    26 SUBDIRS = . tools
     26_SUBDIRS = . tools
    2727
    2828nodist_include_bsp_HEADERS += include/bspimpl.h
     
    259259include $(srcdir)/preinstall.am
    260260include $(top_srcdir)/../../../../automake/local.am
     261include $(top_srcdir)/../../../../automake/subdirs.am
  • c/src/lib/libbsp/lm32/Makefile.am

    r86ae03c ra748603  
    22
    33# Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66include $(top_srcdir)/../../../automake/subdirs.am
  • c/src/lib/libbsp/m32c/Makefile.am

    r86ae03c ra748603  
    22
    33## Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66EXTRA_DIST =
  • c/src/lib/libbsp/m68k/Makefile.am

    r86ae03c ra748603  
    22
    33## Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66include_bspdir = $(includedir)/bsp
  • c/src/lib/libbsp/m68k/mcf5206elite/Makefile.am

    r86ae03c ra748603  
    1414DISTCLEANFILES = include/bspopts.h
    1515
    16 SUBDIRS = . tools
     16_SUBDIRS = . tools
    1717
    1818include_HEADERS += include/coverhd.h
  • c/src/lib/libbsp/mips/Makefile.am

    r86ae03c ra748603  
    22
    33## Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66include $(top_srcdir)/../../../automake/subdirs.am
  • c/src/lib/libbsp/moxie/Makefile.am

    r86ae03c ra748603  
    66
    77# Descend into the @RTEMS_BSP_FAMILY@ directory
    8 SUBDIRS = @RTEMS_BSP_FAMILY@
     8_SUBDIRS = @RTEMS_BSP_FAMILY@
    99
    1010include $(top_srcdir)/../../../automake/subdirs.am
  • c/src/lib/libbsp/nios2/Makefile.am

    r86ae03c ra748603  
    22
    33# Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66include $(top_srcdir)/../../../automake/subdirs.am
  • c/src/lib/libbsp/no_cpu/Makefile.am

    r86ae03c ra748603  
    22
    33# Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66include $(top_srcdir)/../../../automake/subdirs.am
  • c/src/lib/libbsp/or1k/Makefile.am

    r86ae03c ra748603  
    44## Currently, the shared directory is not explicitly
    55## added but it is present in the source tree.
    6 SUBDIRS = @RTEMS_BSP_FAMILY@
     6_SUBDIRS = @RTEMS_BSP_FAMILY@
    77
    88include $(srcdir)/preinstall.am
  • c/src/lib/libbsp/powerpc/Makefile.am

    r86ae03c ra748603  
    22
    33## Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66# FIXME: This does not work
  • c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am

    r86ae03c ra748603  
    11ACLOCAL_AMFLAGS = -I ../../../../aclocal
    22
    3 SUBDIRS = .
    4 SUBDIRS+= bootloader
     3_SUBDIRS = .
     4_SUBDIRS += bootloader
    55if QEMU
    6 SUBDIRS+= qemu_fakerom
     6_SUBDIRS += qemu_fakerom
    77endif
    88
     
    167167include $(srcdir)/preinstall.am
    168168include $(top_srcdir)/../../../../automake/local.am
     169include $(top_srcdir)/../../../../automake/subdirs.am
  • c/src/lib/libbsp/sh/Makefile.am

    r86ae03c ra748603  
    22
    33# Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66EXTRA_DIST =
  • c/src/lib/libbsp/sparc/Makefile.am

    r86ae03c ra748603  
    22
    33# Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66EXTRA_DIST =
  • c/src/lib/libbsp/sparc64/Makefile.am

    r86ae03c ra748603  
    22
    33## Descend into the @RTEMS_BSP_FAMILY@ directory
    4 SUBDIRS = @RTEMS_BSP_FAMILY@
     4_SUBDIRS = @RTEMS_BSP_FAMILY@
    55
    66include $(top_srcdir)/../../../automake/subdirs.am
  • c/src/lib/libbsp/v850/Makefile.am

    r86ae03c ra748603  
    77## Currently, the shared directory is not explicitly
    88## added but it is present in the source tree.
    9 SUBDIRS = @RTEMS_BSP_FAMILY@
     9_SUBDIRS = @RTEMS_BSP_FAMILY@
    1010
    1111EXTRA_DIST =
  • c/src/lib/libcpu/Makefile.am

    r86ae03c ra748603  
    55EXTRA_DIST += shared/src/cache_manager.c
    66
    7 SUBDIRS = @libcpu_cpu_subdir@
     7_SUBDIRS = @libcpu_cpu_subdir@
    88DIST_SUBDIRS = @libcpu_cpu_subdir@
    99
  • cpukit/Makefile.am

    r86ae03c ra748603  
    55
    66# librtemscpu
    7 SUBDIRS = . score rtems sapi posix
    8 SUBDIRS += dev
    9 SUBDIRS += dtc/libfdt
    10 SUBDIRS += libcrypt
    11 SUBDIRS += libcsupport libblock libfs
    12 SUBDIRS += libdrvmgr
    13 SUBDIRS += libnetworking librpc
    14 SUBDIRS += libpci
    15 SUBDIRS += libi2c
    16 SUBDIRS += libmisc
    17 SUBDIRS += libmd
    18 SUBDIRS += libgnat
    19 SUBDIRS += libdl
    20 SUBDIRS += libstdthreads
    21 SUBDIRS += libdebugger
    22 SUBDIRS += wrapup
    23 
    24 SUBDIRS += zlib
     7_SUBDIRS = . score rtems sapi posix
     8_SUBDIRS += dev
     9_SUBDIRS += dtc/libfdt
     10_SUBDIRS += libcrypt
     11_SUBDIRS += libcsupport libblock libfs
     12_SUBDIRS += libdrvmgr
     13_SUBDIRS += libnetworking librpc
     14_SUBDIRS += libpci
     15_SUBDIRS += libi2c
     16_SUBDIRS += libmisc
     17_SUBDIRS += libmd
     18_SUBDIRS += libgnat
     19_SUBDIRS += libdl
     20_SUBDIRS += libstdthreads
     21_SUBDIRS += libdebugger
     22_SUBDIRS += wrapup
     23
     24_SUBDIRS += zlib
    2525
    2626# applications
    27 SUBDIRS += ftpd
    28 SUBDIRS += telnetd
    29 SUBDIRS += pppd
    30 SUBDIRS += mghttpd
     27_SUBDIRS += ftpd
     28_SUBDIRS += telnetd
     29_SUBDIRS += pppd
     30_SUBDIRS += mghttpd
    3131
    3232noinst_DATA = preinstall-stamp
  • cpukit/automake/subdirs.am

    r86ae03c ra748603  
    1 ## Borrowed from automake-1.4 and adapted to RTEMS
     1## Copyright 2017 Chris Johns <chrisj@rtems.org>
    22
    3 ## NOTE: This is a temporary work-around to keep
    4 ## RTEMS's non automake standard make targets working.
    5 ## Once automake is fully integrated these make targets
    6 ## and this file will probably be removed
     3##
     4## The following builds in parallel. The subdirectories are
     5## expanded into separate rules and all the targets are listed
     6## and make runs as many as it can.
     7##
     8## A macro is defined and evaluated once for each directory. This
     9## creates the instance of the rule. Use $(info ...) to print them.
     10##
    711
    8 preinstall-recursive:
    9         @set fnord $(MAKEFLAGS); amf=$$2; \
    10         dot_seen=no; \
    11         target=`echo $@ | sed s/-recursive//`; \
    12         list='$(SUBDIRS)'; for subdir in $$list; do \
    13           echo "Making $$target in $$subdir"; \
    14           if test "$$subdir" = "."; then \
    15             dot_seen=yes; \
    16             local_target="$$target-am"; \
    17           else \
    18             local_target="$$target"; \
    19           fi; \
    20           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
    21 ## This trick allows "-k" to keep its natural meaning when running a
    22 ## recursive rule.
    23            || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
    24         done; \
    25         if test "$$dot_seen" = "no"; then \
    26           $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
    27         fi; test -z "$$fail"
     12SUBDIRS_dot              = $(filter     .,$(_SUBDIRS))
     13SUBDIRS_no_dot           = $(filter-out .,$(_SUBDIRS))
     14SUBDIRS_no_dot_no_wrapup = $(filter-out wrapup,$(SUBDIRS_no_dot))
     15SUBDIRS_wrapup           = $(filter     wrapup,$(SUBDIRS_no_dot))
    2816
    29 preinstall: preinstall-recursive
    30 .PHONY: preinstall-recursive
     17SUBDIR_TARGET     = $(subst /,-,$1)
     18PREINSTALL_TARGET = preinstall-$(call SUBDIR_TARGET,$(1))
     19
     20preintstall_targets  = $(if "$(SUBDIRS_dot)" ".",preinstall-dot) $(foreach D,$(SUBDIRS_no_dot),$(call PREINSTALL_TARGET,$(D)))
     21
     22define PREINSTALL_DIR
     23.PHONY: $1
     24$1:
     25        @+set fnord $(MAKEFLAGS); amf=$$$$2; \
     26        subdir=$(2); \
     27        subdir_label=`echo $(1) | sed -e 's/preinstall-//'`; \
     28        target=`echo $$@ | sed -e 's/-recursive//' -e "s/-$$$${subdir_label}//"`$(3); \
     29        echo "Making $$$$target in $$$$subdir"; \
     30        (cd $$$$subdir && $(MAKE) $(AM_MAKEFLAGS) $$$$target) \
     31         || case "$$$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac;
     32endef
     33
     34$(if "$(SUBDIRS_dot)" ".",$(eval $(call PREINSTALL_DIR,preinstall-dot,.,-am)))
     35
     36$(foreach D,$(SUBDIRS_no_dot),$(eval $(call PREINSTALL_DIR,$(call PREINSTALL_TARGET,$(D)),$(D))))
     37
     38preinstall: $(preintstall_targets)
     39.PHONY: preinstall
     40
     41define CPUKITDIR
     42.PHONY: $1
     43$1: $(preintstall_targets)
     44        @+set fnord $(MAKEFLAGS); amf=$$$$2; \
     45        subdir=$(2); \
     46        target=`echo $(MAKECMDGOALS) | sed s/-recursive//`; \
     47        if test "$$$$target" = "all-local-am"; then \
     48          target="all-am"; \
     49        fi; \
     50        if test "$$$$target" = "all-local"; then \
     51          target="all"; \
     52        fi; \
     53        echo "Making $$$$target in $$$$subdir"; \
     54        if test "$$$$subdir" != "."; then \
     55          cd $$$$subdir; \
     56          $(MAKE) $(AM_MAKEFLAGS) $$$$local_target; \
     57        fi;
     58endef
     59
     60#
     61# This GNU make syntax is being used to stop automake thinking the code is for
     62# it.
     63#
     64$(if "$(SUBDIRS_dot)" ".",$(eval $(call CPUKITDIR,dot,.)))
     65
     66$(foreach D,$(SUBDIRS_no_dot),$(eval $(call CPUKITDIR,$(D),$(D))))
     67
     68#
     69# If there is a wrapup make it depend on all other directories so it is not
     70# entered until they have finished.
     71#
     72$(if "$(SUBDIRS_wrapup)" "wrapup",wrapup: dot $(foreach D,$(SUBDIRS_no_dot_no_wrapup),$(D)),)
     73
     74all-local: preinstall $(if "$(SUBDIRS_dot)" ".",dot) $(SUBDIRS_no_dot)
  • cpukit/libfs/Makefile.am

    r86ae03c ra748603  
    22include $(top_srcdir)/automake/compile.am
    33
    4 SUBDIRS = src/nfsclient
     4_SUBDIRS = src/nfsclient
    55
    66EXTRA_DIST = README
  • cpukit/score/Makefile.am

    r86ae03c ra748603  
    22include $(top_srcdir)/automake/compile.am
    33
    4 SUBDIRS = cpu
     4_SUBDIRS = cpu
    55
    66## include
  • cpukit/score/cpu/Makefile.am

    r86ae03c ra748603  
    1 SUBDIRS = @RTEMS_CPU@
     1_SUBDIRS = @RTEMS_CPU@
    22
    33DIST_SUBDIRS =
Note: See TracChangeset for help on using the changeset viewer.