-ifeq "$(USE_DYNAREC)" "1"
-OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
-OBJS += libpcsxcore/new_dynarec/pcsxmem.o
-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
+ifeq "$(DYNAREC)" "lightrec"
+CFLAGS += -Ideps/lightning/include -Ideps/lightrec \
+ -DLIGHTREC -DLIGHTREC_STATIC
+OBJS += libpcsxcore/lightrec/plugin.o
+OBJS += deps/lightning/lib/jit_disasm.o \
+ deps/lightning/lib/jit_memory.o \
+ deps/lightning/lib/jit_names.o \
+ deps/lightning/lib/jit_note.o \
+ deps/lightning/lib/jit_print.o \
+ deps/lightning/lib/jit_size.o \
+ deps/lightning/lib/lightning.o \
+ deps/lightrec/blockcache.o \
+ deps/lightrec/disassembler.o \
+ deps/lightrec/emitter.o \
+ deps/lightrec/interpreter.o \
+ deps/lightrec/lightrec.o \
+ deps/lightrec/memmanager.o \
+ deps/lightrec/optimizer.o \
+ deps/lightrec/regcache.o \
+ deps/lightrec/recompiler.o \
+ deps/lightrec/reaper.o
+ifeq ($(MMAP_WIN32),1)
+CFLAGS += -Ideps/mman
+OBJS += deps/mman/mman.o
+endif
+else ifeq "$(DYNAREC)" "ari64"
+CFLAGS += -DNEW_DYNAREC
+OBJS += libpcsxcore/new_dynarec/backends/psx/emu_if.o \
+ libpcsxcore/new_dynarec/new_dynarec.o \
+ libpcsxcore/new_dynarec/arm/linkage_arm.o \
+ libpcsxcore/new_dynarec/backends/psx/pcsxmem.o
+libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/arm/assem_arm.c \
+ libpcsxcore/new_dynarec/backends/psx/pcsxmem_inline.c
+else
+OBJS += libpcsxcore/new_dynarec/backends/psx/emu_if.o
+libpcsxcore/new_dynarec/backends/psx/emu_if.o: CFLAGS += -DDRC_DISABLE
+frontend/libretro.o: CFLAGS += -DDRC_DISABLE
+endif