Skip to content

Commit

Permalink
Build rules for Genode platform
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmry committed Nov 26, 2018
1 parent b460024 commit f6ea7cd
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Makefile
Expand Up @@ -276,6 +276,18 @@ include $(DEVKITPRO)/libnx/switch_rules
CFLAGS += -std=gnu11
STATIC_LINKING = 1

else ifeq ($(platform), genode)
TARGET := $(TARGET_NAME)_libretro.lib.so
CC := $(shell pkg-config genode-base --variable=cc)
CXX := $(shell pkg-config genode-base --variable=cxx)
LD := $(shell pkg-config genode-base --variable=ld)
AR := $(shell pkg-config genode-base --variable=ar) -rcs
CFLAGS += $(shell pkg-config --cflags genode-libc)
CXXFLAGS += $(shell pkg-config --cflags genode-stdcxx)
LDFLAGS += -shared --version-script=$(CORE_DIR)/libretro/link.T
LDFLAGS += $(shell pkg-config --libs genode-lib genode-libc genode-stdcxx)
LIBS =

else ifneq (,$(findstring armv,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
Expand Down Expand Up @@ -527,14 +539,16 @@ else
LD = link.exe
endif
else
ifneq ($(platform),genode)
LD = $(CXX)
endif
endif

%.o: %.c
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<

%.o: %.cpp
$(CXX) $(CFLAGS) -c $(OBJOUT)$@ $<
$(CXX) $(CFLAGS) $(CXXFLAGS) -c $(OBJOUT)$@ $<

ifeq ($(platform), theos_ios)
COMMON_FLAGS := -DIOS -DARM $(COMMON_DEFINES) -I$(THEOS_INCLUDE_PATH) -Wno-error
Expand All @@ -549,7 +563,7 @@ $(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(LD) $(fpic) $(SHARED) $(LDFLAGS) $(LINKOUT)$@ $(OBJECTS) $(LIBS)
$(LD) $(fpic) $(SHARED) $(LINKOUT)$@ $(OBJECTS) $(LDFLAGS) $(LIBS)
endif


Expand Down

0 comments on commit f6ea7cd

Please sign in to comment.