ctags.rb 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. data/Gemfile +2 -0
  2. data/Rakefile +23 -0
  3. data/ctags.rb.gemspec +23 -0
  4. data/ext/.gitignore +3 -0
  5. data/ext/extconf.rb +15 -0
  6. data/ext/vendor/exuberant-ctags/.gitignore +6 -0
  7. data/ext/vendor/exuberant-ctags/.indent.pro +31 -0
  8. data/ext/vendor/exuberant-ctags/COPYING +340 -0
  9. data/ext/vendor/exuberant-ctags/EXTENDING.html +386 -0
  10. data/ext/vendor/exuberant-ctags/FAQ +371 -0
  11. data/ext/vendor/exuberant-ctags/INSTALL +215 -0
  12. data/ext/vendor/exuberant-ctags/INSTALL.oth +73 -0
  13. data/ext/vendor/exuberant-ctags/MAINTAINERS +88 -0
  14. data/ext/vendor/exuberant-ctags/Makefile.in +222 -0
  15. data/ext/vendor/exuberant-ctags/NEWS +871 -0
  16. data/ext/vendor/exuberant-ctags/README +73 -0
  17. data/ext/vendor/exuberant-ctags/ant.c +42 -0
  18. data/ext/vendor/exuberant-ctags/argproc.c +505 -0
  19. data/ext/vendor/exuberant-ctags/args.c +274 -0
  20. data/ext/vendor/exuberant-ctags/args.h +63 -0
  21. data/ext/vendor/exuberant-ctags/asm.c +387 -0
  22. data/ext/vendor/exuberant-ctags/asp.c +328 -0
  23. data/ext/vendor/exuberant-ctags/awk.c +81 -0
  24. data/ext/vendor/exuberant-ctags/basic.c +203 -0
  25. data/ext/vendor/exuberant-ctags/beta.c +321 -0
  26. data/ext/vendor/exuberant-ctags/c.c +2932 -0
  27. data/ext/vendor/exuberant-ctags/cobol.c +50 -0
  28. data/ext/vendor/exuberant-ctags/config.h.in +277 -0
  29. data/ext/vendor/exuberant-ctags/configure +7704 -0
  30. data/ext/vendor/exuberant-ctags/configure.ac +532 -0
  31. data/ext/vendor/exuberant-ctags/ctags.1 +1186 -0
  32. data/ext/vendor/exuberant-ctags/ctags.h +28 -0
  33. data/ext/vendor/exuberant-ctags/ctags.html +2087 -0
  34. data/ext/vendor/exuberant-ctags/ctags.spec +40 -0
  35. data/ext/vendor/exuberant-ctags/debug.c +113 -0
  36. data/ext/vendor/exuberant-ctags/debug.h +70 -0
  37. data/ext/vendor/exuberant-ctags/descrip.mms +68 -0
  38. data/ext/vendor/exuberant-ctags/dosbatch.c +42 -0
  39. data/ext/vendor/exuberant-ctags/e_amiga.h +24 -0
  40. data/ext/vendor/exuberant-ctags/e_djgpp.h +47 -0
  41. data/ext/vendor/exuberant-ctags/e_mac.h +143 -0
  42. data/ext/vendor/exuberant-ctags/e_msoft.h +76 -0
  43. data/ext/vendor/exuberant-ctags/e_os2.h +37 -0
  44. data/ext/vendor/exuberant-ctags/e_qdos.h +34 -0
  45. data/ext/vendor/exuberant-ctags/e_riscos.h +58 -0
  46. data/ext/vendor/exuberant-ctags/e_vms.h +31 -0
  47. data/ext/vendor/exuberant-ctags/eiffel.c +1352 -0
  48. data/ext/vendor/exuberant-ctags/entry.c +847 -0
  49. data/ext/vendor/exuberant-ctags/entry.h +103 -0
  50. data/ext/vendor/exuberant-ctags/erlang.c +189 -0
  51. data/ext/vendor/exuberant-ctags/flex.c +2243 -0
  52. data/ext/vendor/exuberant-ctags/fortran.c +2197 -0
  53. data/ext/vendor/exuberant-ctags/general.h +127 -0
  54. data/ext/vendor/exuberant-ctags/get.c +669 -0
  55. data/ext/vendor/exuberant-ctags/get.h +50 -0
  56. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/all-wcprops +47 -0
  57. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/entries +112 -0
  58. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/README.txt.svn-base +5 -0
  59. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regcomp.c.svn-base +3818 -0
  60. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex.c.svn-base +74 -0
  61. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex.h.svn-base +575 -0
  62. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex_internal.c.svn-base +1713 -0
  63. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex_internal.h.svn-base +773 -0
  64. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regexec.c.svn-base +4338 -0
  65. data/ext/vendor/exuberant-ctags/gnu_regex/README.txt +5 -0
  66. data/ext/vendor/exuberant-ctags/gnu_regex/regcomp.c +3818 -0
  67. data/ext/vendor/exuberant-ctags/gnu_regex/regex.c +74 -0
  68. data/ext/vendor/exuberant-ctags/gnu_regex/regex.h +575 -0
  69. data/ext/vendor/exuberant-ctags/gnu_regex/regex_internal.c +1713 -0
  70. data/ext/vendor/exuberant-ctags/gnu_regex/regex_internal.h +773 -0
  71. data/ext/vendor/exuberant-ctags/gnu_regex/regexec.c +4338 -0
  72. data/ext/vendor/exuberant-ctags/html.c +49 -0
  73. data/ext/vendor/exuberant-ctags/jscript.c +1572 -0
  74. data/ext/vendor/exuberant-ctags/keyword.c +258 -0
  75. data/ext/vendor/exuberant-ctags/keyword.h +34 -0
  76. data/ext/vendor/exuberant-ctags/lisp.c +139 -0
  77. data/ext/vendor/exuberant-ctags/lregex.c +704 -0
  78. data/ext/vendor/exuberant-ctags/lua.c +133 -0
  79. data/ext/vendor/exuberant-ctags/mac.c +273 -0
  80. data/ext/vendor/exuberant-ctags/magic.diff +21 -0
  81. data/ext/vendor/exuberant-ctags/main.c +584 -0
  82. data/ext/vendor/exuberant-ctags/main.h +32 -0
  83. data/ext/vendor/exuberant-ctags/maintainer.mak +476 -0
  84. data/ext/vendor/exuberant-ctags/make.c +217 -0
  85. data/ext/vendor/exuberant-ctags/matlab.c +44 -0
  86. data/ext/vendor/exuberant-ctags/mk_bc3.mak +46 -0
  87. data/ext/vendor/exuberant-ctags/mk_bc5.mak +49 -0
  88. data/ext/vendor/exuberant-ctags/mk_djg.mak +18 -0
  89. data/ext/vendor/exuberant-ctags/mk_manx.mak +65 -0
  90. data/ext/vendor/exuberant-ctags/mk_mingw.mak +31 -0
  91. data/ext/vendor/exuberant-ctags/mk_mpw.mak +130 -0
  92. data/ext/vendor/exuberant-ctags/mk_mvc.mak +40 -0
  93. data/ext/vendor/exuberant-ctags/mk_os2.mak +104 -0
  94. data/ext/vendor/exuberant-ctags/mk_qdos.mak +100 -0
  95. data/ext/vendor/exuberant-ctags/mk_sas.mak +63 -0
  96. data/ext/vendor/exuberant-ctags/mkinstalldirs +40 -0
  97. data/ext/vendor/exuberant-ctags/ocaml.c +1842 -0
  98. data/ext/vendor/exuberant-ctags/options.c +1842 -0
  99. data/ext/vendor/exuberant-ctags/options.h +155 -0
  100. data/ext/vendor/exuberant-ctags/parse.c +677 -0
  101. data/ext/vendor/exuberant-ctags/parse.h +129 -0
  102. data/ext/vendor/exuberant-ctags/parsers.h +63 -0
  103. data/ext/vendor/exuberant-ctags/pascal.c +267 -0
  104. data/ext/vendor/exuberant-ctags/perl.c +382 -0
  105. data/ext/vendor/exuberant-ctags/php.c +237 -0
  106. data/ext/vendor/exuberant-ctags/python.c +771 -0
  107. data/ext/vendor/exuberant-ctags/qdos.c +106 -0
  108. data/ext/vendor/exuberant-ctags/read.c +569 -0
  109. data/ext/vendor/exuberant-ctags/read.h +116 -0
  110. data/ext/vendor/exuberant-ctags/readtags.c +959 -0
  111. data/ext/vendor/exuberant-ctags/readtags.h +252 -0
  112. data/ext/vendor/exuberant-ctags/rexx.c +39 -0
  113. data/ext/vendor/exuberant-ctags/routines.c +891 -0
  114. data/ext/vendor/exuberant-ctags/routines.h +134 -0
  115. data/ext/vendor/exuberant-ctags/ruby.c +408 -0
  116. data/ext/vendor/exuberant-ctags/scheme.c +111 -0
  117. data/ext/vendor/exuberant-ctags/sh.c +115 -0
  118. data/ext/vendor/exuberant-ctags/slang.c +41 -0
  119. data/ext/vendor/exuberant-ctags/sml.c +212 -0
  120. data/ext/vendor/exuberant-ctags/sort.c +230 -0
  121. data/ext/vendor/exuberant-ctags/sort.h +32 -0
  122. data/ext/vendor/exuberant-ctags/source.mak +122 -0
  123. data/ext/vendor/exuberant-ctags/sql.c +2112 -0
  124. data/ext/vendor/exuberant-ctags/strlist.c +281 -0
  125. data/ext/vendor/exuberant-ctags/strlist.h +54 -0
  126. data/ext/vendor/exuberant-ctags/tcl.c +116 -0
  127. data/ext/vendor/exuberant-ctags/tex.c +524 -0
  128. data/ext/vendor/exuberant-ctags/verilog.c +340 -0
  129. data/ext/vendor/exuberant-ctags/vhdl.c +835 -0
  130. data/ext/vendor/exuberant-ctags/vim.c +636 -0
  131. data/ext/vendor/exuberant-ctags/vstring.c +232 -0
  132. data/ext/vendor/exuberant-ctags/vstring.h +85 -0
  133. data/ext/vendor/exuberant-ctags/yacc.c +40 -0
  134. data/lib/ctags/exuberant.rb +45 -0
  135. data/lib/ctags/version.rb +3 -0
  136. data/lib/ctags.rb +6 -0
  137. data/test/test_ctags.rb +24 -0
  138. metadata +233 -0
