-OBJS += plugins/dfsound/adsr.o plugins/dfsound/dma.o plugins/dfsound/oss.o plugins/dfsound/reverb.o \
- plugins/dfsound/xa.o plugins/dfsound/freeze.o plugins/dfsound/cfg.o plugins/dfsound/registers.o \
- plugins/dfsound/spu.o
-# gpu
-OBJS += plugins/dfxvideo/cfg.o plugins/dfxvideo/fps.o plugins/dfxvideo/key.o plugins/dfxvideo/prim.o \
- plugins/dfxvideo/gpu.o plugins/dfxvideo/menu.o plugins/dfxvideo/soft.o plugins/dfxvideo/zn.o
-ifdef X11
-LDFLAGS += -lX11 -lXv
-OBJS += plugins/dfxvideo/draw.o
+OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
+ plugins/dfsound/registers.o plugins/dfsound/spu.o \
+ plugins/dfsound/out.o plugins/dfsound/nullsnd.o
+plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \
+ plugins/dfsound/xa.c
+ifeq "$(ARCH)" "arm"
+OBJS += plugins/dfsound/arm_utils.o
+endif
+ifneq ($(findstring oss,$(SOUND_DRIVERS)),)
+plugins/dfsound/out.o: CFLAGS += -DHAVE_OSS
+OBJS += plugins/dfsound/oss.o
+endif
+ifneq ($(findstring alsa,$(SOUND_DRIVERS)),)
+plugins/dfsound/out.o: CFLAGS += -DHAVE_ALSA
+OBJS += plugins/dfsound/alsa.o
+LDLIBS += -lasound
+endif
+ifneq ($(findstring sdl,$(SOUND_DRIVERS)),)
+plugins/dfsound/out.o: CFLAGS += -DHAVE_SDL
+OBJS += plugins/dfsound/sdl.o
+endif
+ifneq ($(findstring pulseaudio,$(SOUND_DRIVERS)),)
+plugins/dfsound/out.o: CFLAGS += -DHAVE_PULSE
+OBJS += plugins/dfsound/pulseaudio.o
+endif
+ifneq ($(findstring libretro,$(SOUND_DRIVERS)),)
+plugins/dfsound/out.o: CFLAGS += -DHAVE_LIBRETRO
+endif
+
+# builtin gpu
+OBJS += plugins/gpulib/gpu.o plugins/gpulib/vout_pl.o
+ifeq "$(HAVE_NEON)" "1"
+OBJS += plugins/gpulib/cspace_neon.o