#! /usr/bin/make -f

build-npapi: stamp-npapi-build

stamp-npapi-fetch:
	rm -Rf npapi-vlc
	git clone git://git.videolan.org/npapi-vlc.git npapi-vlc
	touch $@

stamp-npapi-autogen: stamp-npapi-fetch
# extras/package/npapi.am
	cd npapi-vlc && \
	$(SHELL) ./autogen.sh
	touch $@

stamp-npapi-configure: stamp-npapi-autogen
	cd npapi-vlc && \
	$(SHELL) ./configure \
		--prefix=/ \
		--host=$(host_alias) --build=$(build_alias) \
		CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" \
		CC="$(CC)" CFLAGS="$(CFLAGS)" \
		CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" \
		LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
		SHELL="$(SHELL)" \
		PKG_CONFIG_LIBDIR="../$(srcdir)/extras/contrib/lib/pkgconfig:../lib"
	touch $@

stamp-npapi-build: stamp-npapi-configure
	cd npapi-vlc && \
	$(MAKE) all && \
	$(MAKE) DESTDIR="$(abs_builddir)/npapi-vlc/installed" install
	touch $@
