summaryrefslogtreecommitdiff
path: root/scripts/Makefile.in
blob: f6e4e3f70fbc42ab4980381a0a901d08f7b9dd5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
MKDIR      	= mkdir -p
RMDIR      	= rmdir
INSTALL         = @INSTALL@ $(INSTALL_FLAGS)
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS)
INSTALL_LIBRARY = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS)
INSTALL_SCRIPT  = @INSTALL_SCRIPT@ $(INSTALL_SCRIPT_FLAGS)
INSTALL_DATA    = @INSTALL_DATA@ $(INSTALL_DATA_FLAGS)
XMLTO           = @XMLTO@

prefix          = @prefix@
exec_prefix     = @exec_prefix@
bindir          = @bindir@
mandir          = @mandir@

SCRIPTS		= \
    xdg-desktop-menu \
    xdg-desktop-icon \
    xdg-mime \
    xdg-icon-resource \
    xdg-open \
    xdg-email \
    xdg-su \
    xdg-screensaver 
#    xdg-copy \
#    xdg-file-dialog

MANPAGES=	$(SCRIPTS:%=man/%.1)
WEBPAGES=	$(SCRIPTS:%=%.html)
XMLFILES=	$(SCRIPTS:%=desc/%.xml)

all:		

html:		index.html $(WEBPAGES)

scripts:	README $(SCRIPTS)

man:		$(MANPAGES)

release:	scripts html man
	rm -f xdg-*.in *~ HACKING
	rm -rf desc/
	rm -rf xsl/

distclean: clean
	rm -f Makefile

clean:

scripts-clean:
	rm -f $(SCRIPTS) README man/xdg-*.1 html/xdg-*.html

README: $(SCRIPTS)
	echo > $@
	@for x in $(SCRIPTS) ; do \
	    sh ./$$x --help | grep -B 100 Synopsis | sed -e '$$d' >> $@ ; \
	done

install:
	$(MKDIR) $(DESTDIR)$(bindir)
	for x in $(SCRIPTS) ; do \
	    $(INSTALL_SCRIPT) $$x $(DESTDIR)$(bindir) ; \
	done
	$(MKDIR) $(DESTDIR)$(mandir)
	$(MKDIR) $(DESTDIR)$(mandir)/man1
	for x in $(MANPAGES) ; do \
	    $(INSTALL_DATA) $$x $(DESTDIR)$(mandir)/man1 ; \
	done

uninstall:
	for x in $(MANPAGES) ; do \
	    rm -f $(DESTDIR)$(mandir)/man1/`basename $$x` ; \
	done
	-$(RMDIR) $(DESTDIR)$(mandir)/man1
	-$(RMDIR) $(DESTDIR)$(mandir)
	for x in $(SCRIPTS) ; do \
	    rm -f $(DESTDIR)$(bindir)/$$x ; \
	done
	-$(RMDIR) $(DESTDIR)$(bindir)

%: %.in %.txt
	awk -f generate-help-script.awk $@.in | sed -e 's/@NAME@/'$@'/g' > $@
	chmod a+x $@

xdg-desktop-menu: xdg-desktop-menu.in xdg-utils-common.in
xdg-desktop-icon: xdg-desktop-icon.in xdg-utils-common.in
xdg-email: xdg-email.in xdg-utils-common.in
xdg-mime: xdg-mime.in xdg-utils-common.in
xdg-su: xdg-su.in xdg-utils-common.in
xdg-open: xdg-open.in xdg-utils-common.in
xdg-copy: xdg-copy.in xdg-utils-common.in
xdg-file-dialog: xdg-file-dialog.in xdg-utils-common.in
xdg-screensaver: xdg-screensaver.in xdg-utils-common.in
xdg-icon-resource: xdg-icon-resource.in xdg-utils-common.in

man/%.1: desc/%.xml
	(cd man;$(XMLTO) man ../$<)

index.html: $(XMLFILES)
	(cat html/index.html.pre; \
         xsltproc xsl/refentry2htmlindex.xsl $(XMLFILES); \
         cat html/index.html.post ) > html/index.html

%.html: desc/%.xml
	(cd html;$(XMLTO) html-nochunks ../$<)

%.txt: desc/%.xml
	$(XMLTO) txt $<