1 | # |
---|
2 | # $Id$ |
---|
3 | # |
---|
4 | # Not strictly necessary to pull in this stuff. But it helps with |
---|
5 | # working with the templates and poking around. |
---|
6 | # |
---|
7 | |
---|
8 | @SET_MAKE@ |
---|
9 | srcdir = @srcdir@ |
---|
10 | top_srcdir = @top_srcdir@ |
---|
11 | VPATH = @srcdir@ |
---|
12 | RTEMS_ROOT = @RTEMS_ROOT@ |
---|
13 | PROJECT_ROOT = @PROJECT_ROOT@ |
---|
14 | RTEMS_CUSTOM = $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg |
---|
15 | |
---|
16 | include $(RTEMS_CUSTOM) |
---|
17 | include $(RTEMS_ROOT)/make/leaf.cfg |
---|
18 | |
---|
19 | CLEAN_ADDITIONS += |
---|
20 | CLOBBER_ADDITIONS += |
---|
21 | |
---|
22 | # NOTE: No need to prepend $(srcdir) to file names, |
---|
23 | # VPATH handles the paths for us. |
---|
24 | # NOTE: Only the files really need get installed. |
---|
25 | |
---|
26 | GENERIC_FILES := host.cfg target.cfg |
---|
27 | |
---|
28 | MAKEFILES := README \ |
---|
29 | directory.cfg leaf.cfg \ |
---|
30 | lib.cfg main.cfg |
---|
31 | |
---|
32 | # NOTE: Use the wildcard rule to install all custom files |
---|
33 | # CUSTOM_FILES := $(wildcard $(srcdir)/custom/*.cfg) |
---|
34 | # NOTE: This should be sufficient, but may fail for some BSPS: |
---|
35 | # Get all custom files for the BSP family, they may depend on eachother |
---|
36 | CUSTOM_FILES := custom/default.cfg $(patsubst %,custom/%.cfg,@RTEMS_BSP_LIST@) |
---|
37 | |
---|
38 | # NOTE: Use the wildcard rule to install all compiler files |
---|
39 | # COMPILER_FILES := $(wildcard $(srcdir)/compilers/*.cfg) |
---|
40 | COMPILER_FILES := $(CONFIG.$(TARGET_ARCH).CC) $(CONFIG.$(HOST_ARCH).CC) |
---|
41 | |
---|
42 | # NOTE: Don't use a wildcard rule here, otherwise Templates/Makefile.inc |
---|
43 | # will be installed, too |
---|
44 | TEMPLATE_FILES := \ |
---|
45 | Templates/Makefile.dir \ |
---|
46 | Templates/Makefile.leaf \ |
---|
47 | Templates/Makefile.lib |
---|
48 | |
---|
49 | get: retrieve |
---|
50 | |
---|
51 | all: |
---|
52 | |
---|
53 | $(prefix)/rtems: |
---|
54 | -$(MKDIR) $(prefix) |
---|
55 | -$(MKDIR) $(prefix)/rtems |
---|
56 | |
---|
57 | install: install_files $(prefix)/rtems |
---|
58 | |
---|
59 | install_files:: $(GENERIC_FILES) $(MAKEFILES) |
---|
60 | @test -d $(prefix)/rtems/make || \ |
---|
61 | $(MKDIR) $(prefix)/rtems/make |
---|
62 | for f in $^; do \ |
---|
63 | $(INSTALL) -m 644 "$$f" $(prefix)/rtems/make ;\ |
---|
64 | done |
---|
65 | |
---|
66 | install_files:: $(COMPILER_FILES) |
---|
67 | @test -d $(prefix)/rtems/make/compilers || \ |
---|
68 | $(MKDIR) $(prefix)/rtems/make/compilers |
---|
69 | for f in $^; do \ |
---|
70 | $(INSTALL) -m 644 "$$f" $(prefix)/rtems/make/compilers; \ |
---|
71 | done |
---|
72 | |
---|
73 | install_files:: $(CUSTOM_FILES) |
---|
74 | @test -d $(prefix)/rtems/make/custom || \ |
---|
75 | $(MKDIR) $(prefix)/rtems/make/custom |
---|
76 | for f in $^; do \ |
---|
77 | $(INSTALL) -m 644 "$$f" $(prefix)/rtems/make/custom; \ |
---|
78 | done |
---|
79 | |
---|
80 | install_files:: $(TEMPLATE_FILES) |
---|
81 | @test -d $(prefix)/rtems/make/Templates || \ |
---|
82 | $(MKDIR) $(prefix)/rtems/make/Templates |
---|
83 | for f in $^; do \ |
---|
84 | $(INSTALL) -m 644 "$$f" $(prefix)/rtems/make/Templates; \ |
---|
85 | done |
---|