Merge pull request #71 from frangarcj/master
[pcsx_rearmed.git] / Makefile
index b23d33e..600a1d3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,10 +2,16 @@
 
 # default stuff goes here, so that config can override
 TARGET ?= pcsx
-CFLAGS += -Wall -ggdb -Iinclude -ffast-math
-ifndef DEBUG
+CFLAGS += -Wall -Iinclude -ffast-math
+ifeq ($(DEBUG), 1)
+CFLAGS += -O0 -ggdb
+else
+ifeq ($(platform), vita)
+CFLAGS += -O3 -DNDEBUG
+else
 CFLAGS += -O2 -DNDEBUG
 endif
+endif
 CXXFLAGS += $(CFLAGS)
 #DRC_DBG = 1
 #PCNT = 1
@@ -65,7 +71,6 @@ endif
 OBJS += libpcsxcore/new_dynarec/emu_if.o
 libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c \
        libpcsxcore/new_dynarec/pcsxmem_inline.c
-libpcsxcore/new_dynarec/new_dynarec.o: CFLAGS += -Wno-all -Wno-pointer-sign
 ifdef DRC_DBG
 libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
 CFLAGS += -DDRC_DBG
@@ -195,6 +200,7 @@ endif
 ifeq "$(PLATFORM)" "libretro"
 OBJS += frontend/libretro.o
 CFLAGS += -DFRONTEND_SUPPORTS_RGB565
+CFLAGS += -DHAVE_LIBRETRO
 
 ifeq ($(MMAP_WIN32),1)
 OBJS += libpcsxcore/memmap_win32.o
@@ -247,11 +253,19 @@ frontend/revision.h: FORCE
 %.o: %.S
        $(CC_AS) $(CFLAGS) -c $^ -o $@
 
+%.o: %.cpp
+       $(CXX) $(CXXFLAGS) -c -o $@ $<
+
+
 
 target_: $(TARGET)
 
 $(TARGET): $(OBJS)
+ifeq ($(STATIC_LINKING), 1)
+       $(AR) rcs $@ $(OBJS)
+else
        $(CC_LINK) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(EXTRA_LDFLAGS)
+endif
 
 clean: $(PLAT_CLEAN) clean_plugins
        $(RM) $(TARGET) $(OBJS) $(TARGET).map frontend/revision.h