source: rtems/c/Makefile.in @ e810408

4.104.114.84.95
Last change on this file since e810408 was 5c3511e, checked in by Joel Sherrill <joel.sherrill@…>, on 01/30/98 at 21:49:51

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
  • Property mode set to 100644
File size: 2.9 KB
Line 
1#
2#  $Id$
3#
4# top level directory for RTEMS build tree
5# This Makefile is *not* a good example of a directory Makefile.
6#
7
8@SET_MAKE@
9srcdir = @srcdir@
10prefix = @prefix@
11exec_prefix = @exec_prefix@
12bindir = @bindir@
13libdir = @libdir@
14includedir = @includedir@
15target = @target@
16manext = 1
17mandir = @mandir@/man$(manext)
18program_prefix = @program_prefix@
19VPATH = @srcdir@
20RTEMS_ROOT = @top_srcdir@
21PROJECT_ROOT = @PROJECT_ROOT@
22
23include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
24include $(RTEMS_ROOT)/make/directory.cfg
25
26SUB_DIRS=build-tools src
27
28# We only make the install point for the KA9Q header files if it is enabled.
29LIBKA9Q_yes_V = lib/include/ka9q
30LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V)
31
32# We only make the rtems++ install point if it is enabled.
33LIBRTEMSCPLUSPLUS_yes_V = lib/include/rtems++
34LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
35
36# directories to be created in install point
37CREATE_DIRS = \
38    lib lib/include lib/include/sys lib/include/rtems \
39    lib/include/rtems/score lib/include/rtems/rtems lib/include/rtems/posix \
40    lib/include/netinet lib/include/libc lib/include/libc/sys \
41    lib/include/motorola lib/include/zilog \
42    $(LIBKA9Q) \
43    $(LIBRTEMSCPLUSPLUS) \
44    bin samples \
45    tests tests/screens tests/screens/sptests \
46    tests/screens/psxtests tests/screens/mptests \
47    tests/screens/mptests/node1 tests/screens/mptests/node2 \
48    build-tools update-tools
49
50# Make all/install must include 'env'
51# if something is added to TARGET_VARIANTS, then account for it here
52all: env
53debug: env
54profile: env
55
56install: all install_files
57debug_install: env debug install_files
58profile_install: env profile install_files
59
60debug_all: debug
61profile_all: profile
62
63# top level clean/clobber will delete the install points
64clean_WRAPUP = $(MAKE) clean_wrapup
65clobber_WRAPUP = $(MAKE) clean_wrapup
66
67clean_wrapup: clean_tools clean_dirs clean_modules
68
69.PHONY: dirs clean_wrapup clean_dirs clean_tools clean_modules env install
70
71dirs:
72        -$(MKDIR) ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%}
73        -test -d $(PROJECT_ROOT)/c/src/lib/libhwapi && \
74            (cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs)
75#       @echo Making directories in build tree ...
76#       -$(foreach dir,$(CREATE_DIRS), \
77#           $(shell $(MKDIR) $(PROJECT_ROOT)/$(RTEMS_BSP)/$(dir)))
78
79distclean: clobber
80
81clean_dirs:
82        $(RM) -r $(PROJECT_RELEASE)
83
84clean_tools:
85        cd build-tools; $(MAKE) clean
86
87$(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc: $(PROJECT_ROOT)/make/Templates/Makefile.inc
88        echo "RTEMS_BSP = $(RTEMS_BSP)" > $@
89        $(CAT) $< >> $@
90
91# NOTE: The wildcard on the install should pick up everything except
92#       the tests directory.  This significantly minimizes the install size.
93
94install_files: $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc
95        -$(MKDIR) $(prefix)/
96        -$(MKDIR) $(prefix)/rtems
97        -$(RM) -rf $(prefix)/rtems/$(RTEMS_BSP)
98        cd ../; tar cf - $(RTEMS_BSP)/[bilsuM]* | \
99                (cd $(prefix)/rtems; tar xpBf - )
100        cd ../make; $(MAKE) RTEMS_BSP=$(RTEMS_BSP) install
101
102tests:
103        cd src/tests; $(MAKE) all
104
105env:    $(SRCS) dirs
Note: See TracBrowser for help on using the repository browser.