File: Makefile.in

package info (click to toggle)
otags 4.05.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 424 kB
  • ctags: 356
  • sloc: ml: 1,267; sh: 212; makefile: 194
file content (317 lines) | stat: -rw-r--r-- 8,496 bytes parent folder | download
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# Otags III
# 
# Hendrik Tews Copyright (C) 2010 - 2017
# 
# This file is part of "Otags III".
# 
# "Otags III" 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.
# 
# "Otags III" 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 in file COPYING in this or one of the parent
# directories for more details.
# 
# You should have received a copy of the GNU General Public License
# along with "Otags III". If not, see
# <http://www.gnu.org/licenses/>.
# 

.PHONY: all otags-binaries
all: otags-binaries

otags-binaries: otags

#############################################################################
##
## CONFIGURATION SECTION
##
#############################################################################

# The following variables are normally set by the configure script. 
# If this fails for some reason you can also rename Makefile.in to Makefile
# and set these variables manually. You also have to rename config.ml.in 
# into config.ml and adjust the values there.

# BINDIR: Directory where binaries are to be instelled. 
BINDIR:=@BINDIR@

# MANDIR: Directory where the man page is to be installed.
MANDIR:=@MANDIR@

# Should be ``otags.opt'' if you have ocamlopt.opt available.
# Should be ``otags.byte'' if you only have ocamlc.
otags: @OTAGS@

# ocaml byte compiler: should be ``ocamlc.opt'' if available, 
# ``ocamlc'' otherwise
OCAMLC:=@OCAMLC@

# native ocaml compiler: 
# should be ``ocamlopt.opt'' or ``ocamlopt'' if available, empty otherwise
OCAMLOPT:=@OCAMLOPT@

# ocaml dependency analyzer
# should be ``ocamldep.opt'' if available, ``ocamldep'' otherwise
OCAMLDEP:=@OCAMLDEP@

#############################################################################
##
## END OF CONFIGURATION SECTION
##
#############################################################################

OCAMLDOC:=ocamldoc.opt

#############################################################################
##
## Compile
##
#############################################################################

.PHONY: otags

#	translate_location.ml \
# 	translate_location.mli \

MAIN_ML_SOURCES:=\
	conf.ml \
	global.ml \
	otags_misc.ml \
	otags_types.ml \
	source_channel.ml \
	fix_location.ml \
	emacs.ml \
	vi.ml \
	tags.ml \
	otags.ml

MLI_SOURCES:=\
	conf.mli \
	global.mli \
	otags_misc.mli \
	otags_types.mli \
	source_channel.mli \
	fix_location.mli \
	emacs.mli \
	vi.mli \
	tags.mli

SOURCES:= $(MLI_SOURCES) $(MAIN_ML_SOURCES)

MAIN_CMO_OBJECTS:=$(MAIN_ML_SOURCES:.ml=.cmo)
MAIN_CMX_OBJECTS:=$(MAIN_ML_SOURCES:.ml=.cmx)

TOCLEAN+=Makefile.deps
Makefile.deps : $(SOURCES)
	$(OCAMLDEP) $(SOURCES) > Makefile.deps

include Makefile.deps

OCAMLFLAGS:=-safe-string -g -I +compiler-libs
OCAMLWARNINGS:=-w A
OCAMLWARNINGS_FOR_TAGS_ML:=-w A-4-11


%.cmx: %.ml
	$(OCAMLOPT) -c $(OCAMLWARNINGS) $(OCAMLFLAGS) $<

%.cmo: %.ml
	$(OCAMLC) -c $(OCAMLWARNINGS) $(OCAMLFLAGS) $<

%.cmi: %.mli
	$(OCAMLC) -c $(OCAMLWARNINGS) $(OCAMLFLAGS) $<

tags.cmx: tags.ml
	$(OCAMLOPT) -c $(OCAMLWARNINGS_FOR_TAGS_ML) $(OCAMLFLAGS) $<

tags.cmo: tags.ml
	$(OCAMLC) -c $(OCAMLWARNINGS_FOR_TAGS_ML) $(OCAMLFLAGS) $<

TOCLEAN+=otags

.PHONY: otags.opt
otags.opt: $(MAIN_CMX_OBJECTS)
	$(OCAMLOPT) $(OCAMLWARNINGS) $(OCAMLFLAGS) -o otags \
		unix.cmxa ocamlcommon.cmxa $^

.PHONY: otags.byte
otags.byte: $(MAIN_CMO_OBJECTS)
	$(OCAMLC) $(OCAMLWARNINGS) $(OCAMLFLAGS) -o otags \
		unix.cma ocamlcommon.cma $^


#############################################################################
##
## Devel build with ppx_flush_catchall
##
#############################################################################

TOCLEAN+=util/ppx_flush_catchall
util/ppx_flush_catchall: util/ppx_flush_catchall.ml
	$(OCAMLOPT) -w A-4 -I +compiler-libs -o util/ppx_flush_catchall \
		ocamlcommon.cmxa util/ppx_flush_catchall.ml

.PHONY: devel-build
devel-build:
	$(MAKE) clean
	$(MAKE) util/ppx_flush_catchall
	$(MAKE) OCAMLWARNINGS_FOR_TAGS_ML="-w A -ppx util/ppx_flush_catchall"

#############################################################################
##
## Install / Uninstall
##
#############################################################################

