summaryrefslogtreecommitdiffstats
path: root/make/Makefile.in
blob: b765bd8e7cddf2fc5d4b0d39ca8efa0641939b8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
#  $Id$
#
# Not strictly necessary to pull in this stuff.  But it helps with
#  working with the templates and poking around.
#

@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ..
subdir = make

INSTALL = @INSTALL@

RTEMS_ROOT = $(top_srcdir)/@RTEMS_TOPdir@
PROJECT_ROOT = @PROJECT_ROOT@

VPATH = @srcdir@

include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
include $(RTEMS_ROOT)/make/leaf.cfg

CLEAN_ADDITIONS +=
CLOBBER_ADDITIONS +=

# NOTE: No need to prepend $(srcdir) to file names, 
#       VPATH handles the paths for us.
# NOTE: Only the files really need get installed.

GENERIC_FILES := host.cfg target.cfg

MAKEFILES := README \
	directory.cfg leaf.cfg \
	lib.cfg main.cfg

# NOTE: Use the wildcard rule to install all custom files
# CUSTOM_FILES := $(wildcard $(srcdir)/custom/*.cfg)

# NOTE: This should be sufficient, but may fail for some BSPS:
#       Get all custom files for the BSP family, they may depend on each other
#CUSTOM_FILES := custom/default.cfg $(patsubst %,custom/%.cfg, posix)

#  This version of the rule is pretty ugly but I think it works ALL the time.
#      + Figure out what this BSP.cfg includes
#      + Make those files have the correct relative path.
#      + Now fix $(RTEMS_HOST) to the real host name
CUSTOM_FILES := custom/default.cfg custom/$(RTEMS_BSP).cfg \
   $(shell grep "^include.*make/custom" $(srcdir)/custom/$(RTEMS_BSP).cfg | \
    sed -e 's/^.*make\///' | sed -e s/\\$$\(RTEMS_HOST\)/${RTEMS_HOST}/)

# NOTE: Use the wildcard rule to install all compiler files
# COMPILER_FILES := $(wildcard $(srcdir)/compilers/*.cfg)
COMPILER_FILES := $(CONFIG.$(TARGET_ARCH).CC) $(CONFIG.$(HOST_ARCH).CC)

# NOTE: Don't use a wildcard rule here, otherwise Templates/Makefile.inc 
#       will be installed, too
TEMPLATE_FILES := \
	Templates/Makefile.dir \
	Templates/Makefile.leaf \
        Templates/Makefile.lib

get: retrieve

all: 

$(prefix):
	@top_srcdir@/mkinstalldirs $@

install: $(prefix) \
	$(prefix)/make \
	$(prefix)/make/compilers \
	$(prefix)/make/custom \
	$(prefix)/make/Templates \
	install_files

$(prefix)/make:
	@top_srcdir@/mkinstalldirs $@

install_files::	$(GENERIC_FILES) $(MAKEFILES)
	$(INSTALL_DATA) $^ $(prefix)/make

$(prefix)/make/compilers:
	@top_srcdir@/mkinstalldirs $@

install_files:: $(COMPILER_FILES)
	$(INSTALL_DATA) $^ $(prefix)/make/compilers

$(prefix)/make/custom:
	@top_srcdir@/mkinstalldirs $@

install_files:: $(CUSTOM_FILES) 
	$(INSTALL_DATA) $^ $(prefix)/make/custom

$(prefix)/make/Templates:
	@top_srcdir@/mkinstalldirs $@

install_files:: $(TEMPLATE_FILES)
	$(INSTALL_DATA) $^ $(prefix)/make/Templates

Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	cd $(top_builddir) \
	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status