forked from Imagelibrary/rtems
This is the first real automake patch.
It adds automake support to c/build-tools and cleans up a few minor
issues.
I consider this to be a testing probe to examine problems with automake.
Therefore, this patch is just a more or less harmless replacement of the
former RTEMS Makefiles and I expect it not last for long. If you want to
give automake Makefiles a public try and if you want/need to learn about
problems with it, then it's about time for a new snapshot, IMO. I may
have screwed up something not directly related to automake, but I expect
very few (none to be precise) problems with automake. However, somebody
should at least try building on Cygwin. If you feel a bit more
adventureous, then I also can continue to submit more patches.
[FYI: I still have a couple of automake files laying around, but they
need some cleanup before being submitted as patches. Now, that I am just
into it, I'll perhaps submit another one tonight :-]
After applying this patch (patch -p1 -E <
<path-to>/rtems-rc-19990318-0), first run the "autogen" script from the
toplevel source directory, before committing to CVS. Be careful about
dependencies between Makefile.am and Makefile.ins when cutting tarballs
from CVS. Makefile.ins are required to be newer than Makefile.ams,
otherwise users would need to have automake, autoconf and perl. Some
people recommend to "touch" all Makefile.in after checkout from cvs (cf.
egcs/contrib/egcs_update).
ATTENTION:
* This patch adds a number of new files.
* remove aclocal/exeext.m4 and aclocal/cygwin.m4 from CVS, They are now
covered by autoconf-2.13`s AC_EXEEXT.
Some features/side-effects which are probably interesting for you:
In a configured build-tree "cd c/build-tools", then try
* "make RTEMS_BSP=<bsp> install"
* "make RTEMS_BSP=<bsp> dist"
159 lines
4.5 KiB
Makefile
159 lines
4.5 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@
|
|
top_srcdir = @top_srcdir@
|
|
top_builddir = ..
|
|
subdir = c
|
|
|
|
INSTALL = @INSTALL@
|
|
|
|
RTEMS_ROOT = $(top_srcdir)/@RTEMS_TOPdir@
|
|
PROJECT_ROOT = @PROJECT_ROOT@
|
|
|
|
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@
|
|
|
|
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 networking header files if needed.
|
|
LIBNETWORKING_yes_V = lib/include/networking lib/include/networking/sys \
|
|
lib/include/networking/machine lib/include/networking/rtems \
|
|
lib/include/networking/vm lib/include/networking/net \
|
|
lib/include/networking/netinet lib/include/networking/arpa \
|
|
lib/include/networking/nfs
|
|
LIBNETWORKING = $(LIBNETWORKING_$(HAS_NETWORKING)_V)
|
|
|
|
# We only make the rpc install point if networking is enabled.
|
|
LIBRPC_yes_V = lib/include/rpc
|
|
LIBRPC = $(LIBRPC_$(HAS_NETWORKING)_V)
|
|
|
|
# We only make the rdbg install point if networking and rdbg is enabled.
|
|
LIBRDBG_yes_yes_V = lib/include/rdbg
|
|
LIBRDBG = $(LIBRDBG_$(HAS_NETWORKING)_$(HAS_RDBG)_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/libc lib/include/libc/sys \
|
|
lib/include/motorola lib/include/zilog \
|
|
lib/include/libchip \
|
|
$(LIBNETWORKING) \
|
|
$(LIBRPC) \
|
|
$(LIBRDBG) \
|
|
$(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
|
|
|
|
BUILD_DIRS = ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%}
|
|
|
|
# Make all/install must include 'env'
|
|
# if something is added to TARGET_VARIANTS, then account for it here
|
|
make_src_makefiles: Makefile.in Makefile
|
|
-find . -name Makefile \
|
|
-exec grep -l "^preinstall" {} \; > make_src_makefiles.tmp
|
|
-grep tools make_src_makefiles.tmp > make_src_makefiles
|
|
-grep -v tools make_src_makefiles.tmp >> make_src_makefiles
|
|
-rm make_src_makefiles.tmp
|
|
|
|
pre_install_src: env make_src_makefiles
|
|
cd build-tools/scripts; \
|
|
$(MAKE) RTEMS_BSP=${RTEMS_BSP} install-exec-local
|
|
@echo "Order of preinstall directories"
|
|
cat make_src_makefiles
|
|
@echo
|
|
CURRDIR=`pwd`; \
|
|
for i in `cat make_src_makefiles` ; do \
|
|
DIR=`dirname $$i`; \
|
|
cd $$DIR; \
|
|
$(MAKE) preinstall; \
|
|
cd $$CURRDIR; \
|
|
done
|
|
all: pre_install_src env
|
|
debug: pre_install_src env
|
|
profile: pre_install_src 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
|
|
|
|
$(BUILD_DIRS):
|
|
$(RTEMS_ROOT)/mkinstalldirs $(BUILD_DIRS)
|
|
if test -d $(PROJECT_ROOT)/c/src/lib/libhwapi; then \
|
|
(cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs) \
|
|
fi
|
|
|
|
dirs: $(BUILD_DIRS)
|
|
|
|
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
|
|
@top_srcdir@/mkinstalldirs $(prefix)
|
|
-$(RM) -rf $(prefix)/$(RTEMS_BSP)
|
|
cd ../; tar cf - $(RTEMS_BSP)/[bilsuM]* | \
|
|
(cd $(prefix); tar xpBf - )
|
|
cd ../make; $(MAKE) RTEMS_BSP=$(RTEMS_BSP) install
|
|
|
|
tests:
|
|
cd src/tests; $(MAKE) all
|
|
|
|
debug_tests: debug
|
|
cd src/tests; $(MAKE) debug
|
|
|
|
profile_tests: profile
|
|
cd src/tests; $(MAKE) profile
|
|
|
|
env: $(SRCS) dirs
|
|
|
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
cd $(top_builddir) \
|
|
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|