Files
rtems/c/Makefile.in
Joel Sherrill 5c3511e5cf Big patch form Ralf Corsepius described in this email:
Here is the result of my nightly work to get RTEMS_ROOT=$srcdir working
  with different shells and relative/absolute paths.

  What I did is relatively simple in principle:
  Instead of setting RTEMS_ROOT in configure.in and then let configure
  substitute @RTEMS_ROOT@ inside the Makefiles, I now let each Makefile
  set RTEMS_ROOT from each Makefile's @top_srcdir@ value.

  The difference is subtile, but with enormous side effects:
  - If RTEMS_ROOT is set in configure, then the same single value will be
  propagated to all Makefiles. This breaks using relative paths, as the
  relative path to the root of the source tree is used inside of all
  subdirectory Makefiles.
  - Now each Makefile.in sets RTEMS_ROOT = @top_srcdir@.  top_srcdir  is
  computed individually by configure for each single Makefile.in, hereby
  receiving the correct value, no matter if relative or absolute paths are
  used.

  To get this working, I needed to remove setting RTEMS_ROOT from
  target.cfg.in, because this overrides the value of RTEMS_ROOT from each
  individual Makefile.


  Furthermore, I removed RTEMS_CUSTOM from the Makefiles and replaced all
  "include $(RTEMS_CUSTOM)" directives with"include
  $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP)". Perhaps you don't like this,
  but I think, to have one variable less is clearer and easier to
  understand than having several variables refering to the next one.


  I enclose a small patch to this mail, which
  - fixes the config.h problem (to finally clearify misunderstands)
  - removes assignment/subsitution of RTEMS_ROOT from configure.in
  - contains a workaround for the application Makefile's RTEMS_ROOT
  problem (reported by Eric)
  - removes some unused lines from the toplevel Makefile.in
  - removes assignment of RTEMS_ROOT from make/target.cfg.in
1998-01-30 21:49:51 +00:00

106 lines
2.9 KiB
Makefile

#
# $Id$
#
# top level directory for RTEMS build tree
# This Makefile is *not* a good example of a directory Makefile.
#
@SET_MAKE@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
target = @target@
manext = 1
mandir = @mandir@/man$(manext)
program_prefix = @program_prefix@
VPATH = @srcdir@
RTEMS_ROOT = @top_srcdir@
PROJECT_ROOT = @PROJECT_ROOT@
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
include $(RTEMS_ROOT)/make/directory.cfg
SUB_DIRS=build-tools src
# We only make the install point for the KA9Q header files if it is enabled.
LIBKA9Q_yes_V = lib/include/ka9q
LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V)
# We only make the rtems++ install point if it is enabled.
LIBRTEMSCPLUSPLUS_yes_V = lib/include/rtems++
LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
# directories to be created in install point
CREATE_DIRS = \
lib lib/include lib/include/sys lib/include/rtems \
lib/include/rtems/score lib/include/rtems/rtems lib/include/rtems/posix \
lib/include/netinet lib/include/libc lib/include/libc/sys \
lib/include/motorola lib/include/zilog \
$(LIBKA9Q) \
$(LIBRTEMSCPLUSPLUS) \
bin samples \
tests tests/screens tests/screens/sptests \
tests/screens/psxtests tests/screens/mptests \
tests/screens/mptests/node1 tests/screens/mptests/node2 \
build-tools update-tools
# Make all/install must include 'env'
# if something is added to TARGET_VARIANTS, then account for it here
all: env
debug: env
profile: env
install: all install_files
debug_install: env debug install_files
profile_install: env profile install_files
debug_all: debug
profile_all: profile
# top level clean/clobber will delete the install points
clean_WRAPUP = $(MAKE) clean_wrapup
clobber_WRAPUP = $(MAKE) clean_wrapup
clean_wrapup: clean_tools clean_dirs clean_modules
.PHONY: dirs clean_wrapup clean_dirs clean_tools clean_modules env install
dirs:
-$(MKDIR) ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%}
-test -d $(PROJECT_ROOT)/c/src/lib/libhwapi && \
(cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs)
# @echo Making directories in build tree ...
# -$(foreach dir,$(CREATE_DIRS), \
# $(shell $(MKDIR) $(PROJECT_ROOT)/$(RTEMS_BSP)/$(dir)))
distclean: clobber
clean_dirs:
$(RM) -r $(PROJECT_RELEASE)
clean_tools:
cd build-tools; $(MAKE) clean
$(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc: $(PROJECT_ROOT)/make/Templates/Makefile.inc
echo "RTEMS_BSP = $(RTEMS_BSP)" > $@
$(CAT) $< >> $@
# NOTE: The wildcard on the install should pick up everything except
# the tests directory. This significantly minimizes the install size.
install_files: $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc
-$(MKDIR) $(prefix)/
-$(MKDIR) $(prefix)/rtems
-$(RM) -rf $(prefix)/rtems/$(RTEMS_BSP)
cd ../; tar cf - $(RTEMS_BSP)/[bilsuM]* | \
(cd $(prefix)/rtems; tar xpBf - )
cd ../make; $(MAKE) RTEMS_BSP=$(RTEMS_BSP) install
tests:
cd src/tests; $(MAKE) all
env: $(SRCS) dirs