source: rtems/cpukit/wrapup/Makefile.am @ 89ac281

5
Last change on this file since 89ac281 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: 3.2 KB
Line 
1include $(top_srcdir)/automake/multilib.am
2include $(top_srcdir)/automake/compile.am
3
4## Setup the variant build subdirectory
5ARCH = o-optimize
6
7project_lib_LIBRARIES = librtemscpu.a
8
9$(PROJECT_LIB)/librtemscpu.a: librtemscpu.a
10        $(INSTALL_DATA) $< $(PROJECT_LIB)/librtemscpu.a
11TMPINSTALL_FILES = $(PROJECT_LIB)/librtemscpu.a
12
13librtemscpu_a_SOURCES =
14
15TMP_LIBS =
16TMP_LIBS += ../dev/libdev.a
17TMP_LIBS += ../dtc/libfdt/libfdt.a
18TMP_LIBS += ../score/cpu/@RTEMS_CPU@/libscorecpu.a
19TMP_LIBS += ../score/libscore.a
20TMP_LIBS += ../sapi/libsapi.a
21TMP_LIBS += ../rtems/librtems.a
22TMP_LIBS += ../posix/libposix.a
23
24if LIBGNAT
25TMP_LIBS += ../libgnat/libgnat.a
26endif
27
28TMP_LIBS += ../libcrypt/libcrypt.a
29TMP_LIBS += ../libstdthreads/libstdthreads.a
30TMP_LIBS += ../libcsupport/libcsupport.a
31TMP_LIBS += ../libcsupport/libcalloc.a
32TMP_LIBS += ../libblock/libblock.a
33if LIBDOSFS
34TMP_LIBS += ../libfs/libdosfs.a
35endif
36TMP_LIBS += ../libfs/libdefaultfs.a
37TMP_LIBS += ../libfs/libdevfs.a
38TMP_LIBS += ../libfs/libimfs.a
39TMP_LIBS += ../libfs/librfs.a
40
41TMP_LIBS += ../libmisc/libmonitor.a
42TMP_LIBS += ../libmisc/libuntar.a
43TMP_LIBS += ../libmisc/libstackchk.a
44TMP_LIBS += ../libmisc/libcpuuse.a
45
46## XXX temporarily removed because it causes a
47## XXX number of BSPs to not link "main(){}" used by autoconf
48# if LIBSERDBG
49# TMP_LIBS += ../libmisc/libserdbg.a
50# endif
51
52if LIBSHELL
53TMP_LIBS += ../libmisc/libshell.a
54endif
55
56TMP_LIBS += ../libmisc/libbspcmdline.a
57TMP_LIBS += ../libmisc/libcapture.a
58TMP_LIBS += ../libmisc/libdumpbuf.a
59TMP_LIBS += ../libmisc/libdevnull.a
60TMP_LIBS += ../libmisc/libdummy.a
61TMP_LIBS += ../libmisc/libfsmount.a
62TMP_LIBS += ../libmisc/libmouse.a
63TMP_LIBS += ../libmisc/libmw-fb.a
64TMP_LIBS += ../libmisc/libredirector.a
65TMP_LIBS += ../libmisc/librtemsfdt.a
66TMP_LIBS += ../libmisc/libstringto.a
67TMP_LIBS += ../libmisc/libtestsupport.a
68
69if LIBUTF8PROC
70TMP_LIBS += ../libmisc/libutf8proc.a
71endif
72
73TMP_LIBS += ../libmisc/libuuid.a
74TMP_LIBS += ../libmisc/libxz.a
75TMP_LIBS += ../libi2c/libi2c.a
76
77if LIBPCI
78TMP_LIBS += ../libpci/libpci.a
79endif
80
81if LIBDRVMGR
82TMP_LIBS += ../libdrvmgr/libdrvmgr.a
83endif
84
85if LIBNETWORKING
86TMP_LIBS += ../libnetworking/libnetworking.a
87TMP_LIBS += ../libnetworking/libc.a
88TMP_LIBS += ../libnetworking/lib.a
89endif
90
91if LIBRPC
92TMP_LIBS += ../librpc/librpc.a
93TMP_LIBS += ../librpc/libxdr.a
94endif
95
96if NEWLIB
97TMP_LIBS += ../libmd/libmd.a
98endif
99
100if LIBDL
101TMP_LIBS += ../libdl/libdl.a
102endif
103
104if LIBDEBUGGER
105TMP_LIBS += ../libdebugger/libdebugger.a
106endif
107
108librtemscpu.a: $(TMP_LIBS)
109        rm -f $@
110        $(MKDIR_P) $(ARCH)
111        rm -rf $(ARCH)/*.$(OBJEXT) $(ARCH)/*.rel
112        for f in $(TMP_LIBS); do \
113          case $$f in \
114          *.$(OBJEXT) | *.rel) \
115            if test -f $(ARCH)/`basename $$f`; then \
116              if cmp $$f $(ARCH)/`basename $$f`; then \
117                true; \
118              else \
119                echo 1>&2 "ERROR -- `basename $$f` in multiple files"; \
120                exit 1; \
121              fi; \
122            else \
123              cp $$f $(ARCH)/; \
124              chmod a-w $(ARCH)/`basename $$f`; \
125            fi; \
126            ;; \
127          *.a) \
128            cd $(ARCH); \
129              $(AR) xv ../$$f || exit 1; \
130              chmod a-w * ; \
131            cd ..; \
132            ;; \
133          esac; \
134        done
135        ls $(ARCH)/* > $@-list
136        $(AR) rc $@ @$@-list
137        rm -f $@-list $(ARCH)/*.$(OBJEXT) $(ARCH)/*.rel
138        $(RANLIB) $@
139
140all-local: $(TMPINSTALL_FILES)
141
142include $(top_srcdir)/automake/local.am
Note: See TracBrowser for help on using the repository browser.