summaryrefslogtreecommitdiff
path: root/macros/texinfo/texinfo/js/Makefile.am
blob: 56e8b84316b05b1e09e9a0e63f2aaef16f8e96e8 (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
109
110
111
112
113
## Process this file with automake to produce Makefile.in
# Copyright (C) 2017-2022  Free Software Foundation, Inc.
#
# This file is part of GNU Texinfo.
#
# GNU Texinfo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNU Texinfo is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Texinfo.  If not, see <http://www.gnu.org/licenses/>.


phony =

if HAVE_ESLINT
phony += lint
lint:
	$(ESLINT) -c build-aux/eslint.json info.js -f unix
endif

if HAVE_TYPESCRIPT
phony += check-types
check-types:
	$(TSC) --allowJs --checkJS --noEmit --lib dom,es2017 info.js
endif

if HAVE_UGLIFYJS
phony += minify
minify:
	$(UGLIFYJS) info.js -o info.min.js --mangle --compress
endif

if HAVE_MODERNIZR
phony += modernizr
modernizr:
	$(MODERNIZR) -c build-aux/modernizr.json
endif

.PHONY: $(phony)
EXTRA_DIST =


jsdir=$(pkgdatadir)/js

# Javascript files that will be included in the html pages.  The order
# of those files is the order in which they will be included
js_scripts = \
  modernizr.js \
  info.js

dist_js_DATA=$(js_scripts) info.css

EXTRA_DIST += HACKING README TODO \
              build-aux/eslint.json \
              build-aux/modernizr.json \
              modernizr.js \
              package.json \
              tsconfig.json



## ---------- ##
## Examples.  ##
## ---------- ##

examples: $(examples)

examples = \
  examples/hello-html \
  examples/kawa-html

examples_src = \
  examples/hello \
  examples/kawa \
  kawa.css

# Do not distribute the examples as they take up too much space
#EXTRA_DIST += $(examples_src)


hello_extra_head = '<link rel="stylesheet" type="text/css" href="info.css"/><script src="modernizr.js" type="text/javascript"></script><script src="info.js" type="text/javascript"></script>'

examples/hello-html: examples/hello/hello.texi examples
	mkdir -p examples
	$(MAKEINFO) -I=$(srcdir) --html \
	  -c EXTRA_HEAD=$(hello_extra_head) \
	  $(srcdir)/examples/hello/hello.texi -o $@ && \
	for f in $(js_scripts) info.css ; do \
	  cp $(srcdir)/$$f $@ ; \
	done

kawa_extra_head = '<link rel="stylesheet" type="text/css" href="info.css"/><link rel="stylesheet" type="text/css" href="kawa.css"/><script src="modernizr.js" type="text/javascript"></script><script src="info.js" type="text/javascript"></script>'

examples/kawa-html: examples/kawa/kawa.texi
	mkdir -p examples
	$(MAKEINFO) -I=$(srcdir) --html \
	  -c EXTRA_HEAD=$(kawa_extra_head) \
	  $(srcdir)/examples/kawa/kawa.texi -o $@ && \
	for f in $(js_scripts) info.css kawa.css ; do \
	  cp $(srcdir)/$$f $@ ; \
	done

clean-local:
	rm -rf $(examples)

.PHONY: $(examples)