source: rtems/c/src/automake/subdirs.am @ d13a624

5
Last change on this file since d13a624 was 2afb22b, checked in by Chris Johns <chrisj@…>, on 12/23/17 at 07:18:56

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1## Copyright 2017 Chris Johns <chrisj@rtems.org>
2
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##
11
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))
19
20preinstall: $(preintstall_targets)
21
22define CPUKITDIR
23.PHONY: $1
24$1: $(preintstall_targets)
25        @+set fnord $(MAKEFLAGS); amf=$$$$2; \
26        subdir=$(2); \
27        target=`echo $(MAKECMDGOALS) | sed s/-recursive//`; \
28        if test "$$$$target" = "all-local-am"; then \
29          target="all-am"; \
30        fi; \
31        if test "$$$$target" = "all-local"; then \
32          target="all"; \
33        fi; \
34        echo "Making $$$$target in $$$$subdir"; \
35        if test "$$$$subdir" != "."; then \
36          cd $$$$subdir; \
37          $(MAKE) $(AM_MAKEFLAGS) $$$$target; \
38        fi;
39endef
40
41#
42# This GNU make syntax is being used to stop automake thinking the code is for
43# it.
44#
45$(if "$(SUBDIRS_dot)" ".",$(eval $(call CPUKITDIR,dot,.)))
46
47$(foreach D,$(SUBDIRS_no_dot),$(eval $(call CPUKITDIR,$(D),$(D))))
48
49#
50# If there is a wrapup make it depend on all other directories except the
51# testsuite so it is not entered until everything but the testsuite has
52# finished.
53#
54$(if "$(SUBDIRS_wrapup)" "wrapup",wrapup: dot $(SUBDIRS_no_dot_no_wrapup_no_testsuites))
55
56#
57# If there is a testsuite make it depend on all other directories so it is not
58# entered until everything else has finished.
59#
60$(if "$(SUBDIRS_testsuites)" "testsuites",testsuites: dot $(SUBDIRS_no_dot_no_testsuites))
61
62#
63# The general build all rule for automake.
64#
65all-local: $(if "$(SUBDIRS_dot)" ".",dot) $(SUBDIRS_no_dot)
Note: See TracBrowser for help on using the repository browser.