forked from Imagelibrary/rtems
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
36 lines
661 B
Makefile
36 lines
661 B
Makefile
#
|
|
# $Id$
|
|
#
|
|
# RTEMS build tools
|
|
# NOTE: of course we can't use any of these tools
|
|
# in this Makefile. Most notably: install-if-change
|
|
#
|
|
|
|
@SET_MAKE@
|
|
srcdir = @srcdir@
|
|
VPATH = @srcdir@
|
|
RTEMS_ROOT = @top_srcdir@
|
|
PROJECT_ROOT = @PROJECT_ROOT@
|
|
|
|
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
|
|
include $(RTEMS_ROOT)/make/leaf.cfg
|
|
|
|
DESTDIR=$(PROJECT_RELEASE)/build-tools
|
|
|
|
PGMS=install-if-change rcs-clean lock-directory unlock-directory rtems-glom search-id.sh
|
|
|
|
|
|
INSTALLED=$(PGMS:%=$(DESTDIR)/%)
|
|
|
|
all: $(DESTDIR) $(PGMS) install
|
|
echo $(DESTDIR)
|
|
|
|
$(DESTDIR):
|
|
[ -d $@ ] || $(MKDIR) $@
|
|
|
|
install: $(INSTALLED)
|
|
|
|
# Install the program
|
|
$(DESTDIR)/%: %
|
|
$(make-script)
|