-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass of Lua53 changes to make runable Lua53
- Loading branch information
Showing
68 changed files
with
2,813 additions
and
1,452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
############################################################# | ||
# Required variables for each makefile | ||
# Discard this section from all parent makefiles | ||
# Expected variables (with automatic defaults): | ||
# CSRCS (all "C" files in the dir) | ||
# SUBDIRS (all subdirs with a Makefile) | ||
# GEN_LIBS - list of libs to be generated () | ||
# GEN_IMAGES - list of images to be generated () | ||
# COMPONENTS_xxx - a list of libs/objs in the form | ||
# subdir/lib to be extracted and rolled up into | ||
# a generated lib/image xxx.a () | ||
# | ||
ifndef PDIR | ||
SUBDIRS = host | ||
GEN_LIBS = liblua.a | ||
endif | ||
|
||
STD_CFLAGS=-std=gnu11 -Wimplicit -Wall | ||
|
||
############################################################# | ||
# Configuration i.e. compile options etc. | ||
# Target specific stuff (defines etc.) goes in here! | ||
# | ||
#DEFINES += -DDEVELOPMENT_TOOLS -DDEVELOPMENT_USE_GDB -DDEVELOPMENT_BREAK_ON_STARTUP_PIN=1 | ||
#EXTRA_CCFLAGS += -ggdb -O0 | ||
|
||
############################################################# | ||
# Recursion Magic - Don't touch this!! | ||
# | ||
|
||
INCLUDES := $(INCLUDES) -I $(PDIR)include | ||
INCLUDES += -I ./ | ||
INCLUDES += -I ../spiffs | ||
INCLUDES += -I ../libc | ||
INCLUDES += -I ../modules | ||
INCLUDES += -I ../platform | ||
INCLUDES += -I ../uzlib | ||
PDIR := ../$(PDIR) | ||
sinclude $(PDIR)Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# | ||
# This Makefile 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: | ||
|
||
CCFLAGS:= -I. -I.. -I../../include -I../../uzlib | ||
LDFLAGS:= -L$(SDK_DIR)/lib -L$(SDK_DIR)/ld -lm -ldl -Wl,-Map=mapfile | ||
|
||
CCFLAGS += -Wall | ||
|
||
TARGET = host | ||
|
||
VERBOSE ?= | ||
V ?= $(VERBOSE) | ||
ifeq ("$(V)","1") | ||
export summary := @true | ||
else | ||
export summary := @echo | ||
# disable echoing of commands, directory names | ||
# MAKEFLAGS += --silent -w | ||
endif # $(V)==1 | ||
|
||
DEBUG ?= | ||
ifeq ("$(DEBUG)","1") | ||
FLAVOR = debug | ||
CCFLAGS += -O0 -ggdb | ||
TARGET_LDFLAGS += -O0 -ggdb | ||
DEFINES += -DLUA_DEBUG_BUILD -DDEVELOPMENT_TOOLS -DDEVELOPMENT_USE_GDB | ||
else | ||
FLAVOR = release | ||
CCFLAGS += -O2 | ||
TARGET_LDFLAGS += -O2 | ||
endif # DEBUG | ||
|
||
LUACSRC := luac.c lflashimg.c liolib.c loslib.c | ||
LUASRC := lapi.c lauxlib.c lbaselib.c lcode.c lcorolib.c lctype.c \ | ||
ldblib.c ldebug.c ldo.c ldump.c lfunc.c lgc.c \ | ||
linit.c llex.c lmathlib.c lmem.c loadlib.c lnodemcu.c \ | ||
lobject.c lopcodes.c lparser.c lstate.c lstring.c lstrlib.c \ | ||
ltable.c ltablib.c ltm.c lundump.c lutf8lib.c lvm.c \ | ||
lzio.c | ||
UZSRC := uzlib_deflate.c crc32.c | ||
|
||
TEST ?= | ||
ifeq ("$(TEST)","1") | ||
DEFINES += -DLUA_ENABLE_TEST | ||
LUASRC += ltests.c | ||
endif # $(TEST)==1 | ||
|
||
# | ||
# This relies on the files being unique on the vpath | ||
# | ||
SRC := $(LUACSRC) $(LUASRC) $(UZSRC) | ||
vpath %.c .:..:../../libc:../../uzlib | ||
|
||
ODIR := .output/$(TARGET)/$(FLAVOR)/obj | ||
|
||
OBJS := $(SRC:%.c=$(ODIR)/%.o) | ||
DEPS := $(SRC:%.c=$(ODIR)/%.d) | ||
|
||
CFLAGS = $(CCFLAGS) $(DEFINES) $(EXTRA_CCFLAGS) $(STD_CFLAGS) $(INCLUDES) | ||
DFLAGS = $(CCFLAGS) $(DDEFINES) $(EXTRA_CCFLAGS) $(STD_CFLAGS) $(INCLUDES) | ||
|
||
CC := $(WRAPCC) gcc | ||
|
||
ECHO := echo | ||
|
||
BUILD_TYPE := $(shell $(CC) $(EXTRA_CCFLAGS) -E -dM - <../../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 | ||
|
||
all: $(DEPS) $(IMAGE) | ||
|
||
$(IMAGE) : $(OBJS) | ||
$(summary) HOSTLD $@ | ||
$(CC) $(OBJS) -o $@ $(LDFLAGS) | ||
|
||
test : | ||
@echo CC: $(CC) | ||
@echo SRC: $(SRC) | ||
@echo OBJS: $(OBJS) | ||
@echo DEPS: $(DEPS) | ||
@echo IMAGE: $(IMAGE) | ||
|
||
clean : | ||
$(RM) -r $(ODIR) | ||
|
||
ifneq ($(MAKECMDGOALS),clean) | ||
-include $(DEPS) | ||
endif | ||
|
||
$(ODIR)/%.o: %.c | ||
@mkdir -p $(ODIR); | ||
$(summary) HOSTCC $(CURDIR)/$< | ||
$(CC) $(if $(findstring $<,$(DSRCS)),$(DFLAGS),$(CFLAGS)) $(COPTS_$(*F)) -o $@ -c $< | ||
|
||
$(ODIR)/%.d: %.c | ||
@mkdir -p $(ODIR); | ||
$(summary) DEPEND: HOSTCC $(CURDIR)/$< | ||
@set -e; rm -f $@; \ | ||
$(CC) -M $(CFLAGS) $< > $@.$$$$; \ | ||
sed 's,\($*\.o\)[ :]*,$(ODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \ | ||
rm -f $@.$$$$ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.