CFLAGS += -DNDEBUG
endif
endif
+ifndef NO_AUTODEPS
+AUTODEPFLAGS += -MMD -MP
+endif
ifeq ($(DEBUG_ASAN), 1)
CFLAGS += -fsanitize=address
LDFLAGS += -fsanitize=address
OBJS += libpcsxcore/new_dynarec/pcsxmem.o
ifeq "$(ARCH)" "arm"
OBJS += libpcsxcore/new_dynarec/linkage_arm.o
- libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c
else ifneq (,$(findstring $(ARCH),aarch64 arm64))
OBJS += libpcsxcore/new_dynarec/linkage_arm64.o
- libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm64.c
else
$(error no dynarec support for architecture $(ARCH))
endif
CFLAGS += -DDRC_DISABLE
endif
OBJS += libpcsxcore/new_dynarec/emu_if.o
-libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/pcsxmem_inline.c
ifdef DRC_DBG
libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
CFLAGS += -DDRC_DBG
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
ifeq "$(HAVE_C64_TOOLS)" "1"
plugins/dfsound/%.o: CFLAGS += -DC64X_DSP -DWANT_THREAD_CODE
-plugins/dfsound/spu.o: plugins/dfsound/spu_c64x.c
frontend/menu.o: CFLAGS += -DC64X_DSP
endif
ifneq ($(findstring oss,$(SOUND_DRIVERS)),)
CFLAGS += -DGPU_NEON
OBJS += plugins/gpu_neon/psx_gpu_if.o
plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
-plugins/gpu_neon/psx_gpu_if.o: plugins/gpu_neon/psx_gpu/*.c
frontend/menu.o frontend/plugin_lib.o: CFLAGS += -DBUILTIN_GPU_NEON
ifeq "$(HAVE_NEON_ASM)" "1"
OBJS += plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o
CFLAGS += -DGPU_PEOPS
# note: code is not safe for strict-aliasing? (Castlevania problems)
plugins/dfxvideo/gpulib_if.o: CFLAGS += -fno-strict-aliasing
-plugins/dfxvideo/gpulib_if.o: plugins/dfxvideo/prim.c plugins/dfxvideo/soft.c
frontend/menu.o frontend/plugin_lib.o: CFLAGS += -DBUILTIN_GPU_PEOPS
OBJS += plugins/dfxvideo/gpulib_if.o
ifeq "$(THREAD_RENDERING)" "1"
endif
ifeq "$(PLATFORM)" "maemo"
OBJS += maemo/hildon.o maemo/main.o maemo/maemo_xkb.o frontend/pl_gun_ts.o
-maemo/%.o: maemo/%.c
USE_PLUGIN_LIB = 1
LDFLAGS += $(shell pkg-config --libs hildon-1 libpulse)
CFLAGS += $(shell pkg-config --cflags hildon-1) -DHAVE_TSLIB
OBJS += frontend/menu.o
OBJS += frontend/libpicofe/input.o
frontend/libpicofe/input.o: CFLAGS += -Wno-array-bounds
-frontend/menu.o: frontend/libpicofe/menu.c
ifeq "$(HAVE_TSLIB)" "1"
frontend/%.o: CFLAGS += -DHAVE_TSLIB
OBJS += frontend/pl_gun_ts.o
@exit 1
libpcsxcore/gte_nf.o: libpcsxcore/gte.c
- $(CC) -c -o $@ $^ $(CFLAGS) -DFLAGLESS
+ $(CC) -c -o $@ $^ $(CFLAGS) $(AUTODEPFLAGS) -DFLAGLESS
include/revision.h: FORCE
@(git describe --always || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
@diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
@rm $@_
+%.o: %.cpp
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(AUTODEPFLAGS) -c $< -o $@
+
+%.o: %.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(AUTODEPFLAGS) -c $< -o $@
+
%.o: %.S
- $(CC_AS) $(CFLAGS) -c $^ -o $@
+ $(CC_AS) $(CPPFLAGS) $(CFLAGS) $(AUTODEPFLAGS) -c $< -o $@
target_: $(TARGET)
endif
clean: $(PLAT_CLEAN) clean_plugins
- $(RM) $(TARGET) *.o $(OBJS) $(TARGET).map include/revision.h
+ $(RM) $(TARGET) *.o $(OBJS) $(OBJS:.o=.d) $(TARGET).map include/revision.h
ifneq ($(PLUGINS),)
plugins_: $(PLUGINS)
clean_plugins:
endif
+ifndef NO_AUTODEPS
+$(OBJS:.o=.d): ;
+-include $(OBJS:.o=.d)
+endif
+
.PHONY: all clean target_ plugins_ clean_plugins FORCE
ifneq "$(PLATFORM)" "pandora"
LDFLAGS += -Wl,--no-undefined
endif
CFLAGS += $(PLUGIN_CFLAGS)
-#LDLIBS_GPULIB += `sdl-config --libs`
ifdef DEBUG
CFLAGS += -O0
endif
+ifndef NO_AUTODEPS
+ CFLAGS += -MMD -MP
+endif
GPULIB_A = ../gpulib/gpulib.$(ARCH).a
ifneq ($(findstring .cpp,$(SRC_GPULIB)),)
CC_GPULIB = $(CXX)
endif
-$(BIN_GPULIB): $(SRC) $(SRC_GPULIB) $(GPULIB_A)
- $(CC_GPULIB) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) $(LDLIBS_GPULIB)
+DEPS_GPULIB = $(SRC) $(SRC_GPULIB) $(GPULIB_A)
+$(BIN_GPULIB): $(DEPS_GPULIB)
+ $(CC_GPULIB) -o $@ $(CFLAGS) $(LDFLAGS) $(DEPS_GPULIB) $(LDLIBS) $(LDLIBS_GPULIB)
ln -fs $(PLUGINDIR)/$@ ../
+
+ifndef NO_AUTODEPS
+$(BIN_GPULIB:.so=.d): ;
+-include $(BIN_GPULIB:.so=.d)
+endif
endif
$(GPULIB_A):
$(MAKE) -C ../gpulib/ all
clean:
- $(RM) $(TARGETS)
+ $(RM) $(TARGETS) $(BIN_GPULIB:.so=.d)
../../config.mak:
@echo "Please run ./configure before running make!"