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 | VPATH = @srcdir@ |
---|
11 | RTEMS_ROOT = @top_srcdir@ |
---|
12 | PROJECT_ROOT = @PROJECT_ROOT@ |
---|
13 | |
---|
14 | include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg |
---|
15 | include $(RTEMS_ROOT)/make/leaf.cfg |
---|
16 | |
---|
17 | CLEAN_ADDITIONS += |
---|
18 | CLOBBER_ADDITIONS += |
---|
19 | |
---|
20 | # NOTE: No need to prepend $(srcdir) to file names, |
---|
21 | # VPATH handles the paths for us. |
---|
22 | # NOTE: Only the files really need get installed. |
---|
23 | |
---|
24 | GENERIC_FILES := host.cfg target.cfg |
---|
25 | |
---|
26 | MAKEFILES := README \ |
---|
27 | directory.cfg leaf.cfg \ |
---|
28 | lib.cfg main.cfg |
---|
29 | |
---|
30 | # NOTE: Use the wildcard rule to install all custom files |
---|
31 | # CUSTOM_FILES := $(wildcard $(srcdir)/custom/*.cfg) |
---|
32 | |
---|
33 | # NOTE: This should be sufficient, but may fail for some BSPS: |
---|
34 | # Get all custom files for the BSP family, they may depend on each other |
---|
35 | #CUSTOM_FILES := custom/default.cfg $(patsubst %,custom/%.cfg, posix) |
---|
36 | |
---|
37 | # This version of the rule is pretty ugly but I think it works ALL the time. |
---|
38 | # + Figure out what this BSP.cfg includes |
---|
39 | # + Make those files have the correct relative path. |
---|
40 | # + Now fix $(RTEMS_HOST) to the real host name |
---|
41 | CUSTOM_FILES := custom/default.cfg custom/$(RTEMS_BSP).cfg \ |
---|
42 | $(shell grep "^include.*make/custom" $(srcdir)/custom/$(RTEMS_BSP).cfg | \ |
---|
43 | sed -e 's/^.*make\///' | sed -e s/\\$$\(RTEMS_HOST\)/${RTEMS_HOST}/) |
---|
44 | |
---|
45 | # NOTE: Use the wildcard rule to install all compiler files |
---|
46 | # COMPILER_FILES := $(wildcard $(srcdir)/compilers/*.cfg) |
---|
47 | COMPILER_FILES := $(CONFIG.$(TARGET_ARCH).CC) $(CONFIG.$(HOST_ARCH).CC) |
---|
48 | |
---|
49 | # NOTE: Don't use a wildcard rule here, otherwise Templates/Makefile.inc |
---|
50 | # will be installed, too |
---|
51 | TEMPLATE_FILES := \ |
---|
52 | Templates/Makefile.dir \ |
---|
53 | Templates/Makefile.leaf \ |
---|
54 | Templates/Makefile.lib |
---|
55 | |
---|
56 | get: retrieve |
---|
57 | |
---|
58 | all: |
---|
59 | |
---|
60 | $(prefix)/rtems: |
---|
61 | @INSTALL@ $(INSTDIRFLAGS) $@ |
---|
62 | |
---|
63 | install: $(prefix)/rtems \ |
---|
64 | $(prefix)/rtems/make \ |
---|
65 | $(prefix)/rtems/make/compilers \ |
---|
66 | $(prefix)/rtems/make/custom \ |
---|
67 | $(prefix)/rtems/make/Templates \ |
---|
68 | install_files |
---|
69 | |
---|
70 | $(prefix)/rtems/make: |
---|
71 | @INSTALL@ $(INSTDIRFLAGS) $@ |
---|
72 | |
---|
73 | install_files:: $(GENERIC_FILES) $(MAKEFILES) |
---|
74 | @INSTALL@ $(INSTDATAFLAGS) $^ \ |
---|
75 | $(prefix)/rtems/make |
---|
76 | |
---|
77 | $(prefix)/rtems/make/compilers: |
---|
78 | @INSTALL@ $(INSTDIRFLAGS) $@ |
---|
79 | |
---|
80 | install_files:: $(COMPILER_FILES) |
---|
81 | @INSTALL@ $(INSTDATAFLAGS) $^ \ |
---|
82 | $(prefix)/rtems/make/compilers |
---|
83 | |
---|
84 | $(prefix)/rtems/make/custom: |
---|
85 | @INSTALL@ $(INSTDIRFLAGS) $@ |
---|
86 | |
---|
87 | install_files:: $(CUSTOM_FILES) |
---|
88 | @INSTALL@ $(INSTDATAFLAGS) $^ \ |
---|
89 | $(prefix)/rtems/make/custom |
---|
90 | |
---|
91 | $(prefix)/rtems/make/Templates: |
---|
92 | @INSTALL@ $(INSTDIRFLAGS) $@ |
---|
93 | |
---|
94 | |
---|
95 | install_files:: $(TEMPLATE_FILES) |
---|
96 | @INSTALL@ $(INSTDATAFLAGS) $^ \ |
---|
97 | $(prefix)/rtems/make/Templates |
---|