@@ -42,107 +42,6 @@ WGET ?= wget
4242# Timestamps should be in ISO format
4343DATE =` date --rfc-3339=seconds `
4444
45- # Check that we have a correct version of make
46- # that matches at least the major version
47- LOCAL_MAKE_VERSION := $(shell $(MAKE ) --version | head -1 | cut -d' ' -f3)
48- include modules/make
49-
50- # Check we have a suitable version of gawk
51- # that's at least the same major version
52- LOCAL_GAWK_VERSION := $(shell gawk --version 2>/dev/null | head -1 | cut -d' ' -f3 | cut -d, -f1)
53- LOCAL_GAWK_MAJOR_VERSION := $(patsubst .% ,.,$(LOCAL_GAWK_VERSION ) )
54- include modules/gawk
55-
56- ifeq "" "$(filter $(make_version ) % ,$(LOCAL_MAKE_VERSION ) ) "
57- # This is incorrect local version of make
58- # Wrong make version detected -- build our local version
59- # and re-invoke the Makefile with it instead.
60- $(eval $(shell echo >&2 "$(DATE ) Wrong OS deployed make detected : $(LOCAL_MAKE_VERSION ) . Building and using $(make_version ) ..." ))
61- HEADS_MAKE := $(build ) /$(make_dir ) /make
62-
63- # How to download and build the correct version of make
64- $(packages ) /$(make_tar ) :
65- $(WGET ) -O " $@ .tmp" " $( make_url) "
66- if ! echo " $( make_hash) $@ .tmp" | sha256sum --check -; then \
67- exit 1 ; \
68- fi
69- mv " $@ .tmp" " $@ "
70-
71- $(build ) /$(make_dir ) /.extract : $(packages ) /$(make_tar )
72- tar xf " $<" -C " $( build) "
73- touch " $@ "
74-
75- $(build ) /$(make_dir ) /.patch : $(build ) /$(make_dir ) /.extract
76- ( cd " $( dir $@ ) " ; patch -p1 ) < " patches/make-$( make_version) .patch"
77- touch " $@ "
78-
79- $(build ) /$(make_dir ) /.configured : $(build ) /$(make_dir ) /.patch
80- cd " $( dir $@ ) " ; \
81- ./configure 2>&1 \
82- | tee " $( log_dir) /make.configure.log" \
83- $(VERBOSE_REDIRECT )
84- touch " $@ "
85-
86- $(HEADS_MAKE ) : $(build ) /$(make_dir ) /.configured
87- make -C " $( dir $@ ) " $(MAKE_JOBS ) \
88- 2>&1 \
89- | tee " $( log_dir) /make.log" \
90- $(VERBOSE_REDIRECT )
91-
92- # Once we have a proper Make, we can just pass arguments into it
93- all linux cpio run : $(HEADS_MAKE )
94- LANG =C MAKE=$(HEADS_MAKE ) $(HEADS_MAKE ) $(MAKE_JOBS ) $@
95- % .clean % .vol % .menuconfig : $(HEADS_MAKE )
96- LANG =C MAKE=$(HEADS_MAKE ) $(HEADS_MAKE ) $@
97-
98- bootstrap : $(HEADS_MAKE )
99- endif
100-
101- # Wrong gawk version
102- ifeq "" "$(filter $(LOCAL_GAWK_MAJOR_VERSION ) % ,$(gawk_version ) ) "
103- # Wrong gawk version detected -- build our local version
104- # and re-invoke the Makefile with it instead.
105- $(eval $(shell echo >&2 "$(DATE ) Wrong OS deployed gawk detected : $(LOCAL_GAWK_VERSION ) . Building and using $(gawk_version ) ..."))
106- HEADS_GAWK := $(build ) /$(gawk_dir ) /gawk
107-
108- # How to download and build the correct version of gawk
109- $(packages ) /$(gawk_tar ) :
110- $(WGET ) -O " $@ .tmp" " $( gawk_url) "
111- if ! echo " $( gawk_hash) $@ .tmp" | sha256sum --check -; then \
112- exit 1 ; \
113- fi
114- mv " $@ .tmp" " $@ "
115-
116- $(build ) /$(gawk_dir ) /.extract : $(packages ) /$(gawk_tar )
117- tar xf " $<" -C " $( build) "
118- touch " $@ "
119-
120- $(build ) /$(gawk_dir ) /.patch : $(build ) /$(gawk_dir ) /.extract
121- # ( cd "$(dir $@)" ; patch -p1 ) < "patches/gawk-$(gawk_version).patch"
122- touch "$@"
123-
124- $(build ) /$(gawk_dir ) /.configured : $(build ) /$(gawk_dir ) /.patch
125- cd " $( dir $@ ) " ; \
126- ./configure 2>&1 \
127- | tee " $( log_dir) /gawk.configure.log" \
128- $(VERBOSE_REDIRECT )
129- touch " $@ "
130-
131- $(HEADS_GAWK ) : $(build ) /$(gawk_dir ) /.configured
132- $(MAKE ) -C " $( dir $@ ) " $(MAKE_JOBS ) \
133- 2>&1 \
134- | tee " $( log_dir) /gawk.log" \
135- $(VERBOSE_REDIRECT )
136-
137- # Once we have a suitable version of gawk, we can rerun make
138- all linux cpio run : $(HEADS_GAWK )
139- LANG=C HEADS_GAWK=$(HEADS_GAWK ) $(MAKE ) $(MAKE_JOBS ) $@
140- % .clean % .vol % .menuconfig : $(HEADS_GAWK )
141- LANG=C HEADS_GAWK=$(HEADS_GAWK ) $(MAKE ) $@
142-
143- bootstrap : $(HEADS_GAWK )
144- endif
145-
14645BOARD ?= qemu-coreboot
14746CONFIG := $(pwd ) /boards/$(BOARD ) /$(BOARD ) .config
14847
@@ -225,20 +124,6 @@ CROSS_TOOLS_NOCC := \
225124 PKG_CONFIG_PATH="$(INSTALL ) /lib/pkgconfig" \
226125 PKG_CONFIG_SYSROOT_DIR="$(INSTALL ) " \
227126
228- ifneq "$(HEADS_GAWK ) " ""
229- CROSS_TOOLS_NOCC += AWK=$(HEADS_GAWK )
230- endif
231-
232- ifneq "$(HEADS_MAKE ) " ""
233- MAKE =$(HEADS_MAKE )
234- endif
235-
236- # Some debugging info in link with locally built versions and usage for the rest Heads build:
237- $(eval $(shell echo >&2 "$(DATE ) Local built HEADS_GAWK only if different then provided by OS : $(HEADS_GAWK ) "))
238- $(eval $(shell echo >&2 "$(DATE ) Local built HEADS_MAKE only if different then provided by OS : $(HEADS_MAKE ) "))
239- $(eval $(shell echo >&2 "$(DATE ) Heads build system will call make from now on as : MAKE: $(MAKE ) ." ))
240-
241-
242127CROSS_TOOLS := \
243128 CC="$(heads_cc ) " \
244129 $(CROSS_TOOLS_NOCC ) \
0 commit comments