## 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 = \
	PointLight.h \
	SpotLight.h \
	DirectionalLight.h \
	DirSpotLight.h

DISTCLEANFILES = \
	$(BUILT_SOURCES) \
	glsl2h.sh

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

dist_shaderslightsdata_DATA = \
	PointLight.glsl \
	SpotLight.glsl \
	DirectionalLight.glsl \
	DirSpotLight.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/lights/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
PointLight.h: $(srcdir)/PointLight.glsl glsl2h.sh
	if ./glsl2h.sh $(srcdir)/PointLight.glsl > $@; then :; else rm -f $@; exit 1; fi

SpotLight.h: $(srcdir)/SpotLight.glsl glsl2h.sh
	if ./glsl2h.sh $(srcdir)/SpotLight.glsl > $@; then :; else rm -f $@; exit 1; fi

DirectionalLight.h: $(srcdir)/DirectionalLight.glsl glsl2h.sh
	if ./glsl2h.sh $(srcdir)/DirectionalLight.glsl > $@; then :; else rm -f $@; exit 1; fi

DirSpotLight.h: $(srcdir)/DirSpotLight.glsl glsl2h.sh
	if ./glsl2h.sh $(srcdir)/DirSpotLight.glsl > $@; then :; else rm -f $@; exit 1; fi

install-dist_shaderslightsdataDATA: $(dist_shaderslightsdata_DATA)
	@$(NORMAL_INSTALL)
	$(mkinstalldirs) $(DESTDIR)$(shaderslightsdatadir)
	@list='$(dist_shaderslightsdata_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)$(shaderslightsdatadir)/$$f"; then :; else \
	    echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(shaderslightsdatadir)/$$f"; \
	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(shaderslightsdatadir)/$$f"; \
	  fi \
	done

