Skip to content

Commit

Permalink
lkl: avoid using file function of make for older GNU make
Browse files Browse the repository at this point in the history
With make version 4.0, make -f Makefile.autoconf crashes, and with
version 3.8, it will not create the output file (Makefile.conf) at all.

This issues are due to the (relatively) new feature of GNU make, the
file function.

This commit fixes those issue by rewriting file function statements by
echo commands.

This also fixes torvalds#403.

Fixes: 2030bf6 ("lkl tools: improve the build system")

Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
  • Loading branch information
thehajime committed Jan 6, 2018
1 parent 42365bf commit 2924878
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tools/lkl/Makefile.autoconf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ POSIX_HOSTS=elf64-x86-64 elf32-i386 elf64-x86-64-freebsd elf32-littlearm elf64-l
NT_HOSTS=pe-i386 pe-x86-64

define set_autoconf_var
$(file >> $(OUTPUT)/include/autoconf.h,#define LKL_HOST_CONFIG_$(1) $(2))
$(file >> $(OUTPUT)/tests/autoconf.sh,LKL_HOST_CONFIG_$(1)=$(2))
$(shell echo "#define LKL_HOST_CONFIG_$(1) $(2)" \
>> $(OUTPUT)/include/autoconf.h)
$(shell echo "LKL_HOST_CONFIG_$(1)=$(2)" >> $(OUTPUT)/tests/autoconf.sh)
export LKL_HOST_CONFIG_$(1)=$(2)
endef

Expand Down Expand Up @@ -85,7 +86,10 @@ define do_autoconf
$(if $(filter $(LD_FMT),$(NT_HOSTS)),$(call nt_host,$(LD_FMT)))
endef

export do_autoconf


$(OUTPUT)Makefile.conf: Makefile.autoconf
$(file > $(OUTPUT)/include/autoconf.h)
$(file > $(OUTPUT)/tests/autoconf.sh)
$(file > $(OUTPUT)/Makefile.conf,$(call do_autoconf))
$(shell echo -n "" > $(OUTPUT)/include/autoconf.h)
$(shell echo -n "" > $(OUTPUT)/tests/autoconf.sh)
@echo "$$do_autoconf" > $(OUTPUT)/Makefile.conf

0 comments on commit 2924878

Please sign in to comment.