-
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.
added MSVC project configuration for host-side tools (#2665)
Added MSVC project configuration (@ziggurat29) and support of MinGW (@TerryE) for host-side`luac.cross` tool
- Loading branch information
1 parent
30ff0a1
commit 62789da
Showing
15 changed files
with
713 additions
and
16 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
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,72 @@ | ||
# | ||
# This is a minimal Make file designed to be called from within a MinGW Cmd prompt. | ||
# So if the distro ZIP file has been unpacked into C:\nodemcu-firmware then | ||
# | ||
# C:\nodemcu-firmware\app\lua\luac_cross> mingw32-make -f mingw32-makefile.mak | ||
# | ||
# will create the WinX EXE luac.cross.exe within the root C:\nodemcu-firmware folder. | ||
# This make has been stripped down to use the basic non-graphics MinGW32 install and | ||
# standard Windows commands available at the Cmd> prompt. This make is quite separate | ||
# from the normal toolchain build. | ||
|
||
.NOTPARALLEL: | ||
|
||
CCFLAGS:= -I.. -I../../include -I../../libc -I../../uzlib -Wall | ||
LDFLAGS:= -lm -Wl,-Map=mapfile | ||
DEFINES += -DLUA_CROSS_COMPILER -DLUA_OPTIMIZE_MEMORY=2 | ||
|
||
CFLAGS = $(CCFLAGS) $(DEFINES) $(EXTRA_CCFLAGS) $(STD_CFLAGS) $(INCLUDES) | ||
|
||
TARGET = host | ||
CC := gcc | ||
|
||
ifeq ($(FLAVOR),debug) | ||
CCFLAGS += -O0 -g | ||
TARGET_LDFLAGS += -O0 -g | ||
DEFINES += -DLUA_DEBUG_BUILD | ||
else | ||
FLAVOR = release | ||
CCFLAGS += -O2 | ||
TARGET_LDFLAGS += -O2 | ||
endif | ||
# | ||
# C files needed to compile luac.cross | ||
# | ||
LUACSRC := luac.c lflashimg.c liolib.c loslib.c print.c | ||
LUASRC := lapi.c lauxlib.c lbaselib.c lcode.c ldblib.c ldebug.c \ | ||
ldo.c ldump.c lfunc.c lgc.c linit.c llex.c \ | ||
lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c lparser.c \ | ||
lrotable.c lstate.c lstring.c lstrlib.c ltable.c ltablib.c \ | ||
ltm.c lundump.c lvm.c lzio.c | ||
LIBCSRC := c_stdlib.c | ||
UZSRC := uzlib_deflate.c crc32.c | ||
# | ||
# This relies on the files being unique on the vpath | ||
# | ||
SRC := $(LUACSRC) $(LUASRC) $(LIBCSRC) $(UZSRC) | ||
|
||
vpath %.c .:..:../../libc:../../uzlib | ||
|
||
INCS := -I.. -I../.. -I../../libc -I../../uzlib | ||
ODIR := .output\obj | ||
OBJS := $(SRC:%.c=$(ODIR)/%.o) | ||
IMAGE := ../../../luac.cross.exe | ||
|
||
.PHONY: test clean all | ||
|
||
all: $(DEPS) $(IMAGE) | ||
|
||
$(IMAGE) : $(OBJS) | ||
$(CC) $(OBJS) -o $@ $(LDFLAGS) | ||
|
||
test : | ||
@echo CC: $(CC) | ||
@echo SRC: $(SRC) | ||
@echo OBJS: $(OBJS) | ||
|
||
clean : | ||
del /s /q $(ODIR) | ||
|
||
$(ODIR)/%.o: %.c | ||
@mkdir $(ODIR) || echo . | ||
$(CC) $(INCS) $(CFLAGS) -o $@ -c $< |
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,8 @@ | ||
.vs/ | ||
*/Win32/ | ||
*/x64/ | ||
|
||
*.vcxproj.user | ||
|
||
*.lua | ||
*.img |
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,30 @@ | ||
These are MSVC (Visual Studio 2017) project files for the host-side tools, | ||
namely 'luac.cross' and 'spiffsimg'. Some may find these convenient if they | ||
already have MSVC instead of, say, setting up a Cygwin or MingW build | ||
system. | ||
|
||
To build 'luac.cross', you must first edit app/include/user_config.h to make | ||
some choices about the kind of cross-compiler you are generating. | ||
|
||
In particular, the definition of | ||
LUA_FLASH_STORE | ||
should be enabled if you are creating a cross-compiler for generating images | ||
for the Lua File Storage (LFS). The specific value of this define is not | ||
critical for luac.cross, but it's existence is if you want to be able to | ||
generate appropriate code for LFS. | ||
|
||
Be aware that the codebase, as checked in, has LUA_FLASH_STORE undefined. | ||
Since it is expected that most folks wanting a host-side luac.cross is | ||
for LFS use, you will want to first make sure that is changed to be | ||
defined. | ||
|
||
Secondly, if you are wanting to generate code that is appropriate for an | ||
integer-only build, you should ensure that | ||
LUA_NUMBER_INTEGRAL | ||
is defined. | ||
|
||
After altering those settings, you can build using the hosttools.sln file in | ||
the Visual Studio UI, or directly on the command line. x86 and x64 targets | ||
are provisioned, though there isn't anything to be gained with the 64-bit | ||
build. | ||
|
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,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28307.168 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "luac-cross", "luac-cross\luac-cross.vcxproj", "{78A3411A-A18F-41A4-B4A7-D76B273F0E44}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{78A3411A-A18F-41A4-B4A7-D76B273F0E44}.Debug|x64.ActiveCfg = Debug|x64 | ||
{78A3411A-A18F-41A4-B4A7-D76B273F0E44}.Debug|x64.Build.0 = Debug|x64 | ||
{78A3411A-A18F-41A4-B4A7-D76B273F0E44}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{78A3411A-A18F-41A4-B4A7-D76B273F0E44}.Debug|x86.Build.0 = Debug|Win32 | ||
{78A3411A-A18F-41A4-B4A7-D76B273F0E44}.Release|x64.ActiveCfg = Release|x64 | ||
{78A3411A-A18F-41A4-B4A7-D76B273F0E44}.Release|x64.Build.0 = Release|x64 | ||
{78A3411A-A18F-41A4-B4A7-D76B273F0E44}.Release|x86.ActiveCfg = Release|Win32 | ||
{78A3411A-A18F-41A4-B4A7-D76B273F0E44}.Release|x86.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {FC69D912-B682-4325-8FBC-1A887364B511} | ||
EndGlobalSection | ||
EndGlobal |
Oops, something went wrong.