Unverified Commit 759e1d7b authored by Jean-Andre Santoni's avatar Jean-Andre Santoni Committed by GitHub
Browse files

Clean makefile and check luajit builds (#164)

parent f5502033
...@@ -17,6 +17,12 @@ jobs: ...@@ -17,6 +17,12 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: make -j4 - run: make -j4
build_linux_jit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make WANT_JIT=1 -j4
build_linux_armv7_neon: build_linux_armv7_neon:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: dockcross/linux-armv7 container: dockcross/linux-armv7
...@@ -24,15 +30,34 @@ jobs: ...@@ -24,15 +30,34 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: make platform=unix-armv7-neon-hardfloat -j4 - run: make platform=unix-armv7-neon-hardfloat -j4
# build_linux_armv7_neon_jit:
# runs-on: ubuntu-latest
# container: dockcross/linux-armv7
# steps:
# - uses: actions/checkout@v2
# - run: make WANT_JIT=1 platform=unix-armv7-neon-hardfloat -j4
build_osx: build_osx:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: make platform=osx -j4 - run: make platform=osx -j4
build_osx_jit:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- run: make WANT_JIT=1 platform=osx -j4
build_windows: build_windows:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: CC=gcc make platform=win -j4 - run: CC=gcc make platform=win -j4
build_windows_jit:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- run: CC=gcc make WANT_JIT=1 platform=win -j4
...@@ -55,10 +55,6 @@ ifeq ($(platform), unix) ...@@ -55,10 +55,6 @@ ifeq ($(platform), unix)
LUA_SYSCFLAGS := -DLUA_USE_POSIX LUA_SYSCFLAGS := -DLUA_USE_POSIX
HAVE_INOTIFY=1 HAVE_INOTIFY=1
LDFLAGS += -Wl,-E LDFLAGS += -Wl,-E
ifeq ($(ARCH), $(filter $(ARCH), intel))
WANT_JIT = 1
endif
else ifeq ($(platform), linux-portable) else ifeq ($(platform), linux-portable)
TARGET := $(TARGET_NAME)_libretro.so TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC -nostdlib fpic := -fPIC -nostdlib
...@@ -88,7 +84,7 @@ ifeq ($(archs),ppc) ...@@ -88,7 +84,7 @@ ifeq ($(archs),ppc)
endif endif
endif endif
ifeq ($(CROSS_COMPILE),1) ifeq ($(CROSS_COMPILE),1)
TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT) TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT)
CC += $(TARGET_RULE) CC += $(TARGET_RULE)
CFLAGS += $(TARGET_RULE) CFLAGS += $(TARGET_RULE)
...@@ -97,11 +93,11 @@ endif ...@@ -97,11 +93,11 @@ endif
LDFLAGS += $(TARGET_RULE) LDFLAGS += $(TARGET_RULE)
LUA_SYSCFLAGS += $(TARGET_RULE) LUA_SYSCFLAGS += $(TARGET_RULE)
CFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS CFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS
else else
ifeq ($(shell uname -p),arm) ifeq ($(shell uname -p),arm)
CFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS CFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS
endif endif
endif endif
CFLAGS += $(ARCHFLAGS) CFLAGS += $(ARCHFLAGS)
CXXFLAGS += $(ARCHFLAGS) CXXFLAGS += $(ARCHFLAGS)
...@@ -320,7 +316,9 @@ LUALIB := $(LUADIR)/liblua.a ...@@ -320,7 +316,9 @@ LUALIB := $(LUADIR)/liblua.a
ifeq ($(WANT_JIT),1) ifeq ($(WANT_JIT),1)
LUADIR := deps/luajit/src LUADIR := deps/luajit/src
LUALIB := $(LUADIR)/libluajit.a LUALIB := $(LUADIR)/libluajit.a
LIBS += -ldl ifeq ($(platform), unix)
LIBS += -ldl
endif
CFLAGS += -DHAVE_JIT CFLAGS += -DHAVE_JIT
endif endif
...@@ -368,9 +366,9 @@ else ...@@ -368,9 +366,9 @@ else
endif endif
deps/lua/src/liblua.a: deps/lua/src/liblua.a:
$(MAKE) -C deps/lua/src CC="$(CC) $(LUADEFINES)" CXX="$(CXX)" MYCFLAGS="$(LUA_MYCFLAGS) -w -g $(fpic)" MYLDFLAGS="$(LDFLAGS) $(fpic)" SYSCFLAGS="$(LUA_SYSCFLAGS) $(fpic)" liblua.a $(MAKE) -C deps/lua/src CC="$(CC) $(LUADEFINES)" CXX="$(CXX)" MYCFLAGS="$(LUA_MYCFLAGS) -w $(fpic)" MYLDFLAGS="$(LDFLAGS) $(fpic)" SYSCFLAGS="$(LUA_SYSCFLAGS) $(fpic)" liblua.a
deps/luajit/src/libluajit.a: deps/luajit/src/libluajit.a:
$(MAKE) -C deps/luajit/src BUILDMODE=static CFLAGS="$(LUA_MYCFLAGS) $(fpic)" Q= LDFLAGS="$(fpic)" $(MAKE) -C deps/luajit/src CC="$(CC)" CXX="$(CXX)" BUILDMODE=static CFLAGS="$(LUA_MYCFLAGS) -w $(fpic)" Q= LDFLAGS="$(LDFLAGS) $(fpic)" libluajit.a
obj/%.o: %.c obj/%.o: %.c
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
...@@ -381,26 +379,6 @@ clean: ...@@ -381,26 +379,6 @@ clean:
-rm -f $(OBJS) $(TARGET) -rm -f $(OBJS) $(TARGET)
-rm -rf obj -rm -rf obj
docker-build:
@docker build -t libretro-lutro .
docker: docker-build
@docker run -it \
-v $(CURDIR):/app \
libretro-lutro \
make
docker-test: docker
@docker run -it \
-v $(CURDIR):/app \
--name retroarch \
libretro-lutro \
retroarch -L lutro_libretro.so test/unit
docker-kill:
@-docker kill retroarch
@-docker rm -f retroarch
test: all test: all
retroarch --verbose -L lutro_libretro.so test/main.lua retroarch --verbose -L lutro_libretro.so test/main.lua
......
...@@ -29,10 +29,6 @@ Compile Lutro by [installing the RetroArch dependencies](https://github.com/libr ...@@ -29,10 +29,6 @@ Compile Lutro by [installing the RetroArch dependencies](https://github.com/libr
make make
To compile with [Docker](https://www.docker.com/), use:
make docker
## Test ## Test
Run the Lutro testing suite by executing: Run the Lutro testing suite by executing:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment