Browse Source

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.
Gregor Hartmann 5 years ago
parent
commit
91656c3d76
3 changed files with 24 additions and 7 deletions
  1. 9 3
      app/lua/luac_cross/Makefile
  2. 4 0
      local/lua/.gitignore
  3. 11 4
      tools/Makefile

+ 9 - 3
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)

+ 4 - 0
local/lua/.gitignore

@@ -0,0 +1,4 @@
+# Ignore everything
+*
+# But not this file itself.
+!.gitignore

+ 11 - 4
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