tcc help output for the -xc -xa - options
[tinycc.git] / Makefile
blob20459789f71999d31fd15d0d319409b6aa126442
2 # Tiny C Compiler Makefile
5 TOP ?= .
6 include $(TOP)/config.mak
7 VPATH = $(top_srcdir)
9 CPPFLAGS += -I$(TOP) # for config.h
11 ifneq (-$(findstring gcc,$(CC))-,-gcc-)
12 ifeq (-$(findstring clang,$(CC))-,-clang-)
13 # make clang accept gnuisms in libtcc1.c
14 CFLAGS+=-fheinous-gnu-extensions
15 endif
16 endif
18 CPPFLAGS_P=$(CPPFLAGS) -DCONFIG_TCC_STATIC
19 CFLAGS_P=$(CFLAGS) -pg -static
20 LIBS_P=
21 LDFLAGS_P=$(LDFLAGS)
23 ifdef CONFIG_WIN64
24 CONFIG_WIN32=yes
25 endif
27 ifndef CONFIG_WIN32
28 LIBS=-lm
29 ifndef CONFIG_NOLDL
30 LIBS+=-ldl
31 endif
32 endif
34 # make libtcc as static or dynamic library?
35 ifdef DISABLE_STATIC
36 ifndef CONFIG_WIN32
37 LIBTCC=libtcc.so.1.0
38 else
39 LIBTCC=libtcc.dll
40 LIBTCC_DLL=yes
41 LIBTCC_EXTRA=libtcc.def libtcc.a
42 endif
43 LINK_LIBTCC=-Wl,-rpath,"$(libdir)"
44 ifdef DISABLE_RPATH
45 LINK_LIBTCC=
46 endif
47 else
48 LIBTCC=libtcc.a
49 LINK_LIBTCC=
50 endif
52 CONFIG_$(ARCH) = yes
53 NATIVE_DEFINES_$(CONFIG_i386) += -DTCC_TARGET_I386
54 NATIVE_DEFINES_$(CONFIG_x86-64) += -DTCC_TARGET_X86_64
55 NATIVE_DEFINES_$(CONFIG_WIN32) += -DTCC_TARGET_PE
56 NATIVE_DEFINES_$(CONFIG_uClibc) += -DTCC_UCLIBC
57 NATIVE_DEFINES_$(CONFIG_arm) += -DTCC_TARGET_ARM
58 NATIVE_DEFINES_$(CONFIG_arm_eabihf) += -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT
59 NATIVE_DEFINES_$(CONFIG_arm_eabi) += -DTCC_ARM_EABI
60 NATIVE_DEFINES_$(CONFIG_arm_vfp) += -DTCC_ARM_VFP
61 NATIVE_DEFINES_$(CONFIG_arm64) += -DTCC_TARGET_ARM64
62 NATIVE_DEFINES += $(NATIVE_DEFINES_yes)
64 ifeq ($(TOP),.)
66 PROGS=tcc$(EXESUF)
67 I386_CROSS = i386-linux-gnu-tcc$(EXESUF)
68 WIN32_CROSS = i386-win-mingw32-tcc$(EXESUF)
69 WIN64_CROSS = x86_64-win-mingw32-tcc$(EXESUF)
70 WINCE_CROSS = arm-win-mingw32ce-tcc$(EXESUF)
71 X64_CROSS = x86_64-linux-gnu-tcc$(EXESUF)
72 ARM_FPA_CROSS = arm-linux-fpa-tcc$(EXESUF)
73 ARM_FPA_LD_CROSS = arm-linux-fpa-ld-tcc$(EXESUF)
74 ARM_VFP_CROSS = arm-linux-gnu-tcc$(EXESUF)
75 ARM_EABI_CROSS = arm-linux-gnueabi-tcc$(EXESUF)
76 ARM_EABIHF_CROSS = arm-linux-gnueabihf-tcc$(EXESUF)
77 ARM_CROSS = $(ARM_FPA_CROSS) $(ARM_FPA_LD_CROSS) $(ARM_VFP_CROSS) $(ARM_EABI_CROSS)
78 ARM64_CROSS = arm64-tcc$(EXESUF)
79 C67_CROSS = c67-tcc$(EXESUF)
81 # Legacy symlinks for cross compilers
82 $(I386_CROSS)_LINK = i386-tcc$(EXESUF)
83 $(WIN32_CROSS)_LINK = i386-win-tcc$(EXESUF)
84 $(WIN64_CROSS)_LINK = x86_64-win-tcc$(EXESUF)
85 $(WINCE_CROSS)_LINK = arm-win-tcc$(EXESUF)
86 $(X64_CROSS)_LINK = x86_64-tcc$(EXESUF)
87 $(ARM_FPA_CROSS)_LINK = arm-fpa-tcc$(EXESUF)
88 $(ARM_FPA_LD_CROSS)_LINK = arm-fpa-ld-tcc$(EXESUF)
89 $(ARM_VFP_CROSS)_LINK = arm-vfp-tcc$(EXESUF)
90 $(ARM_EABI_CROSS)_LINK = arm-eabi-tcc$(EXESUF)
92 ifeq ($(TARGETOS),Windows)
93 ifeq ($(ARCH),i386)
94 PROGS:=$($(WIN32_CROSS)_LINK)
95 $($(WIN32_CROSS)_LINK)_TCC = yes
96 endif
97 ifeq ($(ARCH),x86-64)
98 PROGS:=$($(WIN64_CROSS)_LINK)
99 $($(WIN64_CROSS)_LINK)_TCC = yes
100 endif
101 endif
103 ifeq ($(TARGETOS),Linux)
104 ifeq ($(ARCH),i386)
105 PROGS:=$($(I386_CROSS)_LINK)
106 $($(I386_CROSS)_LINK)_TCC = yes
107 endif
108 ifeq ($(ARCH),x86-64)
109 PROGS:=$($(X64_CROSS)_LINK)
110 $($(X64_CROSS)_LINK)_TCC = yes
111 endif
112 endif
114 CORE_FILES = tcc.c libtcc.c tccpp.c tccgen.c tccelf.c tccasm.c tccrun.c
115 CORE_FILES += tcc.h config.h libtcc.h tcctok.h
116 I386_FILES = $(CORE_FILES) i386-gen.c i386-asm.c i386-asm.h i386-tok.h
117 WIN32_FILES = $(CORE_FILES) i386-gen.c i386-asm.c i386-asm.h i386-tok.h tccpe.c
118 WIN64_FILES = $(CORE_FILES) x86_64-gen.c i386-asm.c x86_64-asm.h tccpe.c
119 WINCE_FILES = $(CORE_FILES) arm-gen.c tccpe.c
120 X86_64_FILES = $(CORE_FILES) x86_64-gen.c i386-asm.c x86_64-asm.h
121 ARM_FILES = $(CORE_FILES) arm-gen.c
122 ARM64_FILES = $(CORE_FILES) arm64-gen.c
123 C67_FILES = $(CORE_FILES) c67-gen.c tcccoff.c
125 ifdef CONFIG_WIN64
126 PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF)
127 NATIVE_FILES=$(WIN64_FILES)
128 PROGS_CROSS=$(WIN32_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
129 LIBTCC1_CROSS=lib/i386-win/libtcc1.a
130 LIBTCC1=libtcc1.a
131 else ifdef CONFIG_WIN32
132 PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF)
133 NATIVE_FILES=$(WIN32_FILES)
134 PROGS_CROSS=$(WIN64_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
135 LIBTCC1_CROSS=lib/x86_64-win/libtcc1.a
136 LIBTCC1=libtcc1.a
137 else ifeq ($(ARCH),i386)
138 NATIVE_FILES=$(I386_FILES)
139 PROGS_CROSS=$($(X64_CROSS)_LINK) $($(WIN32_CROSS)_LINK) $($(WIN64_CROSS)_LINK) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
140 LIBTCC1_CROSS=lib/i386-win/libtcc1.a lib/x86_64-win/libtcc1.a lib/i386/libtcc1.a lib/x86_64/libtcc1.a \
141 lib/arm64/libtcc1.a
142 LIBTCC1=libtcc1.a
143 else ifeq ($(ARCH),x86-64)
144 ifeq ($(TARGETOS),Darwin)
145 NATIVE_FILES=$(X86_64_FILES)
146 PROGS_CROSS=$($(I386_CROSS)_LINK) $($(WIN32_CROSS)_LINK) $($(WIN64_CROSS)_LINK) $(ARM_CROSS) $(C67_CROSS) $(WINCE_CROSS)
147 LIBTCC1_CROSS=lib/i386-win/libtcc1.a lib/x86_64-win/libtcc1.a lib/i386/libtcc1.a lib/x86_64/libtcc1.a
148 LIBTCC1=libtcc1.a
149 else
150 NATIVE_FILES=$(X86_64_FILES)
151 PROGS_CROSS=$($(I386_CROSS)_LINK) $($(WIN32_CROSS)_LINK) $($(WIN64_CROSS)_LINK) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
152 LIBTCC1_CROSS=lib/i386-win/libtcc1.a lib/x86_64-win/libtcc1.a lib/i386/libtcc1.a lib/x86_64/libtcc1.a \
153 lib/arm64/libtcc1.a
154 LIBTCC1=libtcc1.a
155 endif
156 else ifeq ($(ARCH),arm)
157 NATIVE_FILES=$(ARM_FILES)
158 PROGS_CROSS=$(I386_CROSS) $(X64_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
159 LIBTCC1=libtcc1.a
160 LIBTCC1_CROSS=lib/i386-win/libtcc1.a lib/x86_64-win/libtcc1.a lib/i386/libtcc1.a
161 else ifeq ($(ARCH),arm64)
162 NATIVE_FILES=$(ARM64_FILES)
163 PROGS_CROSS=$(I386_CROSS) $(X64_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(ARM_CROSS) $(C67_CROSS) $(WINCE_CROSS)
164 LIBTCC1=libtcc1.a
165 LIBTCC1_CROSS=lib/i386-win/libtcc1.a lib/x86_64-win/libtcc1.a lib/i386/libtcc1.a
166 endif
167 PROGS_CROSS_LINK=$(foreach PROG_CROSS,$(PROGS_CROSS),$($(PROG_CROSS)_LINK))
169 ifeq ($(TARGETOS),Darwin)
170 PROGS+=tiny_libmaker$(EXESUF)
171 endif
173 TCCLIBS = $(LIBTCC1) $(LIBTCC) $(LIBTCC_EXTRA)
174 TCCDOCS = tcc.1 tcc-doc.html tcc-doc.info
176 ifdef CONFIG_CROSS
177 PROGS+=$(PROGS_CROSS)
178 TCCLIBS+=$(LIBTCC1_CROSS)
179 endif
181 all: $(PROGS) $(TCCLIBS) $(TCCDOCS)
183 # Host Tiny C Compiler
184 tcc$(EXESUF): tcc.o $(LIBTCC)
185 $(CC) -o $@ $^ $(LIBS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LINK_LIBTCC)
187 # Cross Tiny C Compilers
188 %-tcc$(EXESUF): tcc.c
189 $(CC) -o $@ $< -DONE_SOURCE $(if $($@_TCC),$(NATIVE_DEFINES),$(DEFINES)) $(CPPFLAGS) $(CFLAGS) $(LIBS) $(LDFLAGS)
190 $(if $($@_LINK),ln -sf $@ $($@_LINK))
191 $(if $($@_TCC),ln -sf $@ tcc$(EXESUF))
193 # profiling version
194 tcc_p$(EXESUF): $(NATIVE_FILES)
195 $(CC) -o $@ $< -DONE_SOURCE $(NATIVE_DEFINES) $(CPPFLAGS_P) $(CFLAGS_P) $(LIBS_P) $(LDFLAGS_P)
197 $(I386_CROSS) $($(I386_CROSS)_LINK): DEFINES = -DTCC_TARGET_I386
198 $(X64_CROSS) $($(X64_CROSS)_LINK): DEFINES = -DTCC_TARGET_X86_64
199 $(WIN32_CROSS) $($(WIN32_CROSS)_LINK): DEFINES = -DTCC_TARGET_I386 -DTCC_TARGET_PE \
200 -DCONFIG_TCCDIR="\"$(tccdir)/win32\"" \
201 -DCONFIG_TCC_LIBPATHS="\"{B}/lib/32;{B}/lib\""
202 $(WIN64_CROSS) $($(WIN64_CROSS)_LINK): DEFINES = -DTCC_TARGET_X86_64 -DTCC_TARGET_PE \
203 -DCONFIG_TCCDIR="\"$(tccdir)/win32\"" \
204 -DCONFIG_TCC_LIBPATHS="\"{B}/lib/64;{B}/lib\""
205 $(WINCE_CROSS): DEFINES = -DTCC_TARGET_PE
206 $(C67_CROSS): DEFINES = -DTCC_TARGET_C67
207 $(ARM_FPA_CROSS): DEFINES = -DTCC_TARGET_ARM
208 $(ARM_FPA_LD_CROSS)$(EXESUF): DEFINES = -DTCC_TARGET_ARM -DLDOUBLE_SIZE=12
209 $(ARM_VFP_CROSS): DEFINES = -DTCC_TARGET_ARM -DTCC_ARM_VFP
210 $(ARM_EABI_CROSS): DEFINES = -DTCC_TARGET_ARM -DTCC_ARM_EABI -DTCC_ARM_VFP
211 $(ARM64_CROSS): DEFINES = -DTCC_TARGET_ARM64
213 $(I386_CROSS) $($(I386_CROSS)_LINK): $(I386_FILES)
214 $(X64_CROSS) $($(X64_CROSS)_LINK): $(X86_64_FILES)
215 $(WIN32_CROSS) $($(WIN32_CROSS)_LINK): $(WIN32_FILES)
216 $(WIN64_CROSS) $($(WIN64_CROSS)_LINK): $(WIN64_FILES)
217 $(WINCE_CROSS) $($(WINCE_CROSS)_LINK): $(WINCE_FILES)
218 $(C67_CROSS) $($(C67_CROSS)_LINK): $(C67_FILES)
219 $(ARM_FPA_CROSS) $(ARM_FPA_LD_CROSS) $(ARM_VFP_CROSS) $(ARM_EABI_CROSS): $(ARM_FILES)
220 $($(ARM_FPA_CROSS)_LINK) $($(ARM_FPA_LD_CROSS)_LINK) $($(ARM_VFP_CROSS)_LINK) $($(ARM_EABI_CROSS)_LINK): $(ARM_FILES)
221 $(ARM64_CROSS): $(ARM64_FILES)
223 # libtcc generation and test
224 ifndef ONE_SOURCE
225 LIBTCC_OBJ = $(filter-out tcc.o,$(patsubst %.c,%.o,$(filter %.c,$(NATIVE_FILES))))
226 LIBTCC_INC = $(filter %.h,$(CORE_FILES)) $(filter-out $(CORE_FILES),$(NATIVE_FILES))
227 else
228 LIBTCC_OBJ = libtcc.o
229 LIBTCC_INC = $(NATIVE_FILES)
230 libtcc.o : NATIVE_DEFINES += -DONE_SOURCE
231 endif
233 $(LIBTCC_OBJ) tcc.o : %.o : %.c $(LIBTCC_INC)
234 $(CC) -o $@ -c $< $(NATIVE_DEFINES) $(CPPFLAGS) $(CFLAGS)
236 ifndef LIBTCC_DLL
237 libtcc.a: $(LIBTCC_OBJ)
238 $(AR) rcs $@ $^
239 endif
241 libtcc.so.1.0: $(LIBTCC_OBJ)
242 $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
244 libtcc.so.1.0: CFLAGS+=-fPIC
246 ifdef LIBTCC_DLL
247 libtcc.dll libtcc.def libtcc.a: $(LIBTCC_OBJ)
248 $(CC) -shared $^ -o $@ $(LDFLAGS) -Wl,--output-def,libtcc.def,--out-implib,libtcc.a
249 endif
251 # windows utilities
252 tiny_impdef$(EXESUF): win32/tools/tiny_impdef.c
253 $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
254 tiny_libmaker$(EXESUF): win32/tools/tiny_libmaker.c
255 $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
257 # TinyCC runtime libraries
258 libtcc1.a : FORCE
259 $(MAKE) -C lib native
260 if test ! -d $(ARCH); then mkdir $(ARCH); fi
261 if test ! -L $(ARCH)/$@; then ln -sf ../$@ $(ARCH)/$@; fi
262 lib/%/libtcc1.a : FORCE $(PROGS_CROSS)
263 $(MAKE) -C lib cross TARGET=$*
265 FORCE:
267 # install
268 TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h
269 INSTALL=install
270 ifdef STRIP_BINARIES
271 INSTALLBIN=$(INSTALL) -s
272 else
273 INSTALLBIN=$(INSTALL)
274 endif
276 install-strip: install
277 strip $(foreach PROG,$(PROGS),"$(bindir)"/$(PROG))
279 ifndef CONFIG_WIN32
280 install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
281 mkdir -p "$(bindir)"
282 $(INSTALLBIN) -m755 $(PROGS) "$(bindir)"
283 cp -P tcc$(EXESUF) "$(bindir)"
284 mkdir -p "$(mandir)/man1"
285 -$(INSTALL) -m644 tcc.1 "$(mandir)/man1"
286 mkdir -p "$(infodir)"
287 -$(INSTALL) -m644 tcc-doc.info "$(infodir)"
288 mkdir -p "$(tccdir)"
289 mkdir -p "$(tccdir)/include"
290 ifneq ($(LIBTCC1),)
291 mkdir -p "$(tccdir)/$(ARCH)"
292 $(INSTALL) -m644 $(LIBTCC1) "$(tccdir)/$(ARCH)"
293 endif
294 $(INSTALL) -m644 $(addprefix $(top_srcdir)/include/,$(TCC_INCLUDES)) $(top_srcdir)/tcclib.h "$(tccdir)/include"
295 mkdir -p "$(libdir)"
296 $(INSTALL) -m644 $(LIBTCC) "$(libdir)"
297 ifdef DISABLE_STATIC
298 ln -sf "$(ln_libdir)/libtcc.so.1.0" "$(libdir)/libtcc.so.1"
299 ln -sf "$(ln_libdir)/libtcc.so.1.0" "$(libdir)/libtcc.so"
300 endif
301 mkdir -p "$(includedir)"
302 $(INSTALL) -m644 $(top_srcdir)/libtcc.h "$(includedir)"
303 mkdir -p "$(docdir)"
304 -$(INSTALL) -m644 tcc-doc.html "$(docdir)"
305 ifdef CONFIG_CROSS
306 mkdir -p "$(tccdir)/win32/lib/32"
307 mkdir -p "$(tccdir)/win32/lib/64"
308 mkdir -p "$(tccdir)/i386"
309 mkdir -p "$(tccdir)/x86-64"
310 ifneq ($(HOST_OS),Darwin)
311 mkdir -p "$(tccdir)/arm64"
312 $(INSTALL) -m644 lib/arm64/libtcc1.a "$(tccdir)/arm64"
313 endif
314 $(INSTALL) -m644 lib/i386/libtcc1.a "$(tccdir)/i386"
315 $(INSTALL) -m644 lib/x86_64/libtcc1.a "$(tccdir)/x86-64"
316 $(INSTALL) -m644 $(top_srcdir)/win32/lib/*.def "$(tccdir)/win32/lib"
317 $(INSTALL) -m644 lib/i386-win/libtcc1.a "$(tccdir)/win32/lib/32"
318 $(INSTALL) -m644 lib/x86_64-win/libtcc1.a "$(tccdir)/win32/lib/64"
319 cp -r $(top_srcdir)/win32/include/. "$(tccdir)/win32/include"
320 cp -r "$(tccdir)/include" "$(tccdir)/win32"
321 endif
323 uninstall:
324 rm -fv $(foreach P,$(PROGS),"$(bindir)/$P")
325 rm -fv "$(bindir)/tcc$(EXESUF)"
326 rm -fv $(foreach P,$(LIBTCC1),"$(tccdir)/$P")
327 rm -fv $(foreach P,$(TCC_INCLUDES),"$(tccdir)/include/$P")
328 rm -fv "$(mandir)/man1/tcc.1" "$(infodir)/tcc-doc.info"
329 rm -fv "$(libdir)/$(LIBTCC)" "$(includedir)/libtcc.h"
330 rm -fv "$(libdir)/libtcc.so*"
331 rm -rv "$(tccdir)"
332 rm -rv "$(docdir)"
333 else
334 # on windows
335 install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
336 mkdir -p "$(tccdir)"
337 mkdir -p "$(tccdir)/lib"
338 mkdir -p "$(tccdir)/include"
339 mkdir -p "$(tccdir)/examples"
340 mkdir -p "$(tccdir)/doc"
341 mkdir -p "$(tccdir)/libtcc"
342 $(INSTALLBIN) -m755 $(PROGS) "$(tccdir)"
343 $(INSTALLBIN) -m755 tcc.exe "$(tccdir)"
344 $(INSTALL) -m644 $(LIBTCC1) $(top_srcdir)/win32/lib/*.def "$(tccdir)/lib"
345 cp -r $(top_srcdir)/win32/include/. "$(tccdir)/include"
346 cp -r $(top_srcdir)/win32/examples/. "$(tccdir)/examples"
347 $(INSTALL) -m644 $(addprefix $(top_srcdir)/include/,$(TCC_INCLUDES)) $(top_srcdir)/tcclib.h "$(tccdir)/include"
348 $(INSTALL) -m644 tcc-doc.html $(top_srcdir)/win32/tcc-win32.txt "$(tccdir)/doc"
349 $(INSTALL) -m644 $(top_srcdir)/libtcc.h $(LIBTCC_EXTRA) "$(tccdir)/libtcc"
350 $(INSTALL) -m644 $(LIBTCC) "$(tccdir)"
351 ifdef CONFIG_CROSS
352 mkdir -p "$(tccdir)/lib/32"
353 mkdir -p "$(tccdir)/lib/64"
354 -$(INSTALL) -m644 lib/i386-win/libtcc1.a "$(tccdir)/lib/32"
355 -$(INSTALL) -m644 lib/x86_64-win/libtcc1.a "$(tccdir)/lib/64"
356 endif
358 uninstall:
359 rm -rfv "$(tccdir)/*"
360 endif
362 # documentation and man page
363 tcc-doc.html: tcc-doc.texi
364 -makeinfo --no-split --html --number-sections -o $@ $<
366 tcc.1: tcc-doc.texi
367 -$(top_srcdir)/texi2pod.pl $< tcc.pod
368 -pod2man --section=1 --center="Tiny C Compiler" --release=`cat $(top_srcdir)/VERSION` tcc.pod > $@
370 tcc-doc.info: tcc-doc.texi
371 -makeinfo $<
373 # in tests subdir
374 export LIBTCC1
376 %est:
377 $(MAKE) -C tests $@ 'PROGS_CROSS=$(PROGS_CROSS)'
379 clean:
380 rm -vf $(PROGS) tcc_p$(EXESUF) tcc.pod *~ *.o *.a *.so* *.out *.log \
381 *.exe a.out tags TAGS libtcc_test$(EXESUF) tcc$(EXESUF)
382 -rm -r $(ARCH) arm64
383 ifeq ($(HOST_OS),Linux)
384 -rm -r ./C:
385 endif
386 -rm *-tcc$(EXESUF)
387 $(MAKE) -C tests $@
388 ifneq ($(LIBTCC1),)
389 $(MAKE) -C lib $@
390 endif
392 distclean: clean
393 rm -vf config.h config.mak config.texi tcc.1 tcc-doc.info tcc-doc.html
395 config.mak:
396 @echo "Please run ./configure."
397 @exit 1
399 tags:
400 ctags $(top_srcdir)/*.[ch] $(top_srcdir)/include/*.h $(top_srcdir)/lib/*.[chS]
402 TAGS:
403 ctags -e $(top_srcdir)/*.[ch] $(top_srcdir)/include/*.h $(top_srcdir)/lib/*.[chS]
405 # create release tarball from *current* git branch (including tcc-doc.html
406 # and converting two files to CRLF)
407 TCC-VERSION := tcc-$(shell cat $(top_srcdir)/VERSION)
408 tar: tcc-doc.html
409 mkdir $(TCC-VERSION)
410 ( cd $(TCC-VERSION) && git --git-dir ../.git checkout -f )
411 cp tcc-doc.html $(TCC-VERSION)
412 for f in tcc-win32.txt build-tcc.bat ; do \
413 cat win32/$$f | sed 's,\(.*\),\1\r,g' > $(TCC-VERSION)/win32/$$f ; \
414 done
415 tar cjf $(TCC-VERSION).tar.bz2 $(TCC-VERSION)
416 rm -rf $(TCC-VERSION)
417 git reset
419 .PHONY: all clean tar tags TAGS distclean install uninstall FORCE
421 endif # ifeq ($(TOP),.)