source: rtems/c/Makefile.in @ 7a74b99

4.104.114.84.95
Last change on this file since 7a74b99 was 7a74b99, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 19, 1999 at 2:54:25 PM

Make sure the build-tools get built in the preinstall phase.

  • Property mode set to 100644
File size: 4.5 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 src -name Makefile \
78            -exec grep -l "^preinstall" {} \; | sort > 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; $(MAKE) RTEMS_BSP=${RTEMS_BSP} install-exec-local
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) RTEMS_BSP=${RTEMS_BSP} preinstall; \
93                cd $$CURRDIR; \
94        done
95
96all: pre_install_src env
97debug: pre_install_src env
98profile: pre_install_src env
99
100install: all install_files
101debug_install: env debug install_files
102profile_install: env profile install_files
103
104debug_all: debug
105profile_all: profile
106
107# top level clean/clobber will delete the install points
108clean_WRAPUP = $(MAKE) clean_wrapup
109clobber_WRAPUP = $(MAKE) clean_wrapup
110
111clean_wrapup: clean_tools clean_dirs clean_modules
112
113.PHONY: dirs clean_wrapup clean_dirs clean_tools clean_modules env install
114
115$(BUILD_DIRS):
116        $(RTEMS_ROOT)/mkinstalldirs $(BUILD_DIRS)
117        if test -d $(PROJECT_ROOT)/c/src/lib/libhwapi; then \
118                (cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs) \
119        fi
120
121dirs: $(BUILD_DIRS)
122
123distclean: clobber
124
125clean_dirs:
126        $(RM) -r $(PROJECT_RELEASE)
127
128clean_tools:
129        cd build-tools; $(MAKE) clean
130
131$(PROJECT_ROOT)/${RTEMS_BSP}/Makefile.inc: $(PROJECT_ROOT)/make/Templates/Makefile.inc
132        echo "RTEMS_BSP = ${RTEMS_BSP}" > $@
133        $(CAT) $< >> $@
134
135# NOTE: The wildcard on the install should pick up everything except
136#       the tests directory.  This significantly minimizes the install size.
137
138install_files: $(PROJECT_ROOT)/${RTEMS_BSP}/Makefile.inc
139        @top_srcdir@/mkinstalldirs $(prefix)
140        -$(RM) -rf $(prefix)/${RTEMS_BSP}
141        cd ../; tar cf - ${RTEMS_BSP}/[bilsuM]* | \
142                (cd $(prefix); tar xpBf - )
143        cd ../make; $(MAKE) RTEMS_BSP=${RTEMS_BSP} install
144
145tests:
146        cd src/tests; $(MAKE) all
147
148debug_tests: debug
149        cd src/tests; $(MAKE) debug
150
151profile_tests: profile
152        cd src/tests; $(MAKE) profile
153
154env:    $(SRCS) dirs
155
156Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
157        cd $(top_builddir) \
158         && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
Note: See TracBrowser for help on using the repository browser.