# Makefile.am for NJAM

SUBDIRS = src
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in
ACLOCAL_AMFLAGS = -I .
EXTRA_DIST = \
acinclude.m4 \
COPYING \
INSTALL \
README \
TODO \
ChangeLog

install-data-local:
	 @$(PRE_INSTALL)
	 $(mkinstalldirs) $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE); \
	 $(mkinstalldirs) $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE)/data; \
	 $(mkinstalldirs) $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE)/skins; \
	 $(mkinstalldirs) $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE)/html; \
	 $(mkinstalldirs) $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE)/levels; \
	 $(INSTALL_DATA) $(srcdir)/njam.conf $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE); \
	 $(INSTALL_DATA) $(srcdir)/njamicon.ico $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE); \
	 $(INSTALL_DATA) $(srcdir)/njam.iss $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE); \
	 $(INSTALL_DATA) $(srcdir)/njam.rc $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE); \
	 $(INSTALL_DATA) $(srcdir)/hiscore.dat $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE); \
	 chmod 660 $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE)/hiscore.dat; \
	 chgrp games $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE)/hiscore.dat; \
	 $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE); \
	   for file in $(srcdir)/data/*; do \
	     	if test -f $$file; then \
	           $(INSTALL_DATA) "$$file" $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE)/data; \
	        fi \
	   done 
	   for file in $(srcdir)/skins/*; do \
	     	if test -f $$file; then \
	           $(INSTALL_DATA) "$$file" $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE)/skins; \
	        fi \
	   done 
	   for file in $(srcdir)/html/*; do \
	     	if test -f $$file; then \
	           $(INSTALL_DATA) "$$file" $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE)/html; \
	        fi \
	   done
	   for file in $(srcdir)/levels/*; do \
	     	if test -f "$$file"; then \
	           $(INSTALL_DATA) "$$file" $(DESTDIR)$(DEFAULT_LIBDIR)/$(PACKAGE)/levels; \
	        fi \
	   done

dist-hook:
	if test -d data; then \
	  mkdir $(distdir); \
	  for d in data/*; do \
	    cp -ar $$d $(distdir); \
	  done \
	fi
	if test -d skins; then \
	  mkdir $(distdir); \
	  for d in skins/*; do \
	    cp -ar $$d $(distdir); \
	  done \
	fi
	if test -d html; then \
	  mkdir $(distdir); \
	  for d in html/*; do \
	    cp -ar $$d $(distdir); \
	  done \
	fi
	if test -d levels; then \
	  mkdir $(distdir); \
	  for d in levels/*; do \
	    cp -ar $$d $(distdir); \
	  done \
	fi

uninstall-local:
	rm -rf $(DEFAULT_LIBDIR)/njam/*
	rm -rf $(DEFAULT_LIBDIR)/njam
distclean-local:
	rm -f *\~

source-doc:
	doxygen Doxyfile
