Libretro .o files are now in the build/obj folder and are suffixed with _libretro (since they have different compilation flags). This also lets us rename gbmemory.c/h back to its original name.

This commit is contained in:
Lior Halphon 2017-10-12 19:42:30 +03:00
parent 7c0ad24175
commit 441781cbe9
5 changed files with 11 additions and 5 deletions

View File

@ -14,7 +14,7 @@
#include "display.h"
#include "joypad.h"
#include "mbc.h"
#include "gbmemory.h"
#include "memory.h"
#include "printer.h"
#include "timing.h"
#include "z80_cpu.h"

View File

@ -3,7 +3,7 @@ INCFLAGS := -I$(CORE_DIR) \
SOURCES_C := $(CORE_DIR)/Core/gb.c \
$(CORE_DIR)/Core/apu.c \
$(CORE_DIR)/Core/gbmemory.c \
$(CORE_DIR)/Core/memory.c \
$(CORE_DIR)/Core/mbc.c \
$(CORE_DIR)/Core/timing.c \
$(CORE_DIR)/Core/display.c \
@ -20,5 +20,7 @@ SOURCES_C += $(CORE_DIR)/Core/debugger.c \
else
CFLAGS += -DDISABLE_DEBUGGER
endif
CFLAGS += -DDISABLE_TIMEKEEPING
SOURCES_CXX :=

View File

@ -58,7 +58,7 @@ EXT := a
endif
ifeq ($(platform), unix)
EXT ?= so
EXT ?= so
TARGET := $(TARGET_NAME)_libretro.$(EXT)
fpic := -fPIC
SHARED := -shared -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined
@ -113,6 +113,9 @@ else
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined
endif
# To force use of the Unix version instead of the Windows version
MKDIR := $(shell which mkdir)
LDFLAGS += $(LIBM)
ifeq ($(DEBUG), 1)
@ -123,7 +126,7 @@ endif
include Makefile.common
OBJECTS := $(SOURCES_C:.c=.o) $(SOURCES_CXX:.cpp=.o)
OBJECTS := $(patsubst %.c,build/obj/%_libretro.c.o,$(SOURCES_C))
CFLAGS += -Wall -D__LIBRETRO__ $(fpic) $(INCFLAGS) -std=gnu11 -D_GNU_SOURCE -D_USE_MATH_DEFINES
CXXFLAGS += -Wall -D__LIBRETRO__ $(fpic)
@ -137,7 +140,8 @@ else
$(CC) $(fpic) $(SHARED) $(INCFLAGS) -o $@ $(OBJECTS) $(LDFLAGS)
endif
Core/%.o: Core/%.c
build/obj/%_libretro.c.o: %.c
-@$(MKDIR) -p $(dir $@)
$(CC) -c -o $@ $< $(CFLAGS) $(fpic) -DGB_INTERNAL
%.o: %.c