Files
rtems/cpukit/sapi/Makefile.am
Chris Johns 2afb22b7e1 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.
2018-01-25 08:45:26 +01:00

65 lines
2.1 KiB
Makefile

include $(top_srcdir)/automake/multilib.am
include $(top_srcdir)/automake/compile.am
EXTRA_DIST = include/rtems/README
noinst_LIBRARIES = libsapi.a
libsapi_a_SOURCES = src/extension.c src/extensioncreate.c \
src/extensiondelete.c src/extensionident.c src/fatal.c src/exinit.c \
src/exshutdown.c src/io.c src/ioclose.c src/iocontrol.c \
src/ioinitialize.c src/ioopen.c src/ioread.c src/ioregisterdriver.c \
src/iounregisterdriver.c src/iowrite.c src/posixapi.c \
src/getversionstring.c \
src/chainappendnotify.c src/chaingetnotify.c src/chaingetwait.c \
src/chainprependnotify.c src/rbheap.c src/interrtext.c \
src/fatalsrctext.c src/version.c
libsapi_a_SOURCES += src/chainprotected.c
libsapi_a_SOURCES += src/cpucounterconverter.c
libsapi_a_SOURCES += src/delayticks.c
libsapi_a_SOURCES += src/delaynano.c
libsapi_a_SOURCES += src/rbtree.c
libsapi_a_SOURCES += src/rbtreefind.c
libsapi_a_SOURCES += src/rbtreeinsert.c
libsapi_a_SOURCES += src/panic.c
libsapi_a_SOURCES += src/profilingiterate.c
libsapi_a_SOURCES += src/profilingreportxml.c
libsapi_a_SOURCES += src/tcsimpleinstall.c
libsapi_a_CPPFLAGS = $(AM_CPPFLAGS)
#
# Create a new Version VC Key header if the VC state has changed.
#
vc_key_stamp = $(am__leading_dot)vc-key-stamp
libsapi_a_CPPFLAGS += -I.
BUILT_SOURCES = version-vc-key.h
.PHONY: generate-vc-key
generate-vc-key:
@+current_vc_key=""; \
if test -f $(vc_key_stamp); then \
current_vc_key=`cat $(vc_key_stamp)`; \
fi; \
vc_key=`$(top_srcdir)/sapi/vc-key.sh $(top_srcdir) $$current_vc_key`; \
if test "$$vc_key" != "matches"; then \
echo "Generating version-vc-key.h"; \
if test "$$vc_key" == "release"; then \
vc_header_key="\/\* No version control key found; release\? \*\/"; \
else \
vc_header_key="#define RTEMS_VERSION_VC_KEY \"$$vc_key\""; \
fi; \
cat $(top_srcdir)/sapi/version-vc-key.h.in | \
sed -e "s/@VERSION_VC_KEY@/$$vc_header_key/g" > version-vc-key.h; \
echo "$$vc_key" > $(vc_key_stamp); \
fi
version-vc-key.h: generate-vc-key
$(srcdir)/src/version.c: version-vc-key.h
all-local: generate-vc-key
include $(top_srcdir)/automake/local.am