From: Hraban Luyat Date: Sun, 5 Jul 2015 10:43:44 +0000 (+0000) Subject: Build rules for libopusfile X-Git-Tag: v2.0.0~114 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=0d3eb2c8d9fa79a158bf382d47308a4a9402a431;p=go-opus.git Build rules for libopusfile --- diff --git a/Makefile b/Makefile index 29f7e2c..494fd5e 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,35 @@ -BUILDDIR := libopusbuild +BUILDDIR := build -.PHONY: libopus clean default test build +PWD=$(dir $(realpath $(lastword $(MAKEFILE_LIST)))) +export PKG_CONFIG_PATH :=$(PWD)/$(BUILDDIR)/lib/pkgconfig:$(PKG_CONFIG_PATH) -default: libopus +.PHONY: clean distclean default test build all libopus libopusfile +# Don't delete config.h files after succesful builds +.PRECIOUS: %/config.h -build: - go build +all: libopus libopusfile -test: - go test +libopus: libopus.a +libopusfile: libopus libopusfile.a -libopus/config.h: libopus/autogen.sh - (cd libopus; ./autogen.sh) - (cd libopus; ./configure --prefix="$$PWD/../$(BUILDDIR)" --enable-fixed-point) - -libopus/autogen.sh: +%/autogen.sh: git submodule init git submodule update -libopus: libopus/config.h - $(MAKE) -C libopus - $(MAKE) -C libopus install - cp $(BUILDDIR)/lib/libopus.a . +%/config.h: %/autogen.sh + (cd "$*"; ./autogen.sh) + (cd "$*"; ./configure --prefix="$$PWD/../$(BUILDDIR)" --enable-fixed-point) + +%.a: %/config.h + $(MAKE) -C "$*" + $(MAKE) -C "$*" install + cp "$(BUILDDIR)/lib/$@" . + +clean-%: + $(MAKE) -C "$*" clean + +distclean-%: + $(MAKE) -C "$*" distclean -%clean: - $(MAKE) -C libopus $@ - rm -rf $(BUILDDIR) libopus/configure.h +clean distclean: %: %-libopus %-libopusfile + rm -rf $(BUILDDIR) *.a