Skip to content

Instantly share code, notes, and snippets.

@Youka
Created March 3, 2016 06:35
Show Gist options
  • Select an option

  • Save Youka/eb7dba79b381e75a8bd5 to your computer and use it in GitHub Desktop.

Select an option

Save Youka/eb7dba79b381e75a8bd5 to your computer and use it in GitHub Desktop.
Lua 5.3 cross-platform build
CC= i686-w64-mingw32-gcc
CFLAGS= -O3 -Wall -Wextra -std=gnu99 -DLUA_COMPAT_5_2
AR= ar rc
MKDIR= mkdir -p
RM= rm -rf
INSTALL= $(CURDIR)/install
SOURCES= lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c ltm.c lundump.c lvm.c lzio.c lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c lmathlib.c loslib.c lstrlib.c ltablib.c lutf8lib.c loadlib.c linit.c
OBJECTS= $(subst .c,.o,$(SOURCES))
install: all
$(MKDIR) $(INSTALL)/include
cd src && cp --target-directory=$(INSTALL)/include lua.h lualib.h lauxlib.h lua.hpp luaconf.h
$(MKDIR) $(INSTALL)/lib
cd src && $(AR) $(INSTALL)/lib/liblua.a $(OBJECTS)
all:
cd src && $(CC) $(CFLAGS) -c $(SOURCES)
clean:
cd src && $(RM) *.o
distclean: clean
$(RM) $(INSTALL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment