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