#/usr/bin/make -f

include toc.make

SUBDIRS = src

ifneq (,$(strip $(filter dist testdist clean distclean uninstall install,$(MAKECMDGOALS))))
# only build these SUBDIRS when running certain targets
      SUBDIRS += include doc toc
endif


INSTALL_BINS = $(PACKAGE_NAME)-config
INSTALL_PKGCONFIG = $(PACKAGE_NAME).pc


DIST_FILES += ChangeLog INSTALL LICENSE.$(PACKAGE_NAME) \
	README.WIN32 create_win32.sh \
	configure configure.$(PACKAGE_NAME) postconfig.$(PACKAGE_NAME) \
	toc.$(PACKAGE_NAME).make.at toc.$(PACKAGE_NAME).help \
	find_toc.sh


DISTCLEAN_FILES += $(PACKAGE_NAME)-config $(PACKAGE_NAME).pc

all: subdirs



S11NCONF = $(wildcard ./libs11n-config)
ifneq (,$(S11NCONF))
WINDIR = libs11n-$(shell $(S11NCONF) --version)-win32-src
.PHONY: win32
win32:
	./create_win32.sh
	@test -d $(WINDIR) && rm -fr $(WINDIR); exit 0
	mv win32 $(WINDIR)
	@test -f $(WINDIR).zip && rm $(WINDIR).zip; exit 0
	zip -r $(WINDIR).zip $(WINDIR)
CLEAN_FILES += $(WINDIR)
else
win32:
	@echo "Creating the win32 tree requires a configured/built source tree."; exit 1
endif
