
# package name
package = libwiiremote
version = 0.1.4

# for build
srcdir = .
top_srcdir = ..

INSTALL = /usr/bin/install -c

# for packaging
DISTDIR = $(package)-$(version)-doc
ALL_DIST_FILES = en/ ja/ 

############################################################
# rules
############################################################
all : apidoc

apidoc : 
	$(INSTALL) -d ./en/api
	$(INSTALL) -d ./ja/api
	doxygen Doxyfile.en
	doxygen Doxyfile.ja

## distribution rules
dist : dist-targz 

dist-dir : apidoc 
	if [ -x $(DISTDIR) ] ; then \
		rm -rf $(DISTDIR) ;\
	fi;
	mkdir $(DISTDIR)
	cp -pLR $(ALL_DIST_FILES) $(DISTDIR)
	rm -rf `find $(DISTDIR) -name .svn`

dist-targz : dist-dir
	if [ -f $(top_srcdir)/$(DISTDIR).tar.gz ] ; then \
		rm $(top_srcdir)/$(DISTDIR).tar.gz ;\
	fi;
	if [ -f $(top_srcdir)/$(DISTDIR).tar ] ; then \
		rm $(top_srcdir)/$(DISTDIR).tar ;\
	fi;
	tar  cvf $(top_srcdir)/$(DISTDIR).tar $(DISTDIR)
	gzip -9 $(top_srcdir)/$(DISTDIR).tar 
	rm -rf $(DISTDIR)

dist-bzip2 : dist-dir
	if [ -f $(top_srcdir)/$(DISTDIR).tar.bz2 ] ; then \
		rm $(top_srcdir)/$(DISTDIR).tar.bz2 ;\
	fi;
	if [ -f $(top_srcdir)/$(DISTDIR).tar ] ; then \
		rm $(top_srcdir)/$(DISTDIR).tar ;\
	fi;
	tar cvf $(top_srcdir)/$(DISTDIR).tar $(DISTDIR)
	bzip2 -9 $(top_srcdir)/$(DISTDIR).tar 
	rm -rf $(DISTDIR)



distclean : clean

clean :
	-rm -f en/api/* ja/api/*

