source: rtems/c/Makefile.in @ d8ff793

4.104.114.84.95
Last change on this file since d8ff793 was d8ff793, checked in by Joel Sherrill <joel.sherrill@…>, on 03/19/99 at 22:27:02

Towards automake XI patch from Ralf Corsepius <corsepiu@…>:

This patch is the most scary of all proposals I've been mailing to you
this week until now.

It consists of 3 parts:

  1. a patch
  2. a perl script (acpolish)
  3. a shell script wrapper to invoke the perl-script.

The perl-script reads in each Makefile.in and modifies them
("polishes/beautifies" them :-).

These modifications are not easy to describe:

Basically, it hard-codes some automake Makefile-variables and rules into
RTEMS autoconf-Makefile.ins (Note: autoconf vs. automake!!) and converts
some settings/variables to configure scripts' requirements (Yes,
plural).

E.g. it adds the automake standard variables $top_builddir and $subdir,
adds dependency rules for automatic re-generation of Makefiles from
Makefile.in, adds support variables for relative paths to multiple
configure scripts etc.

The patch is a one-line patch to enable the support of the new features
added by acpolish.

The shell script is a wrapper which pokes around inside of the source
tree for Makefile.ins and invokes acpolish on all autoconf-Makefile.ins.

acpolish is designed to be able to run several times on the same
Makefile.in and may once become a more general tool to convert RTEMS
Makefile.in to automake. Therefore, I'd like to keep it inside of source
tree. (e.g. as contrib/acpolish or c/update-tools/acpolish). However, it
doesn't make sense to export it outside of RTEMS.

To apply this:

cd <source-tree>
patch -p1 -E < <path-to-patch>/rtems-rc-19990318-1.diff
tar xzvf <path-to>/rtems-rc-polish.tar.gz
./rtems-polish.sh
./autogen

Note: The path contrib/acpolish is hard-coded into rtems-polish.sh, if
you decide to put it in an alternative place, please modify
rtems-polish.sh to reflect this change.

