diff --git a/libs/libc/audio/libsrc/Make.defs b/libs/libc/audio/libsrc/Make.defs index dc218ed785..1d9b591a8f 100644 --- a/libs/libc/audio/libsrc/Make.defs +++ b/libs/libc/audio/libsrc/Make.defs @@ -20,19 +20,21 @@ ifeq ($(CONFIG_AUDIO_SRC),y) -PACKAGE=libsamplerate -VERSION=0.2.2 +PACKAGE = libsamplerate +VERSION = 0.2.2 + +SRCPATH = audio/libsrc # Download and unpack tarball if no git repo found -ifeq ($(wildcard libsamplerate/.git),) -libsamplerate: - $(call DOWNLOAD,https://codeload.github.com/libsndfile/libsamplerate/zip,master,libsamplerate.zip) - $(Q) unzip -o libsamplerate.zip - $(Q) mv libsamplerate-master libsamplerate +$(SRCPATH)/libsamplerate: +ifeq ($(wildcard $(SRCPATH)/libsamplerate/.git),) + $(call DOWNLOAD,https://codeload.github.com/libsndfile/libsamplerate/zip,master,$(SRCPATH)/libsamplerate.zip) + $(Q) unzip -o $(SRCPATH)/libsamplerate.zip -d $(SRCPATH) + $(Q) mv $(SRCPATH)/libsamplerate-master $(SRCPATH)/libsamplerate endif -$(TOPDIR)/include/nuttx/audio/samplerate.h : libsamplerate - $(Q) cp -rf libsamplerate/include/samplerate.h $(TOPDIR)$(DELIM)include$(DELIM)nuttx$(DELIM)audio$(DELIM) +$(TOPDIR)/include/nuttx/audio/samplerate.h : $(SRCPATH)/libsamplerate + $(Q) cp -rf $(SRCPATH)/libsamplerate/include/samplerate.h $(TOPDIR)$(DELIM)include$(DELIM)nuttx$(DELIM)audio$(DELIM) context:: $(TOPDIR)/include/nuttx/audio/samplerate.h @@ -59,15 +61,15 @@ ifeq ($(CONFIG_SINC_BEST_CONVERTER),y) CFLAGS += -DENABLE_SINC_BEST_CONVERTER endif -VPATH += libsamplerate/src -SUBDIRS += libsamplerate/src -DEPPATH += --dep-path libsamplerate/src +VPATH += $(SRCPATH)/libsamplerate/src +SUBDIRS += $(SRCPATH)/libsamplerate/src +DEPPATH += --dep-path $(SRCPATH)/libsamplerate/src distclean:: $(call DELDIR, $(TOPDIR)$(DELIM)include$(DELIM)nuttx$(DELIM)audio$(DELIM)samplerate.h) -ifeq ($(wildcard libsamplerate/.git),) - $(call DELDIR, libsamplerate) - $(call DELFILE, libsamplerate.zip) +ifeq ($(wildcard $(SRCPATH)/libsamplerate/.git),) + $(call DELDIR, $(SRCPATH)/libsamplerate) + $(call DELFILE, $(SRCPATH)/libsamplerate.zip) endif endif