.PHONY: install
install:
	mkdir -p $(DESTDIR)$(BINDIR)
	mkdir -p $(DESTDIR)$(MANDIR)/man1
	install -m 755 otags $(DESTDIR)$(BINDIR)
	install -m 644 doc/otags.1 $(DESTDIR)$(MANDIR)/man1/otags.1

.PHONY: uninstall
uninstall:
	rm -f $(DESTDIR)$(BINDIR)/otags
	rm -f $(DESTDIR)$(MANDIR)/man1/otags.1


#############################################################################
##
## Testing
##
#############################################################################

TOCLEAN+= test/cpp_*.generated.ml test/cppo_*.generated.ml
TESTSOURCES_ML:= test/a.ml test/b.ml test/d.ml \
	test/cpp_h.generated.ml test/cppo_h.generated.ml
TESTSOURCES_MLI:= test/c.mli test/e.mli
TESTSOURCES_NORM:= $(TESTSOURCES_ML) $(TESTSOURCES_MLI) 
TESTSOURCES:= $(TESTSOURCES_NORM)
COMPILEDTESTS:= $(TESTSOURCES_MLI:.mli=.cmi) \
		$(TESTSOURCES_ML:.ml=.cmo)

# no automated test for syntax errors
TESTSOURCES_ERR:= test/err.ml


test/test.NEWTAGS: otags-binaries $(TESTSOURCES)
	$(MAKE) OCAMLFLAGS="-w a" $(COMPILEDTESTS)
	./otags $(TESTSOURCES_NORM) \
		-o test/test.NEWTAGS

test/test.newtags: otags-binaries $(TESTSOURCES)
	$(MAKE) OCAMLFLAGS="-w a" $(COMPILEDTESTS)
	./otags -vi $(TESTSOURCES_NORM) \
		-o test/test.newtags

test: test/test.NEWTAGS test/test.newtags
	diff -U 0 test/test.TAGS test/test.NEWTAGS
	diff -U 0 test/test.tags test/test.newtags

testtrue: test/test.NEWTAGS test/test.newtags
	diff -U 0 test/test.TAGS test/test.NEWTAGS; true
	diff -U 0 test/test.tags test/test.newtags; true


test/cpp_%.generated.ml: test/cpp_%.source.ml test/cpp_%.include.ml
	cpp $< > $@

test/cppo_%.generated.ml: test/cppo_%.source.ml test/cppo_%.include.ml
	cppo $< > $@

.PHONY: generation
generation:
	cp test/test.NEWTAGS test/test.TAGS 
	cp test/test.newtags test/test.tags 


#############################################################################
##
## other tests
##
#############################################################################

ccsltest:
	rm -f test/ccsl.NEWTAGS
	cwd=$$(pwd); \
	for d in Ccsl Common Keywords ; do \
		cd /home/tews/blau/src/ccsl/Ccslc/$$d; \
		$$cwd/otags -a -r -add-path $$d -o $$cwd/test/ccsl.NEWTAGS . ;\
	done
	cwd=$$(pwd); \
	cd /home/tews/blau/src/ccsl/Ccslc/Ccsl; \
		$$cwd/otags -vi -r -o $$cwd/test/ccsl.newtags .
	diff -U 0 test/ccsl.TAGS test/ccsl.NEWTAGS; true
	diff -U 0 test/ccsl.tags test/ccsl.newtags

ccslgeneration:
	cp test/ccsl.NEWTAGS test/ccsl.TAGS
	cp test/ccsl.newtags test/ccsl.tags


.PHONY: tag-ocaml-source
tag-ocaml-source: otags
	curr=`pwd`; cd /usr/local/src/ocaml-3.12.1; \
	otags -parser-hints $$curr/test/ocaml-3121-hints -r -v \
		-o $$curr/test/ocaml-3121.TAGS .


.PHONY: tag-lib-ocaml
tag-lib-ocaml: otags
	otags -parser-hints test/usr-lib-ocaml-hints -r -v \
		-o test/usr-lib-ocaml.TAGS \
		/tmp/tews/otags-test/root/usr/lib/ocaml


#############################################################################
##
## Internal documentation
##
#############################################################################

TOCLEAN+=dump-o.odoc-dump
dump-o.odoc-dump: $(SOURCES)
	$(OCAMLDOC) -dump $@ $^

.PHONY: doc
doc: dump-o.odoc-dump dump-rq.odoc-dump
	rm -rf doc/internal
	mkdir doc/internal
	$(OCAMLDOC) -d doc/internal -inv-merge-ml-mli -m A \
		-html -load dump-o.odoc-dump -load dump-rq.odoc-dump
	$(OCAMLDOC) -dot -dot-reduce \
		-o doc/internal/dependencies.dot \
		-load dump-o.odoc-dump -load dump-rq.odoc-dump
	dot -Tps doc/internal/dependencies.dot > doc/internal/dependencies.ps

.PHONY: check-doc
check-doc: dump.odoc-dump
	$(OCAMLDOC) -g $(ODOC_CHECK) -load dump.odoc-dump -check-all fcd


#############################################################################
##
## Other goals
##
#############################################################################

clean:
	rm -f $(TOCLEAN)
	rm -f *.cmi *.cmo *.cmx *.o *.cma *.cmxa *.a
	rm -f test/*.cmi test/*.cmo
	rm -f test/*NEWTAGS test/*newtags
	$(MAKE) -C doc clean
	$(MAKE) -C contrib clean


TAGS: $(SOURCES) otags.opt
	./otags $(SOURCES)

tags: $(SOURCES) otags.opt
	./otags -vi $(SOURCES)