From 91656c3d7638c94c474cad1ed3af747aa5a3ccc8 Mon Sep 17 00:00:00 2001 From: Gregor Hartmann Date: Sat, 11 Aug 2018 19:28:01 +0200 Subject: [PATCH] create luac.cross.{integer|float} (#2450) Use separate names for the integer and float `luac.cross` binaries. Also adds local/lua directory which is already supported by tools makefile to build LFS image. --- app/lua/luac_cross/Makefile | 12 +++++++++--- local/lua/.gitignore | 4 ++++ tools/Makefile | 15 +++++++++++---- 3 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 local/lua/.gitignore diff --git a/app/lua/luac_cross/Makefile b/app/lua/luac_cross/Makefile index 22f8a684..c1f08cc1 100644 --- a/app/lua/luac_cross/Makefile +++ b/app/lua/luac_cross/Makefile @@ -1,7 +1,7 @@ # -# This Make file is called from the core Makefile hierarchy with is a hierarchical -# make wwhich uses parent callbacks to implement inheritance. However is luac_cross -# build stands outside this and uses the host toolchain to implement a separate +# This Make file is called from the core Makefile hierarchy which is a hierarchical +# make which uses parent callbacks to implement inheritance. However if luac_cross +# build stands outside this it uses the host toolchain to implement a separate # host build of the luac.cross image. # .NOTPARALLEL: @@ -51,7 +51,12 @@ CC := $(WRAPCC) gcc ECHO := echo +BUILD_TYPE := $(shell $(CC) $(EXTRA_CCFLAGS) -E -dM - <../../../app/include/user_config.h | grep LUA_NUMBER_INTEGRAL | wc -l) +ifeq ($(BUILD_TYPE),0) IMAGE := ../../../luac.cross +else +IMAGE := ../../../luac.cross.int +endif .PHONY: test clean all @@ -65,6 +70,7 @@ test : @echo SRC: $(SRC) @echo OBJS: $(OBJS) @echo DEPS: $(DEPS) + @echo IMAGE: $(IMAGE) clean : $(RM) -r $(ODIR) diff --git a/local/lua/.gitignore b/local/lua/.gitignore new file mode 100644 index 00000000..ffcaad4c --- /dev/null +++ b/local/lua/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything +* +# But not this file itself. +!.gitignore diff --git a/tools/Makefile b/tools/Makefile index b00f7a32..8a784ce3 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -2,8 +2,8 @@ # Options # -FSSOURCE ?= ../local/fs/ -LUASOURCE ?= ../local/lua/ +FSSOURCE ?= ../local/fs +LUASOURCE ?= ../local/lua FLASHSIZE ?= 4mb 32mb 8mb FLASH_SW = -S SUBDIRS = @@ -14,7 +14,7 @@ OBJDUMP = $(or $(shell which objdump),xtensa-lx106-elf-objdump) # Get the files to pack into the spiffs image # -SPIFFSFILES ?= $(patsubst $(FSSOURCE)%,%,$(shell find $(FSSOURCE) -name '*' '!' -name .gitignore )) +SPIFFSFILES ?= $(patsubst $(FSSOURCE)/%,%,$(shell find $(FSSOURCE)/ -name '*' '!' -name .gitignore )) ################################################################# # Get the filesize of /bin/0x10000.bin and SPIFFS sizing @@ -36,6 +36,13 @@ endif LFSSOURCES := $(wildcard $(LUASOURCE)/*.lua) +BUILD_TYPE := $(shell $(CC) $(EXTRA_CCFLAGS) -E -dM - <../app/include/user_config.h | grep LUA_NUMBER_INTEGRAL | wc -l) +ifeq ($(BUILD_TYPE),0) +LUAC_CROSS := ../luac.cross +else +LUAC_CROSS := ../luac.cross.int +endif + ############################################################# # Rules base # @@ -72,7 +79,7 @@ spiffsscript: remove-image LFSimage spiffsimg/spiffsimg ifneq ($(LFSSOURCES),) LFSimage: $(LFSSOURCES) - ../luac.cross -f -o $(FSSOURCE)flash.img $(LFSSOURCES) + $(LUAC_CROSS) -f -o $(FSSOURCE)flash.img $(LFSSOURCES) else LFSimage: rm -f $(FSSOURCE)flash.img