Makefile.am 3.8 KB
Newer Older
1 2
SUBDIRS=po

3 4
INCLUDES = $(ALL_CFLAGS)

5
packagesdir = $(datadir)/mime/packages
6
packages_DATA = freedesktop.org.xml
Thomas Leonard's avatar
Thomas Leonard committed
7

8 9
bin_PROGRAMS = update-mime-database
update_mime_database_SOURCES = update-mime-database.c
10 11
update_mime_database_CFLAGS = $(ALL_CFLAGS)
update_mime_database_LDADD = $(ALL_LIBS)
12

13 14 15 16 17
noinst_PROGRAMS = test-subclassing
test_subclassing_SOURCES = test-subclassing.c
test_subclassing_CFLAGS = $(ALL_CFLAGS)
test_subclassing_LDADD = $(ALL_LIBS)

Thomas Leonard's avatar
Thomas Leonard committed
18 19
man_MANS = update-mime-database.1

20 21 22 23 24
EXTRA_DIST = \
	shared-mime-info-spec.xml	\
	freedesktop.org.xml.in		\
	$(packages_DATA) 		\
	README				\
25
	HACKING				\
26 27 28
	$(man_MANS)			\
	intltool-extract.in		\
	intltool-merge.in		\
29
	intltool-update.in		\
30 31
	shared-mime-info.pc.in		\
	po/shared-mime-info.pot
32

33
CLEANFILES = freedesktop.org.xml po/stamp-it
34
DISTCLEANFILES = intltool-extract intltool-merge intltool-update
35

36
pkgconfigdir = $(datadir)/pkgconfig
37 38 39 40
pkgconfig_DATA = shared-mime-info.pc

$(pkgconfig_DATA): config.status

41 42 43
@INTLTOOL_XML_RULE@
@INTLTOOL_DESKTOP_RULE@

44
install-data-hook: 
45
if ENABLE_UPDATE_MIMEDB
46
	$(DESTDIR)"$(bindir)/update-mime-database" -V "$(DESTDIR)$(datadir)/mime"
47
endif
Thomas Leonard's avatar
Thomas Leonard committed
48 49

uninstall-hook:
50
	for media in text application image audio inode video message model multipart x-epoc; do rm -f "$(DESTDIR)$(datadir)/mime/$${media}/"*.xml; done
51 52 53 54 55
	rm -f "$(DESTDIR)$(datadir)/mime/globs"
	rm -f "$(DESTDIR)$(datadir)/mime/magic"
	rm -f "$(DESTDIR)$(datadir)/mime/aliases"
	rm -f "$(DESTDIR)$(datadir)/mime/subclasses"
	rm -f "$(DESTDIR)$(datadir)/mime/XMLnamespaces"
56 57
	rm -f "$(DESTDIR)$(datadir)/mime/mime-cache"
	rm -f "$(DESTDIR)$(datadir)/mime/XMLnamespaces"
58

59 60
all: check

61
check:
62
	@if test -n $(XMLLINT) ; then \
63 64
		xmllint --noout --valid $(srcdir)/freedesktop.org.xml;	\
	fi
65
	@if test -d CVS/ && test -x ../xdgmime/src/test-mime-data ; then \
66 67 68 69 70
		mkdir -p $(top_builddir)/temp-mime-dir/mime/packages ; \
		cp -a $(top_builddir)/freedesktop.org.xml $(top_builddir)/temp-mime-dir/mime/packages/ ; \
		XDG_DATA_DIRS="$(top_builddir)/temp-mime-dir/" $(top_builddir)/update-mime-database "$(top_builddir)/temp-mime-dir/mime/" ; \
		XDG_DATA_DIRS="$(top_builddir)/temp-mime-dir/" ../xdgmime/src/test-mime-data -v tests/list || exit 1; \
		rm -rf "$(top_builddir)/temp-mime-dir/" ; \
71
	fi
72 73 74 75
	@if `grep comment $(srcdir)/freedesktop.org.xml.in | grep -v _comment | grep -q -v '<!'` ; then \
		echo "***************************************************************************" ; \
		echo "*** Some comments are not marked as translatable, fix before committing ***" ; \
		echo "***************************************************************************" ; \
76 77
		exit 1 ; \
	fi
78 79 80 81 82 83 84 85
	@echo Expanded acronyms: `grep expanded-acronym $(srcdir)/freedesktop.org.xml.in | wc -l` ; \
	echo Acronyms: `grep acronym $(srcdir)/freedesktop.org.xml.in | grep -v expanded | wc -l` ; \
	if test `grep expanded-acronym $(srcdir)/freedesktop.org.xml.in | wc -l` -ne `grep acronym $(srcdir)/freedesktop.org.xml.in | grep -v expanded | wc -l` ; then \
		echo "*****************************************************************************************" ; \
		echo "*** Some acronyms are missing the expanded acronym definitions, fix before committing ***" ; \
		echo "*****************************************************************************************" ; \
		exit 1; \
	fi
86 87 88 89 90 91 92 93 94
	@echo Number of defined mime-types: `grep "mime-type type=" $(srcdir)/freedesktop.org.xml.in | wc -l` ; \
	echo Number of comments: `grep _comment $(srcdir)/freedesktop.org.xml.in | wc -l` ; \
	if test `grep "mime-type type=" $(srcdir)/freedesktop.org.xml.in | wc -l` -ne `grep _comment $(srcdir)/freedesktop.org.xml.in | wc -l` ; then \
		echo "*******************************************************************" ; \
		echo "*** Some mime-types are missing comments, fix before committing ***" ; \
		echo "*******************************************************************" ; \
		exit 1; \
	fi
	
95