## Process this file with automake to generate Makefile.in.

## Source files generated by the glsl2h.sh utility (converts .glsl shader
## files to C/C++ header files).

BUILT_SOURCES = \
	VsmLookup.h

DISTCLEANFILES = \
	$(BUILT_SOURCES) \
	glsl2h.sh

if MAC_FRAMEWORK
shadersvsmdatadir = $(MAC_FRAMEWORK_PREFIX)/$(MAC_FRAMEWORK_NAME).framework/Versions/$(MAC_FRAMEWORK_VERSION)/Resources/shaders/vsm
else
shadersvsmdatadir = $(datadir)/Coin/shaders/vsm
endif

dist_shadersvsmdata_DATA = \
	VsmLookup.glsl

# This is necessary to include so the headers are actually built.
all-local: $(BUILT_SOURCES)

# **************************************************************************

# I experienced some problems with script permission, so I changed the rules
# around to generate the script and explicitly set the permission first.
# 20030217 larsa
glsl2h.sh: $(srcdir)/../glsl2h.sh.in
	@( cd $(top_builddir); ./config.status --file=data/shaders/vsm/glsl2h.sh:data/shaders/glsl2h.sh.in )
	@chmod 755 glsl2h.sh

# if glsl2h fails, we don't want the empty file lying around - 20030217 larsa
VsmLookup.h: $(srcdir)/VsmLookup.glsl glsl2h.sh
	if ./glsl2h.sh $(srcdir)/VsmLookup.glsl > $@; then :; else rm -f $@; exit 1; fi

install-dist_shadersvsmdataDATA: $(dist_shadersvsmdata_DATA)
	@$(NORMAL_INSTALL)
	$(mkinstalldirs) $(DESTDIR)$(shadersvsmdatadir)
	@list='$(dist_shadersvsmdata_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f="`echo $$p | sed -e 's|^.*/||'`"; \
	  if cmp -s "$$d$$p" "$(DESTDIR)$(shadersvsmdatadir)/$$f"; then :; else \
	    echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(shadersvsmdatadir)/$$f"; \
	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(shadersvsmdatadir)/$$f"; \
	  fi \
	done

