forked from universal-ctags/ctags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
428 lines (356 loc) · 10.1 KB
/
Makefile.in
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# Makefile for UNIX-like platforms.
# These are the names of the installed programs, in case you wish to change
# them.
#
CTAGS_PROG = @ctags_name_executable@
ETAGS_PROG = @etags_name_executable@
# Set this to the path to your shell (must run Bourne shell commands).
#
SHELL = /bin/sh
# GNU Autoconf variables. These are set by the "configure" script when it
# runs.
#
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
prefix = @prefix@
bindir = @bindir@
srcdir = @srcdir@
libdir = @libdir@
incdir = @includedir@
mandir = @mandir@
datadir = @datarootdir@/@PACKAGE_NAME@
sysconfdir=@sysconfdir@
pkgconfdir=@sysconfdir@/@PACKAGE_NAME@
libexecdir=@libexecdir@
pkglibexecdir=@libexecdir@/@PACKAGE_NAME@
SLINK = @LN_S@
MKDIR_P = @MKDIR_P@
STRIP = @STRIP@
ifdef SPARSE
SPARSEFLAGS=-Wsparse-all
CC = cgcc $(SPARSEFLAGS)
else
CC = @CC@
endif
DEFS = @DEFS@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
# If you cannot run the "configure" script to set the variables above, then
# uncomment the defines below and customize them for your environment. If
# your system does not support symbolic (soft) links, then remove the -s
# from SLINK.
#
#srcdir = .
#bindir = /usr/local/bin
#mandir = /usr/local/man
#SLINK = ln -s
#STRIP = strip
#CC = cc
#DEFS = -DHAVE_CONFIG_H
#CFLAGS = -O
#LDFLAGS=
ALL_CFLAGS = $(CFLAGS) -Wall
DEBUG_CPPFLAGS ?= -DDEBUG
ALL_CPPFLAGS = $(CPPFLAGS) \
$(DEBUG_CPPFLAGS) \
-DDATADIR=\"$(datadir)\" \
-DPKGCONFDIR=\"$(pkgconfdir)\" \
-DPKGLIBEXECDIR=\"$(pkglibexecdir)\"
include $(srcdir)/source.mak
#
#--- You should not need to modify anything below this line. ---#
#
.SUFFIXES:
.SUFFIXES: .c .$(OBJEXT)
VPATH = $(srcdir) $(srcdir)/data/corpora \
$(srcdir)/data/optlib $(srcdir)/gnu_regex $(srcdir)/fnmatch
INSTALL = cp -p
INSTALL_PROG = $(INSTALL)
INSTALL_DATA = $(INSTALL)
READ_LIB = readtags.$(OBJEXT)
READ_INC = readtags.h
MANPAGE = ctags.1
AUTO_GEN = configure config.h.in
CONFIG_GEN = config.cache config.log config.status config.run config.h Makefile
#
# names for installed man pages
#
manext = 1
man1dir = $(mandir)/man1
CMAN = $(CTAGS_PROG).$(manext)
EMAN = $(ETAGS_PROG).$(manext)
#
# corpora files
#
corporadir = $(datadir)/corpora
pkgconf_corporadir = $(pkgconfdir)/corpora
CORPORA = ctags.ctags RFC1213-MIB.txt
#
# preload
#
preloaddir = $(datadir)/preload
pkgconf_preloaddir = $(pkgconfdir)/preload
PRELOAD_OPTLIB = \
\
coffee.ctags \
ctags.ctags \
m4.ctags \
mib.ctags \
\
$(NULL)
DEFAULT_PRELOAD_FILE=default.ctags
#
# config files
#
optlibdir = $(datadir)/optlib
pkgconf_optlibdir = $(pkgconfdir)/optlib
OPTLIB = $(PRELOAD_OPTLIB)
#
# drivers
#
driversdir = $(pkglibexecdir)/drivers
DRIVERS = coffeetags
#
# destinations for installed files
#
CTAGS_EXEC = $(CTAGS_PROG)$(EXEEXT)
ETAGS_EXEC = $(ETAGS_PROG)$(EXEEXT)
READ_CMD = readtags$(EXEEXT)
DEST_CTAGS = $(bindir)/$(CTAGS_EXEC)
DEST_ETAGS = $(bindir)/$(ETAGS_EXEC)
DEST_READ_CMD = $(bindir)/$(READ_CMD)
DEST_READ_LIB = $(libdir)/$(READ_LIB)
DEST_READ_INC = $(incdir)/$(READ_INC)
DEST_CMAN = $(man1dir)/$(CMAN)
DEST_EMAN = $(man1dir)/$(EMAN)
#
# primary rules
#
all: $(CTAGS_EXEC) $(READ_LIB) $(READ_CMD)
$(CTAGS_EXEC): $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
$(READ_CMD): readtags.c readtags.h
$(CC) -DREADTAGS_MAIN -I. -I$(srcdir) -I$(srcdir)/main $(DEFS) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(srcdir)/readtags.c
ETYPEREF_OBJS = etyperef.o keyword.o routines.o strlist.o vstring.o
etyperef$(EXEEXT): $(ETYPEREF_OBJS)
$(CC) $(LDFLAGS) -o $@ $(ETYPEREF_OBJS)
etyperef.o: eiffel.c
$(CC) -DTYPE_REFERENCE_TOOL -I. -I$(srcdir) -I$(srcdir)/main $(DEFS) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ -c $(srcdir)/eiffel.c
$(OBJECTS): $(HEADERS) config.h Makefile
# Regenerate the Makefile whenever this file (it's source) changed. Any target
# should trigger this as it may affect their rules. This implementation only
# works with GNU make but should be harmless for other implementations.
%: Makefile
Makefile: Makefile.in config.status
./config.status --file $@
config.h: config.h.in config.status
./config.status --header $@
# Regenerate the build system whenever it changed
config.status: configure
./config.status --recheck
configure: configure.ac
autoreconf -vi
#
# generic install rules
#
install: @install_targets@
install-strip: install
install-ctags: install-cbin install-cman
install-etags: install-ebin install-eman
INSTALLDIRS = $(bindir) $(man1dir) $(libdir) $(incdir) \
$(corporadir) $(optlibdir) $(preloaddir) $(driversdir) \
$(pkgconf_corporadir) $(pkgconf_optlibdir) $(pkgconf_preloaddir)
$(addprefix $(DESTDIR),$(INSTALLDIRS)):
$(srcdir)/mkinstalldirs $@
FORCE:
#
# install the executables
#
install-bin: install-cbin install-ebin install-lib install-cmd
install-cbin: $(DEST_CTAGS)
install-ebin: $(DEST_ETAGS)
install-lib: $(DEST_READ_LIB) $(DEST_READ_INC)
install-cmd: $(DEST_READ_CMD)
$(DEST_CTAGS): $(CTAGS_EXEC) $(DESTDIR)$(bindir) FORCE
$(INSTALL_PROG) $(CTAGS_EXEC) $(DESTDIR)$@ && chmod 755 $(DESTDIR)$@
$(DEST_ETAGS):
- if [ -x $(DESTDIR)$(DEST_CTAGS) ]; then \
cd $(DESTDIR)$(bindir) && $(SLINK) $(CTAGS_EXEC) $(ETAGS_EXEC); \
fi
#
# install the man pages
#
install-man: install-cman install-eman
install-cman: $(DEST_CMAN)
install-eman: $(DEST_EMAN)
$(DEST_CMAN): $(DESTDIR)$(man1dir) $(MANPAGE) FORCE
- $(INSTALL_DATA) $(srcdir)/$(MANPAGE) $(DESTDIR)$@ && chmod 644 $(DESTDIR)$@
$(DEST_EMAN):
- if [ -f $(DESTDIR)$(DEST_CMAN) ]; then \
cd $(DESTDIR)$(man1dir) && $(SLINK) $(CMAN) $(EMAN); \
fi
#
# install the library
#
$(DEST_READ_LIB): $(READ_LIB) $(DESTDIR)$(libdir) FORCE
$(INSTALL_PROG) $(READ_LIB) $(DESTDIR)$@ && chmod 644 $(DESTDIR)$@
$(DEST_READ_INC): $(READ_INC) $(DESTDIR)$(incdir) FORCE
$(INSTALL_PROG) $(READ_INC) $(DESTDIR)$@ && chmod 644 $(DESTDIR)$@
#
# install the readtags command
#
$(DEST_READ_CMD): $(READ_CMD) $(DESTDIR)$(bindir) FORCE
$(INSTALL_PROG) $(READ_CMD) $(DESTDIR)$@ && chmod 755 $(DESTDIR)$@
#
# install data
#
install-data: @install_data_targets@
install-data-corpora: $(addprefix data/corpora/,$(CORPORA)) $(DESTDIR)$(corporadir) $(DESTDIR)$(pkgconf_corporadir) FORCE
for c in $(CORPORA); do \
$(INSTALL_DATA) $(srcdir)/data/corpora/$$c $(DESTDIR)$(corporadir)/$$c && chmod 644 $(DESTDIR)$(corporadir)/$$c; \
done
install-data-optlib: $(addprefix data/optlib/,$(OPTLIB)) $(DESTDIR)$(optlibdir) $(DESTDIR)$(pkgconf_optlibdir) FORCE
for c in $(OPTLIB); do \
$(INSTALL_DATA) $(srcdir)/data/optlib/$$c $(DESTDIR)$(optlibdir)/$$c && chmod 644 $(DESTDIR)$(optlibdir)/$$c; \
done
install-data-preload: $(DESTDIR)$(preloaddir) $(DESTDIR)$(pkgconf_preloaddir) FORCE
echo > $(DESTDIR)$(preloaddir)/$(DEFAULT_PRELOAD_FILE)
for c in $(PRELOAD_OPTLIB); do \
echo "--options=$$(basename $$c .ctags)" >> $(DESTDIR)$(preloaddir)/$(DEFAULT_PRELOAD_FILE); \
done
chmod 644 $(DESTDIR)$(preloaddir)/$(DEFAULT_PRELOAD_FILE)
#
# install libexec
#
install-libexec: @install_libexec_targets@
install-libexec-drivers: $(addprefix libexec/drivers/,$(DRIVERS)) $(DESTDIR)$(driversdir) FORCE
for x in $(DRIVERS); do \
$(INSTALL_PROG) $(srcdir)/libexec/drivers/$$x $(DESTDIR)$(driversdir)/$$x && chmod 755 $(DESTDIR)$(driversdir)/$$x; \
done
#
# rules for uninstalling
#
uninstall: uninstall-bin uninstall-lib uninstall-cmd uninstall-man uninstall-data uninstall-libexec
uninstall-bin:
- rm -f $(DEST_CTAGS) $(DEST_ETAGS)
uninstall-lib:
- rm -f $(DEST_READ_LIB) $(DEST_READ_INC)
uninstall-cmd:
- rm -f $(DEST_READ_CMD)
uninstall-man:
- rm -f $(DEST_CMAN) $(DEST_EMAN)
uninstall-ctags:
- rm -f $(DEST_CTAGS) $(DEST_CMAN)
uninstall-etags:
- rm -f $(DEST_ETAGS) $(DEST_EMAN)
uninstall-data: uninstall-corpora uninstall-optlib uninstall-preload
- rmdir $(datadir)
- rmdir $(pkgconfdir)
uninstall-corpora:
- rm -f $(addprefix $(corporadir)/,$(CORPORA))
- rmdir $(corporadir)
- rmdir $(pkgconf_corporadir)
uninstall-optlib:
- rm -f $(addprefix $(optlibdir)/,$(OPTLIB))
- rmdir $(optlibdir)
- rmdir $(pkgconf_optlibdir)
uninstall-preload:
- rm -f $(preloaddir)/$(DEFAULT_PRELOAD_FILE)
- rmdir $(preloaddir)
- rmdir $(pkgconf_preloaddir)
uninstall-libexec: uninstall-drivers
- rmdir $(pkglibexecdir)
uninstall-drivers:
- rm -f $(addprefix $(driversdir)/,$(DRIVERS))
- rmdir $(driversdir)
#
# miscellaneous rules
#
tags: $(CTAGS_EXEC)
./$(CTAGS_EXEC) $(srcdir)/*
TAGS: $(CTAGS_EXEC)
./$(CTAGS_EXEC) -e $(srcdir)/*
clean: clean-units
rm -f $(OBJECTS) $(CTAGS_EXEC) tags TAGS $(READ_LIB)
rm -f etyperef$(EXEEXT) etyperef.$(OBJEXT)
mostlyclean: clean
distclean: clean
rm -f $(CONFIG_GEN)
maintainerclean: distclean
rm -f $(AUTO_GEN)
rm -rf autom4te.cache/
#
# implicit rules
#
.c.$(OBJEXT):
dir="$$(dirname $@)"; [ -d "$$dir" ] || $(MKDIR_P) "$$dir"
$(CC) -I. -I$(srcdir) -I$(srcdir)/main $(DEFS) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ -c $<
$(addsuffix .$(OBJEXT),$(basename $(notdir $(REGEX_SOURCES)))): ALL_CPPFLAGS += \
-D_GNU_SOURCE -D__USE_GNU -Dbool=int -Dfalse=0 -Dtrue=1
#
# check
#
CTAGS_TEST = ./$(CTAGS_EXEC)
ifdef VG
VALGRIND=--with-valgrind
endif
ifdef SHRINK
RUN_SHRINK=--run-shrink
endif
TIMEOUT=
LANGUAGES=
CATEGORIES=
UNITS=
ifdef TRAVIS
SHOW_DIFF_OUTPUT=--show-diff-output
endif
.PHONY: check units fuzz noise clean-units
check: units
#
# FUZZ Target
#
# SHELL must be dash or bash.
#
fuzz: TIMEOUT := $(shell timeout --version > /dev/null 2>&1 && echo 1 || echo 0)
fuzz: $(CTAGS_TEST)
@ \
c="misc/units fuzz \
--ctags=$(CTAGS_TEST) \
--languages=$(LANGUAGES) \
$(VALGRIND) $(RUN_SHRINK) \
--with-timeout=$(TIMEOUT)"; \
$(SHELL) $${c} Units
#
# NOISE Target
#
noise: $(CTAGS_TEST)
@ \
c="misc/units noise \
--ctags=$(CTAGS_TEST) \
--languages=$(LANGUAGES) \
$(VALGRIND) $(RUN_SHRINK) \
--with-timeout=$(TIMEOUT)"; \
$(SHELL) $${c} Units
#
# UNITS Target
#
units: TIMEOUT := $(shell timeout --version > /dev/null 2>&1 && echo 5 || echo 0)
units: $(CTAGS_TEST)
@ \
c="misc/units run \
--ctags=$(CTAGS_TEST) \
--languages=$(LANGUAGES) \
--categories=$(CATEGORIES) \
--units=$(UNITS) \
$(VALGRIND) $(RUN_SHRINK) \
--with-timeout=$(TIMEOUT) \
$(SHOW_DIFF_OUTPUT)"; \
$(SHELL) $${c} Units
clean-units:
$(SHELL) misc/units clean Units
# vi:set tabstop=8: