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@ |
---|
9 | srcdir = @srcdir@ |
---|
10 | prefix = @prefix@ |
---|
11 | exec_prefix = @exec_prefix@ |
---|
12 | bindir = @bindir@ |
---|
13 | libdir = @libdir@ |
---|
14 | includedir = @includedir@ |
---|
15 | target = @target@ |
---|
16 | manext = 1 |
---|
17 | mandir = @mandir@/man$(manext) |
---|
18 | program_prefix = @program_prefix@ |
---|
19 | VPATH = @srcdir@ |
---|
20 | RTEMS_ROOT = @top_srcdir@ |
---|
21 | PROJECT_ROOT = @PROJECT_ROOT@ |
---|
22 | |
---|
23 | include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg |
---|
24 | include $(RTEMS_ROOT)/make/directory.cfg |
---|
25 | |
---|
26 | SUB_DIRS=build-tools src |
---|
27 | |
---|
28 | # We only make the install point for the KA9Q header files if it is enabled. |
---|
29 | LIBKA9Q_yes_V = lib/include/ka9q |
---|
30 | LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V) |
---|
31 | |
---|
32 | # We only make the rtems++ install point if it is enabled. |
---|
33 | LIBRTEMSCPLUSPLUS_yes_V = lib/include/rtems++ |
---|
34 | LIBRTEMSCPLUSPLUS = $(LIBRTEMSCPLUSPLUS_$(HAS_CPLUSPLUS)_V) |
---|
35 | |
---|
36 | # directories to be created in install point |
---|
37 | CREATE_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 |
---|
52 | all: env |
---|
53 | debug: env |
---|
54 | profile: env |
---|
55 | |
---|
56 | install: all install_files |
---|
57 | debug_install: env debug install_files |
---|
58 | profile_install: env profile install_files |
---|
59 | |
---|
60 | debug_all: debug |
---|
61 | profile_all: profile |
---|
62 | |
---|
63 | # top level clean/clobber will delete the install points |
---|
64 | clean_WRAPUP = $(MAKE) clean_wrapup |
---|
65 | clobber_WRAPUP = $(MAKE) clean_wrapup |
---|
66 | |
---|
67 | clean_wrapup: clean_tools clean_dirs clean_modules |
---|
68 | |
---|
69 | .PHONY: dirs clean_wrapup clean_dirs clean_tools clean_modules env install |
---|
70 | |
---|
71 | dirs: |
---|
72 | -$(MKDIR) ${CREATE_DIRS:%=$(PROJECT_ROOT)/$(RTEMS_BSP)/%} |
---|
73 | if test -d $(PROJECT_ROOT)/c/src/lib/libhwapi; then \ |
---|
74 | (cd $(PROJECT_ROOT)/c/src/lib/libhwapi ; $(MAKE) mkdirs) \ |
---|
75 | fi |
---|
76 | |
---|
77 | distclean: clobber |
---|
78 | |
---|
79 | clean_dirs: |
---|
80 | $(RM) -r $(PROJECT_RELEASE) |
---|
81 | |
---|
82 | clean_tools: |
---|
83 | cd build-tools; $(MAKE) clean |
---|
84 | |
---|
85 | $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc: $(PROJECT_ROOT)/make/Templates/Makefile.inc |
---|
86 | echo "RTEMS_BSP = $(RTEMS_BSP)" > $@ |
---|
87 | $(CAT) $< >> $@ |
---|
88 | |
---|
89 | # NOTE: The wildcard on the install should pick up everything except |
---|
90 | # the tests directory. This significantly minimizes the install size. |
---|
91 | |
---|
92 | install_files: $(PROJECT_ROOT)/$(RTEMS_BSP)/Makefile.inc |
---|
93 | -$(MKDIR) $(prefix)/ |
---|
94 | -$(MKDIR) $(prefix)/rtems |
---|
95 | -$(RM) -rf $(prefix)/rtems/$(RTEMS_BSP) |
---|
96 | cd ../; tar cf - $(RTEMS_BSP)/[bilsuM]* | \ |
---|
97 | (cd $(prefix)/rtems; tar xpBf - ) |
---|
98 | cd ../make; $(MAKE) RTEMS_BSP=$(RTEMS_BSP) install |
---|
99 | |
---|
100 | tests: |
---|
101 | cd src/tests; $(MAKE) all |
---|
102 | |
---|
103 | debug_tests: debug |
---|
104 | cd src/tests; $(MAKE) debug |
---|
105 | |
---|
106 | profile_tests: profile |
---|
107 | cd src/tests; $(MAKE) profile |
---|
108 | |
---|
109 | env: $(SRCS) dirs |
---|