Later:
cvs rm make/rtems.cfg (It isn't used anymore)
cvs add contrib
cvs add contrib/acpolish
cvs commit

I've tested this intensively, but naturally I can't exclude bugs.

Ralf.

PS.: Most probably, this is the last "Towards automake" patch. The next
one probably will be a real automake patch.

  • Property mode set to 100644
File size: 4.4 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@
10top_srcdir = @top_srcdir@
11top_builddir = ..
12subdir = c
13
14INSTALL = @INSTALL@
15
16RTEMS_ROOT = $(top_srcdir)/@RTEMS_TOPdir@
17PROJECT_ROOT = @PROJECT_ROOT@
18
19prefix = @prefix@
20exec_prefix = @exec_prefix@
21bindir = @bindir@
22libdir = @libdir@
23includedir = @includedir@
24target = @target@
25manext = 1
26mandir = @mandir@/man$(manext)
27program_prefix = @program_prefix@
28VPATH = @srcdir@
29
30include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
31include $(RTEMS_ROOT)/make/directory.cfg
32
33SUB_DIRS=build-tools src
34
35# We only make the install point for the networking header files if needed.
36LIBNETWORKING_yes_V = lib/include/networking lib/include/networking/sys \
37        lib/include/networking/machine lib/include/networking/rtems \
38        lib/include/networking/vm lib/include/networking/net \
39        lib/include/networking/netinet lib/include/networking/arpa \
40        lib/include/networking/nfs
41LIBNETWORKING = $(LIBNETWORKING_$(HAS_NETWORKING)_V)
42
43# We only make the rpc install point if networking is enabled.
44LIBRPC_yes_V = lib/include/rpc
45LIBRPC = $(LIBRPC_$(HAS_NETWORKING)_V)
46
47# We only make the rdbg install point if networking and rdbg is enabled.
48LIBRDBG_yes_yes_V = lib/include/rdbg
49LIBRDBG = $(LIBRDBG_$(HAS_NETWORKING)_$(HAS_RDBG)_V)
50
51# We only make the rtems++ install point if it is enabled.
52LIBRTEMSCPLUSPLUS_yes_V = lib/include/rtems++
53LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V)
54
55# directories to be created in install point
56CREATE_DIRS = \
57    lib lib/include lib/include/sys lib/include/rtems \
58    lib/include/rtems/score lib/include/rtems/rtems lib/include/rtems/posix \
59    lib/include/libc lib/include/libc/sys \
60    lib/include/motorola lib/include/zilog \
61    lib/include/libchip \
62    $(LIBNETWORKING) \
63    $(LIBRPC) \
64    $(LIBRDBG) \
65    $(LIBRTEMSCPLUSPLUS) \
66    bin samples \
67    tests tests/screens tests/screens/sptests \
68    tests/screens/psxtests tests/screens/mptests \
69    tests/screens/mptests/node1 tests/screens/mptests/node2 \
70    build-tools update-tools
71
72BUILD_DIRS = ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%}
73
74# Make all/install must include 'env'
75# if something is added to TARGET_VARIANTS, then account for it here
76make_src_makefiles: Makefile.in Makefile
77        -find . -name Makefile \
78            -exec grep -l "^preinstall" {} \; > make_src_makefiles.tmp
79        -grep tools make_src_makefiles.tmp > make_src_makefiles
80        -grep -v tools make_src_makefiles.tmp >> make_src_makefiles
81        -rm make_src_makefiles.tmp
82
83pre_install_src: env make_src_makefiles
84        cd build-tools/scripts; $(MAKE)
85        @echo "Order of preinstall directories"
86        cat make_src_makefiles
87        @echo
88        CURRDIR=`pwd`; \
89        for i in `cat make_src_makefiles` ; do \
90                DIR=`dirname $$i`; \
91                cd $$DIR; \
92                $(MAKE) preinstall; \
93                cd $$CURRDIR; \
94        done
95all: pre_install_src env
96debug: pre_install_src env
97profile: pre_install_src env
98
99install: all install_files
100debug_install: env debug install_files
101profile_install: env profile install_files
102
103debug_all: debug
104profile_all: profile
105
106# top level clean/clobber will delete the install points
107clean_WRAPUP = $(MAKE) clean_wrapup
108clobber_WRAPUP = $(MAKE) clean_wrapup
109
110clean_wrapup: clean_tools clean_dirs clean_modules
111
112.PHONY: dirs clean_wrapup clean_dirs clean_tools clean_modules env install
113
114$(BUILD_DIRS):
115        -$(MKDIR) $(BUILD_DIRS)
116        if test -d $(PROJECT_ROOT)/c/src/lib/libhwapi; then \
117                (cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs) \
118        fi
119
120dirs: $(BUILD_DIRS)
121
122distclean: clobber
123
124clean_dirs:
125        $(RM) -r $(PROJECT_RELEASE)
126
127clean_tools:
128        cd build-tools; $(MAKE) clean
129
130$(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc: $(PROJECT_ROOT)/make/Templates/Makefile.inc
131        echo "RTEMS_BSP = $(RTEMS_BSP)" > $@
132        $(CAT) $< >> $@
133
134# NOTE: The wildcard on the install should pick up everything except
135#       the tests directory.  This significantly minimizes the install size.
136
137install_files: $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc
138        @top_srcdir@/mkinstalldirs $(prefix)
139        -$(RM) -rf $(prefix)/$(RTEMS_BSP)
140        cd ../; tar cf - $(RTEMS_BSP)/[bilsuM]* | \
141                (cd $(prefix); tar xpBf - )
142        cd ../make; $(MAKE) RTEMS_BSP=$(RTEMS_BSP) install
143
144tests:
145        cd src/tests; $(MAKE) all
146
147debug_tests: debug
148        cd src/tests; $(MAKE) debug
149
150profile_tests: profile
151        cd src/tests; $(MAKE) profile
152
153env:    $(SRCS) dirs
154
155Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
156        cd $(top_builddir) \
157         && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
Note: See TracBrowser for help on using the repository browser.