Makefile.am 2.52 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
		mkdir -p $(builddir)/temp-mime-dir/mime/packages ; \
		cp -a $(builddir)/freedesktop.org.xml $(builddir)/temp-mime-dir/mime/packages/ ; \
		XDG_DATA_DIRS="$(builddir)/temp-mime-dir/" $(builddir)/update-mime-database "$(builddir)/temp-mime-dir/mime/" ; \
69
		XDG_DATA_DIRS="$(builddir)/temp-mime-dir/" ../xdgmime/src/test-mime-data -v tests/list || exit 1; \
70
71
		rm -rf "$(builddir)/temp-mime-dir/" ; \
	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