prefix=@prefix@
exec_prefix=@exec_prefix@
INSTALL=@INSTALL@
INSTALL_OPTS=@INSTALL_OPTS@

install: installdirs
	$(INSTALL) -m 644 $(INSTALL_OPTS) "ext-all.js" $(DESTDIR)$(prefix)/lib/ext3/ext-all.js;
	$(INSTALL) -m 644 $(INSTALL_OPTS) "ext-all-debug.js" $(DESTDIR)$(prefix)/lib/ext3/ext-all-debug.js;
	$(INSTALL) -m 644 $(INSTALL_OPTS) "adapter/ext/ext-base.js" $(DESTDIR)$(prefix)/lib/ext3/adapter/ext/ext-base.js;
	@files=`find examples/ux -mindepth 1 -type f ! -name "*.in" -and ! -name "Makefile"`; \
	for file in $$files; do \
		$(INSTALL) -m 644 $(INSTALL_OPTS) "$$file" $(DESTDIR)$(prefix)/lib/ext3/"$$file"; \
	done
	@files=`find resources -mindepth 1 -type f ! -name "*.in" -and ! -name "Makefile"`; \
	for file in $$files; do \
		$(INSTALL) -m 644 $(INSTALL_OPTS) "$$file" $(DESTDIR)$(prefix)/lib/ext3/"$$file"; \
	done


installdirs:
	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/lib/ext3
	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/lib/resources
	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/lib/ext3/adapter
	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/lib/ext3/adapter/ext
	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/lib/ext3/examples
	$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/lib/ext3/examples/ux
	@dirs=`find examples/ux -mindepth 1 -type d`; \
	for dir in $$dirs; do \
		$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/lib/ext3/"$$dir"; \
	done
	
	@dirs=`find resources -mindepth 1 -type d`; \
	for dir in $$dirs; do \
		$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/lib/ext3/"$$dir"; \
	done
