Makefile.am 2.12 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 25 26 27
EXTRA_DIST = \
	shared-mime-info-spec.xml	\
	freedesktop.org.xml.in		\
	$(packages_DATA) 		\
	README				\
	$(man_MANS)			\
	intltool-extract.in		\
	intltool-merge.in		\
28
	intltool-update.in		\
29 30
	shared-mime-info.pc.in		\
	po/shared-mime-info.pot
31

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

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

$(pkgconfig_DATA): config.status

40 41 42
@INTLTOOL_XML_RULE@
@INTLTOOL_DESKTOP_RULE@

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

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

58 59
all: check

60
check:
61
	if test -n $(XMLLINT) ; then \
62 63
		xmllint --noout --valid $(srcdir)/freedesktop.org.xml;	\
	fi
64 65 66 67 68 69 70
	if test -d CVS/ && test -x ../xdgmime/src/test-mime-data ; then \
		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/" ; \
		XDG_DATA_DIRS="$(builddir)/temp-mime-dir/" ../xdgmime/src/test-mime-data -v tests/list; \
		rm -rf "$(builddir)/temp-mime-dir/" ; \
	fi
71