Adding two more people to the RELICENSING file.
[tinycc.git] / Makefile
Commit [+]AuthorDateLineData
89ad24e7 gus knight2015-07-29 16:53:57 -04001#
2# Tiny C Compiler Makefile
3#
271abe71 gus knight2015-07-29 09:05:56 -04004
89ad24e7 gus knight2015-07-29 16:53:57 -04005TOP ?= .
6include $(TOP)/config.mak
7VPATH = $(top_srcdir)
8
9CPPFLAGS += -I$(TOP) # for config.h
10
11ifneq (-$(findstring gcc,$(CC))-,-gcc-)
12ifeq (-$(findstring clang,$(CC))-,-clang-)
13# make clang accept gnuisms in libtcc1.c
14CFLAGS+=-fheinous-gnu-extensions
15endif
16endif
17
18CPPFLAGS_P=$(CPPFLAGS) -DCONFIG_TCC_STATIC
19CFLAGS_P=$(CFLAGS) -pg -static
20LIBS_P=
21LDFLAGS_P=$(LDFLAGS)
22
23ifdef CONFIG_WIN64
24CONFIG_WIN32=yes
25endif
26
27ifndef CONFIG_WIN32
28LIBS=-lm
29ifndef CONFIG_NOLDL
30LIBS+=-ldl
31endif
32endif
33
34# make libtcc as static or dynamic library?
35ifdef DISABLE_STATIC
36ifndef CONFIG_WIN32
37LIBTCC=libtcc.so.1.0
38else
39LIBTCC=libtcc.dll
40LIBTCC_DLL=yes
41LIBTCC_EXTRA=libtcc.def libtcc.a
42endif
43LINK_LIBTCC=-Wl,-rpath,"$(libdir)"
44ifdef DISABLE_RPATH
45LINK_LIBTCC=
46endif
47else
48LIBTCC=libtcc.a
49LINK_LIBTCC=
50endif
51
52CONFIG_$(ARCH) = yes
53NATIVE_DEFINES_$(CONFIG_i386) += -DTCC_TARGET_I386
54NATIVE_DEFINES_$(CONFIG_x86-64) += -DTCC_TARGET_X86_64
55NATIVE_DEFINES_$(CONFIG_WIN32) += -DTCC_TARGET_PE
56NATIVE_DEFINES_$(CONFIG_uClibc) += -DTCC_UCLIBC
57NATIVE_DEFINES_$(CONFIG_arm) += -DTCC_TARGET_ARM
58NATIVE_DEFINES_$(CONFIG_arm_eabihf) += -DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT
59NATIVE_DEFINES_$(CONFIG_arm_eabi) += -DTCC_ARM_EABI
60NATIVE_DEFINES_$(CONFIG_arm_vfp) += -DTCC_ARM_VFP
61NATIVE_DEFINES_$(CONFIG_arm64) += -DTCC_TARGET_ARM64
62NATIVE_DEFINES += $(NATIVE_DEFINES_yes)
63
64ifeq ($(TOP),.)
65
66PROGS=tcc$(EXESUF)
67I386_CROSS = i386-linux-gnu-tcc$(EXESUF)
68WIN32_CROSS = i386-win-mingw32-tcc$(EXESUF)
69WIN64_CROSS = x86_64-win-mingw32-tcc$(EXESUF)
70WINCE_CROSS = arm-win-mingw32ce-tcc$(EXESUF)
71X64_CROSS = x86_64-linux-gnu-tcc$(EXESUF)
72ARM_FPA_CROSS = arm-linux-fpa-tcc$(EXESUF)
73ARM_FPA_LD_CROSS = arm-linux-fpa-ld-tcc$(EXESUF)
74ARM_VFP_CROSS = arm-linux-gnu-tcc$(EXESUF)
75ARM_EABI_CROSS = arm-linux-gnueabi-tcc$(EXESUF)
76ARM_EABIHF_CROSS = arm-linux-gnueabihf-tcc$(EXESUF)
77ARM_CROSS = $(ARM_FPA_CROSS) $(ARM_FPA_LD_CROSS) $(ARM_VFP_CROSS) $(ARM_EABI_CROSS)
78ARM64_CROSS = arm64-tcc$(EXESUF)
79C67_CROSS = c67-tcc$(EXESUF)
80
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)
91
92ifeq ($(TARGETOS),Windows)
93ifeq ($(ARCH),i386)
94PROGS:=$($(WIN32_CROSS)_LINK)
95$($(WIN32_CROSS)_LINK)_TCC = yes
96endif
97ifeq ($(ARCH),x86-64)
98PROGS:=$($(WIN64_CROSS)_LINK)
99$($(WIN64_CROSS)_LINK)_TCC = yes
100endif
101endif
102
103ifeq ($(TARGETOS),Linux)
104ifeq ($(ARCH),i386)
105PROGS:=$($(I386_CROSS)_LINK)
106$($(I386_CROSS)_LINK)_TCC = yes
107endif
108ifeq ($(ARCH),x86-64)
109PROGS:=$($(X64_CROSS)_LINK)
110$($(X64_CROSS)_LINK)_TCC = yes
111endif
112endif
113
114CORE_FILES = tcc.c libtcc.c tccpp.c tccgen.c tccelf.c tccasm.c tccrun.c
115CORE_FILES += tcc.h config.h libtcc.h tcctok.h
116I386_FILES = $(CORE_FILES) i386-gen.c i386-asm.c i386-asm.h i386-tok.h
117WIN32_FILES = $(CORE_FILES) i386-gen.c i386-asm.c i386-asm.h i386-tok.h tccpe.c
118WIN64_FILES = $(CORE_FILES) x86_64-gen.c i386-asm.c x86_64-asm.h tccpe.c
119WINCE_FILES = $(CORE_FILES) arm-gen.c tccpe.c
120X86_64_FILES = $(CORE_FILES) x86_64-gen.c i386-asm.c x86_64-asm.h
121ARM_FILES = $(CORE_FILES) arm-gen.c
122ARM64_FILES = $(CORE_FILES) arm64-gen.c
123C67_FILES = $(CORE_FILES) c67-gen.c tcccoff.c
124
125ifdef CONFIG_WIN64
126PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF)
127NATIVE_FILES=$(WIN64_FILES)
128PROGS_CROSS=$(WIN32_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
129LIBTCC1_CROSS=lib/i386-win/libtcc1.a
130LIBTCC1=libtcc1.a
131else ifdef CONFIG_WIN32
132PROGS+=tiny_impdef$(EXESUF) tiny_libmaker$(EXESUF)
133NATIVE_FILES=$(WIN32_FILES)
134PROGS_CROSS=$(WIN64_CROSS) $(I386_CROSS) $(X64_CROSS) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
135LIBTCC1_CROSS=lib/x86_64-win/libtcc1.a
136LIBTCC1=libtcc1.a
137else ifeq ($(ARCH),i386)
138NATIVE_FILES=$(I386_FILES)
139PROGS_CROSS=$($(X64_CROSS)_LINK) $($(WIN32_CROSS)_LINK) $($(WIN64_CROSS)_LINK) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
140LIBTCC1_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
142LIBTCC1=libtcc1.a
143else ifeq ($(ARCH),x86-64)
144ifeq ($(TARGETOS),Darwin)
145NATIVE_FILES=$(X86_64_FILES)
146PROGS_CROSS=$($(I386_CROSS)_LINK) $($(WIN32_CROSS)_LINK) $($(WIN64_CROSS)_LINK) $(ARM_CROSS) $(C67_CROSS) $(WINCE_CROSS)
147LIBTCC1_CROSS=lib/i386-win/libtcc1.a lib/x86_64-win/libtcc1.a lib/i386/libtcc1.a lib/x86_64/libtcc1.a
148LIBTCC1=libtcc1.a
149else
150NATIVE_FILES=$(X86_64_FILES)
151PROGS_CROSS=$($(I386_CROSS)_LINK) $($(WIN32_CROSS)_LINK) $($(WIN64_CROSS)_LINK) $(ARM_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
152LIBTCC1_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
154LIBTCC1=libtcc1.a
155endif
156else ifeq ($(ARCH),arm)
157NATIVE_FILES=$(ARM_FILES)
158PROGS_CROSS=$(I386_CROSS) $(X64_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(ARM64_CROSS) $(C67_CROSS) $(WINCE_CROSS)
159LIBTCC1=libtcc1.a
160LIBTCC1_CROSS=lib/i386-win/libtcc1.a lib/x86_64-win/libtcc1.a lib/i386/libtcc1.a
161else ifeq ($(ARCH),arm64)
162NATIVE_FILES=$(ARM64_FILES)
163PROGS_CROSS=$(I386_CROSS) $(X64_CROSS) $(WIN32_CROSS) $(WIN64_CROSS) $(ARM_CROSS) $(C67_CROSS) $(WINCE_CROSS)
164LIBTCC1=libtcc1.a
165LIBTCC1_CROSS=lib/i386-win/libtcc1.a lib/x86_64-win/libtcc1.a lib/i386/libtcc1.a
166endif
167PROGS_CROSS_LINK=$(foreach PROG_CROSS,$(PROGS_CROSS),$($(PROG_CROSS)_LINK))
168
169ifeq ($(TARGETOS),Darwin)
170PROGS+=tiny_libmaker$(EXESUF)
171endif
172
173TCCLIBS = $(LIBTCC1) $(LIBTCC) $(LIBTCC_EXTRA)
174TCCDOCS = tcc.1 tcc-doc.html tcc-doc.info
175
176ifdef CONFIG_CROSS
177PROGS+=$(PROGS_CROSS)
178TCCLIBS+=$(LIBTCC1_CROSS)
179endif
180
181all: $(PROGS) $(TCCLIBS) $(TCCDOCS)
182
183# Host Tiny C Compiler
184tcc$(EXESUF): tcc.o $(LIBTCC)
185 $(CC) -o $@ $^ $(LIBS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LINK_LIBTCC)
186
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))
192
193# profiling version
194tcc_p$(EXESUF): $(NATIVE_FILES)
195 $(CC) -o $@ $< -DONE_SOURCE $(NATIVE_DEFINES) $(CPPFLAGS_P) $(CFLAGS_P) $(LIBS_P) $(LDFLAGS_P)
196
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
212
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)
222
223# libtcc generation and test
224ifndef ONE_SOURCE
225LIBTCC_OBJ = $(filter-out tcc.o,$(patsubst %.c,%.o,$(filter %.c,$(NATIVE_FILES))))
226LIBTCC_INC = $(filter %.h,$(CORE_FILES)) $(filter-out $(CORE_FILES),$(NATIVE_FILES))
227else
228LIBTCC_OBJ = libtcc.o
229LIBTCC_INC = $(NATIVE_FILES)
230libtcc.o : NATIVE_DEFINES += -DONE_SOURCE
231endif
232
233$(LIBTCC_OBJ) tcc.o : %.o : %.c $(LIBTCC_INC)
234 $(CC) -o $@ -c $< $(NATIVE_DEFINES) $(CPPFLAGS) $(CFLAGS)
235
236ifndef LIBTCC_DLL
237libtcc.a: $(LIBTCC_OBJ)
238 $(AR) rcs $@ $^
239endif
240
241libtcc.so.1.0: $(LIBTCC_OBJ)
242 $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
243
244libtcc.so.1.0: CFLAGS+=-fPIC
245
246ifdef LIBTCC_DLL
247libtcc.dll libtcc.def libtcc.a: $(LIBTCC_OBJ)
248 $(CC) -shared $^ -o $@ $(LDFLAGS) -Wl,--output-def,libtcc.def,--out-implib,libtcc.a
249endif
250
251# windows utilities
252tiny_impdef$(EXESUF): win32/tools/tiny_impdef.c
253 $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
254tiny_libmaker$(EXESUF): win32/tools/tiny_libmaker.c
255 $(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
256
257# TinyCC runtime libraries
258libtcc1.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
262lib/%/libtcc1.a : FORCE $(PROGS_CROSS)
263 $(MAKE) -C lib cross TARGET=$*
264
265FORCE:
266
267# install
268TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h
269INSTALL=install
270ifdef STRIP_BINARIES
271INSTALLBIN=$(INSTALL) -s
272else
273INSTALLBIN=$(INSTALL)
274endif
275
276install-strip: install
277 strip $(foreach PROG,$(PROGS),"$(bindir)"/$(PROG))
278
279ifndef CONFIG_WIN32
280install: $(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"
290ifneq ($(LIBTCC1),)
291 mkdir -p "$(tccdir)/$(ARCH)"
292 $(INSTALL) -m644 $(LIBTCC1) "$(tccdir)/$(ARCH)"
293endif
294 $(INSTALL) -m644 $(addprefix $(top_srcdir)/include/,$(TCC_INCLUDES)) $(top_srcdir)/tcclib.h "$(tccdir)/include"
295 mkdir -p "$(libdir)"
296 $(INSTALL) -m644 $(LIBTCC) "$(libdir)"
297ifdef 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"
300endif
301 mkdir -p "$(includedir)"
302 $(INSTALL) -m644 $(top_srcdir)/libtcc.h "$(includedir)"
303 mkdir -p "$(docdir)"
304 -$(INSTALL) -m644 tcc-doc.html "$(docdir)"
305ifdef 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"
310ifneq ($(HOST_OS),Darwin)
311 mkdir -p "$(tccdir)/arm64"
312 $(INSTALL) -m644 lib/arm64/libtcc1.a "$(tccdir)/arm64"
313endif
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"
321endif
322
323uninstall:
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)"
333else
334# on windows
335install: $(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)"
351ifdef 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"
356endif
357
358uninstall:
359 rm -rfv "$(tccdir)/*"
360endif
361
362# documentation and man page
363tcc-doc.html: tcc-doc.texi
364 -makeinfo --no-split --html --number-sections -o $@ $<
365
366tcc.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 > $@
369
370tcc-doc.info: tcc-doc.texi
371 -makeinfo $<
372
373# in tests subdir
374export LIBTCC1
375
376%est:
377 $(MAKE) -C tests $@ 'PROGS_CROSS=$(PROGS_CROSS)'
271abe71 gus knight2015-07-29 09:05:56 -0400378
379clean:
89ad24e7 gus knight2015-07-29 16:53:57 -0400380 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
383ifeq ($(HOST_OS),Linux)
384 -rm -r ./C:
385endif
386 -rm *-tcc$(EXESUF)
387 $(MAKE) -C tests $@
388ifneq ($(LIBTCC1),)
389 $(MAKE) -C lib $@
390endif
391
392distclean: clean
393 rm -vf config.h config.mak config.texi tcc.1 tcc-doc.info tcc-doc.html
394
395config.mak:
396 @echo "Please run ./configure."
397 @exit 1
398
399tags:
400 ctags $(top_srcdir)/*.[ch] $(top_srcdir)/include/*.h $(top_srcdir)/lib/*.[chS]
401
402TAGS:
403 ctags -e $(top_srcdir)/*.[ch] $(top_srcdir)/include/*.h $(top_srcdir)/lib/*.[chS]
404
405# create release tarball from *current* git branch (including tcc-doc.html
406# and converting two files to CRLF)
407TCC-VERSION := tcc-$(shell cat $(top_srcdir)/VERSION)
408tar: 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
418
419.PHONY: all clean tar tags TAGS distclean install uninstall FORCE
420
421endif # ifeq ($(TOP),.)