@@ -0,0 +1,476 @@
1
+ # $Id: maintainer.mak 722 2009-07-09 16:10:35Z dhiebert $
2
+ #
3
+ # Copyright (c) 1996-2009, Darren Hiebert
4
+ #
5
+ # Development makefile for Exuberant Ctags. Also used to build releases.
6
+ # Requires GNU make.
7
+
8
+ OBJEXT := o
9
+
10
+ include source.mak
11
+
12
+ DSOURCES := $(SOURCES) debug.c
13
+
14
+ VERSION_FILES:= ctags.h ctags.1 NEWS
15
+
16
+ LIB_FILES := readtags.c readtags.h
17
+
18
+ ENVIRONMENT_MAKEFILES := \
19
+ mk_bc3.mak mk_bc5.mak mk_djg.mak mk_manx.mak mk_mingw.mak \
20
+ mk_mpw.mak mk_mvc.mak mk_os2.mak mk_qdos.mak mk_sas.mak \
21
+
22
+ COMMON_FILES := COPYING EXTENDING.html FAQ INSTALL.oth MAINTAINERS NEWS README \
23
+ $(ENVIRONMENT_MAKEFILES) source.mak \
24
+ $(DSOURCES) $(HEADERS) $(LIB_FILES) \
25
+ $(ENVIRONMENT_SOURCES) $(ENVIRONMENT_HEADERS)
26
+
27
+ UNIX_FILES := $(COMMON_FILES) \
28
+ .indent.pro INSTALL configure.ac \
29
+ Makefile.in maintainer.mak \
30
+ descrip.mms mkinstalldirs magic.diff \
31
+ ctags.spec ctags.1
32
+
33
+ REGEX_DIR := gnu_regex
34
+
35
+ WIN_FILES := $(COMMON_FILES) $(VERSION_FILES)
36
+
37
+ SVN_FILES := $(UNIX_FILES)
38
+
39
+ DEP_DIR := .deps
40
+
41
+ OBJECTS := $(patsubst %.c,%.o,$(notdir $(SOURCES)))
42
+ DOBJECTS := $(patsubst %.c,%.od,$(notdir $(DSOURCES)))
43
+ DEPS := $(patsubst %.c,$(DEP_DIR)/%.d,$(notdir $(SOURCES)))
44
+
45
+ WARNINGS := -Wall -W -Wpointer-arith -Wcast-align -Wwrite-strings \
46
+ -Wmissing-prototypes -Wmissing-declarations \
47
+ -Wnested-externs -Wcast-qual -Wshadow -pedantic \
48
+ -Wstrict-prototypes \
49
+ # -Wtraditional -Wconversion -Werror
50
+
51
+ PRODUCER := Darren B. Hiebert
52
+ EMAIL := dhiebert@users.sourceforge.net
53
+ CTAGS_WEBSITE := http://ctags.sourceforge.net
54
+ RPM_ROOT := rpms
55
+ RPM_ABS_ROOT := $(PWD)/$(RPM_ROOT)
56
+ WINDOWS_DIR := win32
57
+ RELEASE_DIR := releases
58
+ CTAGS_WEBDIR := website
59
+ win_version = $(subst .,,$(version))
60
+ HOST_ARCH := $(shell uname -p)
61
+
62
+ ifneq ($(findstring $(HOST_ARCH),i386 i686),)
63
+ COMP_ARCH := -march=i686
64
+ endif
65
+
66
+ CC := gcc
67
+ INCLUDE := -I.
68
+ DEFS := -DHAVE_CONFIG_H
69
+ COMP_FLAGS := $(INCLUDE) $(DEFS) $(CFLAGS)
70
+ PROF_OPT := -O3 $(COMP_ARCH)
71
+ #OPT := $(PROF_OPT) -fomit-frame-pointer
72
+ OPT := $(PROF_OPT)
73
+ DCFLAGS := $(COMP_FLAGS) -DDEBUG -DINTERNAL_SORT
74
+ LD := gcc
75
+ LDFLAGS :=
76
+ RPM_FLAGS := -O3 $(COMP_ARCH)
77
+
78
+ AUTO_GEN := configure config.h.in
79
+ CONFIG_GEN := config.cache config.log config.status config.run config.h Makefile
80
+ PROF_GEN := gmon.out
81
+ COV_GEN := *.da *.gcov
82
+
83
+ UNIX2DOS := perl -pe 's/(\r\n|\n|\r)/\r\n/g'
84
+ MAN2HTML := tbl | groff -Wall -mtty-char -mandoc -Thtml -c
85
+
86
+ #
87
+ # Targets
88
+ #
89
+ default: all
90
+ ifeq ($(findstring clean,$(MAKECMDGOALS)),)
91
+ ifeq ($(wildcard config.h),)
92
+ ctags dctags ctags.prof ctags.cov:
93
+ $(MAKE) config.h
94
+ $(MAKE) $(MAKECMDGOALS)
95
+ else
96
+ all: dctags tags syntax.vim
97
+
98
+ -include $(DEPS) $(DEP_DIR)/readtags.d
99
+
100
+ #
101
+ # Executable targets
102
+ #
103
+ ctags: $(OBJECTS)
104
+ @ echo "-- Linking $@"
105
+ @ $(LD) -o $@ $(LDFLAGS) $^
106
+
107
+ dctags: $(DOBJECTS) debug.od
108
+ @ echo "-- Building $@"
109
+ $(LD) -o $@ $(LDFLAGS) $^
110
+
111
+ ctags.prof: $(SOURCES) $(HEADERS) Makefile
112
+ $(CC) -pg $(PROF_OPT) $(COMP_FLAGS) $(WARNINGS) $(SOURCES) -o $@
113
+
114
+ ctags.cov: $(SOURCES) $(HEADERS) Makefile
115
+ $(CC) -fprofile-arcs -ftest-coverage $(COMP_FLAGS) $(WARNINGS) $(SOURCES) -o $@
116
+
117
+ gcov: $(SOURCES:.c=.c.gcov)
118
+
119
+ readtags: readtags.[ch]
120
+ $(CC) -g $(COMP_FLAGS) -DDEBUG -DREADTAGS_MAIN -o $@ readtags.c
121
+
122
+ readtags.o: readtags.c readtags.h
123
+ $(CC) $(COMP_FLAGS) -c readtags.c
124
+
125
+ etyperef: etyperef.o keyword.o routines.o strlist.o vstring.o
126
+ $(CC) -o $@ $^
127
+
128
+ etyperef.o: eiffel.c
129
+ $(CC) -DTYPE_REFERENCE_TOOL $(OPT) $(COMP_FLAGS) -o $@ -c $<
130
+
131
+ endif
132
+ endif
133
+
134
+ #
135
+ # Support targets
136
+ #
137
+ FORCE:
138
+
139
+ config.h.in: configure.ac
140
+ autoheader
141
+ @ touch $@
142
+
143
+ configure: configure.ac
144
+ autoconf
145
+
146
+ config.status: configure
147
+ ./config.status --recheck
148
+
149
+ config.h: config.h.in config.status
150
+ ./config.status
151
+ touch $@
152
+
153
+ depclean:
154
+ rm -f $(DEPS)
155
+
156
+ profclean:
157
+ rm -f $(PROF_GEN)
158
+
159
+ gcovclean:
160
+ rm -f $(COV_GEN)
161
+
162
+ clean: depclean profclean gcovclean clean-test
163
+ rm -f *.[ois] *.o[dm] ctags dctags ctags*.exe readtags etyperef \
164
+ ctags.man ctags.html ctags.prof ctags.cov *.bb *.bbg tags TAGS syntax.vim
165
+
166
+ distclean: clean
167
+ rm -f $(CONFIG_GEN)
168
+
169
+ maintainer-clean maintclean: distclean
170
+ rm -f $(AUTO_GEN)
171
+
172
+ %.man: %.1 Makefile
173
+ tbl $< | groff -Wall -mtty-char -mandoc -Tascii -c | sed 's/.//g' > $@
174
+
175
+ %.html: %.1 Makefile
176
+ cat $< | $(MAN2HTML) > $@
177
+
178
+ tags: $(DSOURCES) $(HEADERS) $(LIB_FILES) Makefile *.mak
179
+ @ echo "-- Building tag file"
180
+ @ ctags *
181
+
182
+ #
183
+ # Create a Vim syntax file for all typedefs
184
+ #
185
+ syntax: syntax.vim
186
+ syntax.vim: $(DSOURCES) $(HEADERS) $(LIB_FILES)
187
+ @ echo "-- Generating syntax file"
188
+ @ ctags --c-types=cgstu --file-scope -o- $^ |\
189
+ awk '{print $$1}' | sort -u | fmt |\
190
+ awk '{printf("syntax keyword Typedef\t%s\n", $$0)}' > $@
191
+
192
+ #
193
+ # Testing
194
+ #
195
+ -include testing.mak
196
+
197
+ #
198
+ # Help
199
+ #
200
+ help:
201
+ @ echo "Major targets:"
202
+ @ echo "default : Build dctags, with debugging support"
203
+ @ echo "ctags : Build optimized binary"
204
+ @ echo "help-release: Print help on releasing ctags"
205
+
206
+ #
207
+ # Release management
208
+ #
209
+
210
+ help-release:
211
+ @ echo "1. make release-svn-X.Y"
212
+ @ echo "2. make release-source-X.Y"
213
+ @ echo "3. move ctags-X.Y.tar.gz to Linux"
214
+ @ echo "4. On Linux: Extract tar; make -f maintainer.mak release-rpm-X.Y"
215
+ @ echo "5. On Windows: cd $(WINDOWS_DIR)/winXY; nmake -f mk_mvc.mak ctags.exe mostlyclean"
216
+ @ echo "6. make version=X.Y win-zip"
217
+ @ echo "7. make website-X.Y"
218
+
219
+ .SECONDARY:
220
+
221
+ RPM_ARCH := i386
222
+ RPM_SUBDIRS := BUILD SOURCES SPECS SRPMS RPMS
223
+ RPM_DIRS := $(addprefix $(RPM_ROOT)/,$(RPM_SUBDIRS))
224
+
225
+ $(RELEASE_DIR)/ctags-%-1.$(RPM_ARCH).rpm: \
226
+ $(RPM_ROOT)/RPMS/$(RPM_ARCH)/ctags-%-1.$(RPM_ARCH).rpm \
227
+ | $(RELEASE_DIR)
228
+ ln -f $< $@
229
+ chmod 644 $@
230
+
231
+ $(RELEASE_DIR)/ctags-%-1.src.rpm: \
232
+ $(RPM_ROOT)/SRPMS/ctags-%-1.src.rpm \
233
+ | $(RELEASE_DIR)
234
+ ln -f $< $@
235
+ chmod 644 $@
236
+
237
+ $(eval $(RPM_DIRS) $(RELEASE_DIR): ; mkdir -p $$@)
238
+
239
+ $(RPM_ROOT)/SRPMS/ctags-%-1.src.rpm \
240
+ $(RPM_ROOT)/RPMS/$(RPM_ARCH)/ctags-%-1.$(RPM_ARCH).rpm: \
241
+ $(RPM_ROOT)/SOURCES/ctags-%.tar.gz \
242
+ $(RPM_ROOT)/SPECS/ctags-%.spec \
243
+ | $(RPM_DIRS)
244
+ rpmbuild --define '_topdir $(RPM_ABS_ROOT)' --define 'optflags $(RPM_FLAGS)' --define 'packager $(PRODUCER) $(CTAGS_WEBSITE)' -ba $(RPM_ROOT)/SPECS/ctags-$*.spec
245
+ rm -fr $(RPM_ROOT)/BUILD/ctags-$*
246
+
247
+ $(RPM_ROOT)/rpmrc: rpmmacros maintainer.mak
248
+ echo "optflags: $(RPM_ARCH) $(RPM_FLAGS)" > $@
249
+ echo "macrofiles: $(PWD)/rpmmacros" >> $@
250
+
251
+ $(RPM_ROOT)/rpmmacros: maintainer.mak
252
+ echo "%_topdir $(RPM_ABS_ROOT)" > $@
253
+ echo '%_gpg_name "$(PRODUCER) <$(EMAIL)>"' >> $@
254
+ echo "%packager $(PRODUCER) $(CTAGS_WEBSITE)" >> $@
255
+ echo "%_i18ndomains %{nil}" >> $@
256
+ echo "%debug_package %{nil}" >> $@
257
+
258
+ $(RPM_ROOT)/SPECS/ctags-%.spec: ctags.spec | $(RPM_ROOT)/SPECS
259
+ sed -e "s/@VERSION@/$*/" ctags.spec > $(RPM_ROOT)/SPECS/ctags-$*.spec
260
+
261
+ $(RPM_ROOT)/SOURCES/ctags-%.tar.gz: $(RELEASE_DIR)/ctags-%.tar.gz | $(RPM_ROOT)/SOURCES
262
+ ln -f $< $@
263
+
264
+ $(RELEASE_DIR)/ctags-%.tar.gz: $(UNIX_FILES) | $(RELEASE_DIR)
265
+ @ echo "---------- Building tar ball"
266
+ if [ -d $(@D)/dirs/ctags-$* ]; then rm -fr $(@D)/dirs/ctags-$*; fi
267
+ mkdir -p $(@D)/dirs/ctags-$*
268
+ cp -pr $(UNIX_FILES) $(REGEX_DIR) $(@D)/dirs/ctags-$*/
269
+ sed -e 's/\(PROGRAM_VERSION\) "\([^ ]*\)"/\1 "$*"/' ctags.h > $(@D)/dirs/ctags-$*/ctags.h
270
+ sed -e 's/"\(Version\) \([^ ]*\)"/"\1 $*"/' ctags.1 > $(@D)/dirs/ctags-$*/ctags.1
271
+ sed -e 's/\(Current Version:\) [^ ]*/\1 $*/' -e 's/@VERSION@/$*/' -e "s/@DATE@/`date +'%d %b %Y'`/" NEWS > $(@D)/dirs/ctags-$*/NEWS
272
+ (cd $(@D)/dirs/ctags-$* ;\
273
+ chmod 644 * ;\
274
+ chmod 755 mkinstalldirs ;\
275
+ chmod 755 $(REGEX_DIR) ;\
276
+ chmod 644 $(REGEX_DIR)/* ;\
277
+ autoheader ;\
278
+ chmod 644 config.h.in ;\
279
+ autoconf ;\
280
+ chmod 755 configure ;\
281
+ rm -fr autom4te.cache ;\
282
+ cat ctags.1 | $(MAN2HTML) > ctags.html ;\
283
+ )
284
+ cd $(@D)/dirs && tar -zcf ../$(@F) ctags-$*
285
+ chmod 644 $@
286
+
287
+ clean-rpm:
288
+ rm -fr $(RPM_ROOT)
289
+
290
+ ifneq ($(findstring win-,$(MAKECMDGOALS)),)
291
+ ifeq ($(version),,)
292
+ $(error $(MAKECMDGOALS) target requires value for 'version')
293
+ endif
294
+ endif
295
+
296
+ check-version-%:
297
+ @ if [ -z "$(version)" ]; then echo "target requires value for 'version'" >&2; exit 1; fi
298
+
299
+ $(WINDOWS_DIR)/ctags$(win_version): \
300
+ $(RELEASE_DIR)/ctags-$(version).tar.gz maintainer.mak \
301
+ | $(WINDOWS_DIR)
302
+ @ echo "---------- Building Win32 release directory"
303
+ rm -fr "$(WINDOWS_DIR)/ctags$(win_version)"
304
+ mkdir -p "$(WINDOWS_DIR)/ctags$(win_version)"
305
+ for file in $(WIN_FILES) ctags.html; do \
306
+ $(UNIX2DOS) < "$(RELEASE_DIR)/dirs/ctags-$(version)/$${file}" > $@/$${file} ;\
307
+ done
308
+ mkdir $@/$(REGEX_DIR)
309
+ for file in $(REGEX_DIR)/*; do \
310
+ $(UNIX2DOS) < "$${file}" > $@/$(REGEX_DIR)/`basename $${file}` ;\
311
+ done
312
+ chmod 644 $@/*
313
+ chmod 755 $@/$(REGEX_DIR)
314
+ chmod 644 $@/$(REGEX_DIR)/*
315
+
316
+ $(RELEASE_DIR)/ctags%.zip: \
317
+ check-version-% \
318
+ $(WINDOWS_DIR)/ctags% \
319
+ $(WINDOWS_DIR)/ctags%/ctags.exe
320
+ cd $(WINDOWS_DIR) && zip -r ../$@ ctags$*
321
+
322
+ win-source: $(WINDOWS_DIR)/ctags$(win_version)
323
+
324
+ win-zip: $(RELEASE_DIR)/ctags$(win_version).zip
325
+
326
+ release-win-%:
327
+ $(MAKE) version="$*" win-source
328
+
329
+ release-tar-%: $(RELEASE_DIR)/ctags-%.tar.gz
330
+ :
331
+
332
+ release-rpm-%: \
333
+ $(RELEASE_DIR)/ctags-%-1.$(RPM_ARCH).rpm \
334
+ $(RELEASE_DIR)/ctags-%-1.src.rpm
335
+ :
336
+
337
+ release-source-%: $(RELEASE_DIR)/ctags-%.tar.gz
338
+ $(MAKE) version="$*" win-source
339
+
340
+ release-bin-%: release-rpm-%
341
+ $(MAKE) version="$*" win-zip
342
+
343
+ $(WINDOWS_DIR):
344
+ mkdir -p $@
345
+
346
+ #
347
+ # Web site files
348
+ #
349
+ website-%: website-man-% website-index-% website-news-% \
350
+ $(CTAGS_WEBDIR)/EXTENDING.html
351
+ :
352
+
353
+ website-man-%: ctags.1 Makefile
354
+ @ echo "---------- Generating $(CTAGS_WEBDIR)/ctags.html"
355
+ umask 022 ; \
356
+ sed -e 's/"\(Version\) \([^ ]*\)"/"\1 $*"/' ctags.1 |\
357
+ $(MAN2HTML) > $(CTAGS_WEBDIR)/ctags.html
358
+
359
+ website-index-%: index.html Makefile
360
+ @ echo "---------- Generating $(CTAGS_WEBDIR)/index.html"
361
+ umask 022 ; \
362
+ sed -e "s/@VERSION@/$*/g" \
363
+ -e "s/@DOS_VERSION@/`echo $* | sed 's/\.//g'`/g" \
364
+ -e "s/@DATE@/`date +'%d %B %Y'`/" \
365
+ $< > $(CTAGS_WEBDIR)/index.html
366
+
367
+ website-news-%: NEWS maintainer.mak
368
+ @ echo "---------- Generating $(CTAGS_WEBDIR)/news.html"
369
+ umask 022 ; \
370
+ sed -e 's/\(Current Version:\) [^ ]*/\1 $*/' \
371
+ -e 's/@VERSION@/$*/' \
372
+ -e "s/@DATE@/`date +'%d %b %Y'`/" \
373
+ -e 's/</\&lt;/g' -e 's/>/\&gt;/g' \
374
+ -e 's@^Current Version:.*$$@<html><head><title>Exuberant Ctags: Change Notes</title></head><body><h1>Change Notes</h1><pre>@' \
375
+ -e 's@\(^ctags-.* (.*)\)$$@<b>\1</b>@' \
376
+ -e 's@^vim:.*$$@</pre><hr><a href="http:index.html">Back to <strong>Exuberant Ctags</strong></a></body></html>@' \
377
+ $< > $(CTAGS_WEBDIR)/news.html
378
+
379
+ $(CTAGS_WEBDIR)/EXTENDING.html: EXTENDING.html
380
+ @ echo "---------- Generating $(CTAGS_WEBDIR)/EXTENDING.html"
381
+ cp $< $@ && chmod 644 $@
382
+
383
+ #
384
+ # SVN management
385
+ #
386
+ svn_url := https://ctags.svn.sourceforge.net/svnroot/ctags
387
+
388
+ release-svn-%: svn-tagcheck-%
389
+ @ echo "---------- Tagging release $*"
390
+ svn copy -m'Release of ctags-$*' $(svn_url)/trunk $(svn_url)/tags/ctags-$*
391
+
392
+ rerelease-svn-%:
393
+ @ echo "---------- Tagging release $*"
394
+ svn remove -m'Regenerating release of ctags-$*' $(svn_url)/tags/ctags-$*
395
+ svn copy -m'Release of ctags-$*' $(svn_url)/trunk $(svn_url)/tags/ctags-$*
396
+
397
+ svn-tagcheck-%:
398
+ if svn list $(svn_url)/tags/ | grep -q 'ctags-$*/$$' >/dev/null 2>&1 ;then \
399
+ echo "ctags-$* already exists; use rerelease-$*" >&2 ;\
400
+ exit 1 ;\
401
+ fi
402
+
403
+ svn-files:
404
+ @ls -1 $(SVN_FILES)
405
+
406
+ #
407
+ # Dependency file generation
408
+ #
409
+ $(DEPS): %.c maintainer.mak
410
+ @ if [ ! -d $(DEP_DIR) ] ;then mkdir -p $(DEP_DIR) ;fi
411
+ @ $(CC) -M $(DCFLAGS) $< | sed 's/\($*\.o\)\([ :]\)/\1 $*.od $(@F)\2/g' > $@
412
+
413
+
414
+ %.inc: %.c Makefile
415
+ -@ $(CC) -MM $(DCFLAGS) $<
416
+
417
+ #
418
+ # Compilation rules
419
+ #
420
+ %.o %.od: gnu_regex/%.c
421
+ # @ echo "-- Compiling $<"
422
+ $(CC) $(CFLAGS) -D__USE_GNU -Dbool=int -Dfalse=0 -Dtrue=1 -I$(REGEX_DIR) $(OPT) -c $<
423
+
424
+ %.o: %.c
425
+ @ echo "-- Compiling $<"
426
+ @ $(CC) $(COMP_FLAGS) -DEXTERNAL_SORT $(OPT) $(WARNINGS) -Wuninitialized -c $<
427
+
428
+ %.od: %.c
429
+ @ echo "-- Compiling (debug) $<"
430
+ @ $(CC) -g $(DCFLAGS) $(WARNINGS) -o $*.od -c $<
431
+
432
+ %.i: %.c FORCE
433
+ $(CC) $(DCFLAGS) $(WARNINGS) -Wuninitialized -O -E $< > $@
434
+
435
+ %.ic: %.c FORCE
436
+ $(CC) $(DCFLAGS) $(WARNINGS) -Wuninitialized -O -E $< | sed '/^[ ]*$/d' > $@
437
+
438
+ %.s: %.c FORCE
439
+ $(CC) $(DCFLAGS) $(WARNINGS) -S $< > $@
440
+
441
+ readtags.err: DCFLAGS += -DREADTAGS_MAIN
442
+
443
+ %.err: %.c
444
+ @ $(CC) $(DCFLAGS) $(WARNINGS) -Wuninitialized -O -c $<
445
+ @ rm $*.o
446
+
447
+ %.c.gcov: %.da
448
+ @ gcov $*.c
449
+
450
+ %.sproto: %.c
451
+ @ genproto -s -m __ARGS $<
452
+
453
+ %.proto: %.c
454
+ @ genproto -e -m __ARGS $<
455
+
456
+ # Print out the value of a variable
457
+ # From http://www.cmcrossroads.com/ubbthreads/showflat.php?Cat=0&Board=cmbasics&Number=28829
458
+ print-%:
459
+ @echo $* = $($*)
460
+
461
+ # Print out the expanded values of all variables
462
+ # From http://www.cmcrossroads.com/ubbthreads/showflat.php?Cat=0&Number=29581
463
+ .PHONY: print-vars
464
+ print-vars:
465
+ @$(foreach V,$(sort $(.VARIABLES)), \
466
+ $(if $(filter-out environment% default automatic, \
467
+ $(origin $V)),$(warning $V=$($V))))
468
+
469
+ # Print out the declared values of all variables
470
+ .PHONY: print-vars-decl
471
+ print-vars-decl:
472
+ @$(foreach V,$(sort $(.VARIABLES)), \
473
+ $(if $(filter-out environment% default automatic, \
474
+ $(origin $V)),$(warning $V=$(value $V))))
475
+
476
+ # vi:ts=4 sw=4
@@ -0,0 +1,217 @@
1
+ /*
2
+ * $Id: make.c 681 2008-10-12 22:43:00Z dhiebert $
3
+ *
4
+ * Copyright (c) 2000-2005, Darren Hiebert
5
+ *
6
+ * This source code is released for free distribution under the terms of the
7
+ * GNU General Public License.
8
+ *
9
+ * This module contains functions for generating tags for makefiles.
10
+ */
11
+
12
+ /*
13
+ * INCLUDE FILES
14
+ */
15
+ #include "general.h" /* must always come first */
16
+
17
+ #include <string.h>
18
+ #include <ctype.h>
19
+
20
+ #include "options.h"
21
+ #include "parse.h"
22
+ #include "read.h"
23
+ #include "vstring.h"
24
+
25
+ /*
26
+ * DATA DEFINITIONS
27
+ */
28
+ typedef enum {
29
+ K_MACRO
30
+ } shKind;
31
+
32
+ static kindOption MakeKinds [] = {
33
+ { TRUE, 'm', "macro", "macros"}
34
+ };
35
+
36
+ /*
37
+ * FUNCTION DEFINITIONS
38
+ */
39
+
40
+ static int nextChar (void)
41
+ {
42
+ int c = fileGetc ();
43
+ if (c == '\\')
44
+ {
45
+ c = fileGetc ();
46
+ if (c == '\n')
47
+ c = fileGetc ();
48
+ }
49
+ return c;
50
+ }
51
+
52
+ static void skipLine (void)
53
+ {
54
+ int c;
55
+ do
56
+ c = nextChar ();
57
+ while (c != EOF && c != '\n');
58
+ if (c == '\n')
59
+ fileUngetc (c);
60
+ }
61
+
62
+ static int skipToNonWhite (void)
63
+ {
64
+ int c;
65
+ do
66
+ c = nextChar ();
67
+ while (c != '\n' && isspace (c));
68
+ return c;
69
+ }
70
+
71
+ static boolean isIdentifier (int c)
72
+ {
73
+ return (boolean)(c != '\0' && (isalnum (c) || strchr (".-_", c) != NULL));
74
+ }
75
+
76
+ static void readIdentifier (const int first, vString *const id)
77
+ {
78
+ int c = first;
79
+ vStringClear (id);
80
+ while (isIdentifier (c))
81
+ {
82
+ vStringPut (id, c);
83
+ c = nextChar ();
84
+ }
85
+ fileUngetc (c);
86
+ vStringTerminate (id);
87
+ }
88
+
89
+ static void skipToMatch (const char *const pair)
90
+ {
91
+ const int begin = pair [0], end = pair [1];
92
+ const unsigned long inputLineNumber = getInputLineNumber ();
93
+ int matchLevel = 1;
94
+ int c = '\0';
95
+
96
+ while (matchLevel > 0)
97
+ {
98
+ c = nextChar ();
99
+ if (c == begin)
100
+ ++matchLevel;
101
+ else if (c == end)
102
+ --matchLevel;
103
+ else if (c == '\n')
104
+ break;
105
+ }
106
+ if (c == EOF)
107
+ verbose ("%s: failed to find match for '%c' at line %lu\n",
108
+ getInputFileName (), begin, inputLineNumber);
109
+ }
110
+
111
+ static void findMakeTags (void)
112
+ {
113
+ vString *name = vStringNew ();
114
+ boolean newline = TRUE;
115
+ boolean in_define = FALSE;
116
+ boolean in_rule = FALSE;
117
+ boolean variable_possible = TRUE;
118
+ int c;
119
+
120
+ while ((c = nextChar ()) != EOF)
121
+ {
122
+ if (newline)
123
+ {
124
+ if (in_rule)
125
+ {
126
+ if (c == '\t')
127
+ {
128
+ skipLine (); /* skip rule */
129
+ continue;
130
+ }
131
+ else
132
+ in_rule = FALSE;
133
+ }
134
+ variable_possible = (boolean)(!in_rule);
135
+ newline = FALSE;
136
+ }
137
+ if (c == '\n')
138
+ newline = TRUE;
139
+ else if (isspace (c))
140
+ continue;
141
+ else if (c == '#')
142
+ skipLine ();
143
+ else if (c == '(')
144
+ skipToMatch ("()");
145
+ else if (c == '{')
146
+ skipToMatch ("{}");
147
+ else if (c == ':')
148
+ {
149
+ variable_possible = TRUE;
150
+ in_rule = TRUE;
151
+ }
152
+ else if (variable_possible && isIdentifier (c))
153
+ {
154
+ readIdentifier (c, name);
155
+ if (strcmp (vStringValue (name), "endef") == 0)
156
+ in_define = FALSE;
157
+ else if (in_define)
158
+ skipLine ();
159
+ else if (strcmp (vStringValue (name), "define") == 0 &&
160
+ isIdentifier (c))
161
+ {
162
+ in_define = TRUE;
163
+ c = skipToNonWhite ();
164
+ readIdentifier (c, name);
165
+ makeSimpleTag (name, MakeKinds, K_MACRO);
166
+ skipLine ();
167
+ }
168
+ else {
169
+ if (strcmp(vStringValue (name), "export") == 0 &&
170
+ isIdentifier (c))
171
+ {
172
+ c = skipToNonWhite ();
173
+ readIdentifier (c, name);
174
+ }
175
+ c = skipToNonWhite ();
176
+ if (strchr (":?+", c) != NULL)
177
+ {
178
+ boolean append = (boolean)(c == '+');
179
+ if (c == ':')
180
+ in_rule = TRUE;
181
+ c = nextChar ();
182
+ if (c != '=')
183
+ fileUngetc (c);
184
+ else if (append)
185
+ {
186
+ skipLine ();
187
+ continue;
188
+ }
189
+ }
190
+ if (c == '=')
191
+ {
192
+ makeSimpleTag (name, MakeKinds, K_MACRO);
193
+ in_rule = FALSE;
194
+ skipLine ();
195
+ }
196
+ }
197
+ }
198
+ else
199
+ variable_possible = FALSE;
200
+ }
201
+ vStringDelete (name);
202
+ }
203
+
204
+ extern parserDefinition* MakefileParser (void)
205
+ {
206
+ static const char *const patterns [] = { "[Mm]akefile", "GNUmakefile", NULL };
207
+ static const char *const extensions [] = { "mak", "mk", NULL };
208
+ parserDefinition* const def = parserNew ("Make");
209
+ def->kinds = MakeKinds;
210
+ def->kindCount = KIND_COUNT (MakeKinds);
211
+ def->patterns = patterns;
212
+ def->extensions = extensions;
213
+ def->parser = findMakeTags;
214
+ return def;
215
+ }
216
+
217
+ /* vi:set tabstop=4 shiftwidth=4: */