Skip to content

Commit

Permalink
create luac.cross.{integer|float} (#2450)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
HHHartmann authored and TerryE committed Aug 11, 2018
1 parent a57fe55 commit 91656c3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
12 changes: 9 additions & 3 deletions 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:
Expand Down Expand Up @@ -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

Expand All @@ -65,6 +70,7 @@ test :
@echo SRC: $(SRC)
@echo OBJS: $(OBJS)
@echo DEPS: $(DEPS)
@echo IMAGE: $(IMAGE)

clean :
$(RM) -r $(ODIR)
Expand Down
4 changes: 4 additions & 0 deletions local/lua/.gitignore
@@ -0,0 +1,4 @@
# Ignore everything
*
# But not this file itself.
!.gitignore
15 changes: 11 additions & 4 deletions tools/Makefile
Expand Up @@ -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 =
Expand All @@ -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
Expand All @@ -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
#
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 91656c3

Please sign in to comment.