Skip to content

Commit

Permalink
Move Libretro makefile, add test recipe
Browse files Browse the repository at this point in the history
Move the makefile to follow the conventions of the Libetro buildbot.
  • Loading branch information
ehmry authored and pdewacht committed Jan 22, 2019
1 parent e456f52 commit e7bf0bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,9 +1,9 @@
risc
*.img
/Libretro/libretro.o
/Libretro/oberon_libretro.so
*.so
/src/disk.o
/src/pclink.o
/src/raw-serial.o
/src/risc-fp.o
/src/risc.o
/Libretro/libretro.o
19 changes: 13 additions & 6 deletions Libretro/Makefile → Makefile.libretro
Expand Up @@ -39,7 +39,7 @@ LIBS += -lm
endif
endif

CORE_DIR := ..
CORE_DIR := .

GIT_VERSION := " $(shell cd $(CORE_DIR); git log -1 --pretty='%cd %h' --date=short || echo unknown)"
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
Expand All @@ -48,14 +48,16 @@ ifeq ($(LAGFIX),1)
CFLAGS += -DLAGFIX
endif

LINK_SCRIPT := $(CORE_DIR)/Libretro/link.T

# Genode
ifeq ($(platform), genode)
TARGET := $(TARGET_NAME)_libretro.lib.so
PKG_CONFIG_LIBS := genode-lib genode-libc
CFLAGS += -D__GENODE__
CFLAGS += $(shell pkg-config --cflags $(PKG_CONFIG_LIBS))

LDFLAGS += -shared --version-script=link.T
LDFLAGS += -shared --version-script=$(CORE_DIR)/Libretro/link.T
LDFLAGS += $(shell pkg-config --libs $(PKG_CONFIG_LIBS))

CC = /usr/local/genode-gcc/bin/genode-x86-gcc
Expand All @@ -72,7 +74,7 @@ else ifneq (,$(findstring unix,$(platform)))
CC = gcc
SHARED := -shared -z defs
else
SHARED := -shared --version-script=link.T
SHARED := -shared --version-script=$(LINK_SCRIPT)
endif
ifneq ($(findstring Haiku,$(shell uname -a)),)
LIBS :=
Expand Down Expand Up @@ -139,7 +141,7 @@ else ifeq ($(platform), theos_ios)
else ifeq ($(platform), qnx)
TARGET := $(TARGET_NAME)_libretro_$(platform).so
fpic := -fPIC
SHARED := -shared --version-script=link.T
SHARED := -shared --version-script=$(LINK_SCRIPT)
CC = qcc -Vgcc_notarmv7le
AR = QCC -Vgcc_ntoarmv7le
CFLAGS += -D__BLACKBERRY_QNX__
Expand Down Expand Up @@ -424,7 +426,7 @@ CFLAGS += -D_CRT_SECURE_NO_DEPRECATE
else
TARGET := $(TARGET_NAME)_libretro.dll
CC =? gcc
SHARED := -shared -static-libgcc -s --version-script=link.T
SHARED := -shared -static-libgcc -s --version-script=$(LINK_SCRIPT)
endif

ifeq ($(DEBUG), 1)
Expand All @@ -451,7 +453,7 @@ else
endif
endif

include Makefile.common
include $(CORE_DIR)/Libretro/Makefile.common

OBJECTS := $(SOURCES_C:.c=.o)

Expand Down Expand Up @@ -513,3 +515,8 @@ endif
clean:
rm -f $(OBJECTS) $(TARGET)
endif

.PHONY: test

test: $(TARGET)
retroarch -L $< $(CORE_DIR)/DiskImage/Oberon-2019-01-21.dsk

0 comments on commit e7bf0bb

Please sign in to comment.