-.PHONY: all test
+VERSION=1.0.0
+REVISION=1
+BUILDDIR=build
+SRCDIR=src
+BINDIR=usr/bin
+LIBDIR=usr/lib/albentohandy
+PACKAGE=albentohandy_$(VERSION)-$(REVISION)_x86_64
-all: test
+.PHONY: all build test clean
+
+all: build test
+
+build: $(BUILDDIR)/$(PACKAGE)/$(BINDIR)/albentohandy \
+ $(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/vorbis.sh \
+ $(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/mp3.sh \
+ $(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/opus.sh \
+ $(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/flac.sh
test:
./tests/albentohandy.bats
./tests/mp3.bats
./tests/opus.bats
./tests/flac.bats
+
+clean:
+ rm --recursive --force build
+
+$(BUILDDIR)/$(PACKAGE)/$(BINDIR)/albentohandy:
+ mkdir --parents $(@D)
+ cp $(SRCDIR)/albentohandy $(@)
+ shellcheck $(@)
+
+$(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/vorbis.sh:
+ mkdir --parents $(@D)
+ cp $(SRCDIR)/lib/vorbis.sh $(@)
+ shellcheck $(@)
+
+$(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/mp3.sh:
+ mkdir --parents $(@D)
+ cp $(SRCDIR)/lib/mp3.sh $(@)
+ shellcheck $(@)
+
+$(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/opus.sh:
+ mkdir --parents $(@D)
+ cp $(SRCDIR)/lib/opus.sh $(@)
+ shellcheck $(@)
+
+$(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/flac.sh:
+ mkdir --parents $(@D)
+ cp $(SRCDIR)/lib/flac.sh $(@)
+ shellcheck $(@)
\ No newline at end of file
|| errlog "missing $CONFIG_FILE" \
|| return $?
+ # shellcheck disable=SC1090
source "$CONFIG_FILE"
[ -n "$MUSIC_PATH" ] \
|| errlog "missing MUSIC_PATH in $CONFIG_FILE" \
[ -f "$LIB_PATH/$lib" ] \
|| errlog "lib $LIB_PATH/$lib not found" \
|| return $?
+ # shellcheck disable=SC1090
source "$LIB_PATH/$lib" \
|| errlog "could not load library $LIB_PATH/$lib" \
|| return $?