C89 MSVC doesn't support 'inline' - will have to make define for
[picodrive.git] / Makefile
index d31779c..d8dbcb5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 TARGET ?= PicoDrive
 CFLAGS += -Wall -ggdb -falign-functions=2
-CFLAGS += -I.
+CFLAGS += -I. -DINLINE=inline
 ifndef DEBUG
 CFLAGS += -O2 -DNDEBUG -ffunction-sections
 ifeq ($(findstring clang,$(CC)),)
@@ -109,7 +109,7 @@ USE_FRONTEND = 1
 PLATFORM_MP3 = 1
 endif
 ifeq "$(PLATFORM)" "libretro"
-OBJS += platform/libretro.o 
+OBJS += platform/libretro/libretro.o 
 endif
 
 ifeq "$(USE_FRONTEND)" "1"
@@ -152,11 +152,13 @@ else
 OBJS += platform/common/mp3_dummy.o
 endif
 
+ifneq "$(DONT_COMPILE_IN_ZLIB)" "1"
 # zlib
 OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
        zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
 # unzip
 OBJS += unzip/unzip.o unzip/unzip_stream.o
+endif
 
 
 include platform/common/common.mak
@@ -176,7 +178,11 @@ clean:
        $(RM) -r .opk_data
 
 $(TARGET): $(OBJS)
+ifeq ($(STATIC_LINKING), 1)
+       $(AR) rcs $@ $(OBJS)
+else
        $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS)
+endif
 
 pprof: platform/linux/pprof.c
        $(CC) -O2 -ggdb -DPPROF -DPPROF_TOOL -I../../ -I. $^ -o $@