History

Default to create progs with symbols (incl. debug)

* Set CFLAGS entirely in configure if not already set. * Compile bcheck.c with the same flags as the other source files * Don't strip binaries by default (GB are cheap now) but provide a --strip-binaries option in configure script.

Thomas Preud'homme committed 15 years ago

Commit 3511e6e1 parent 330d2ee2 files · +15 −5Browse files

Unified · Split

2 files
  1. Makefile +8 −4
  2. configure +7 −1
Makefile+8−4
@@ -5,7 +5,6 @@ · 4 unmodified lines
5TOP ?= .5TOP ?= .
6include $(TOP)/config.mak6include $(TOP)/config.mak
7 7
8CFLAGS+=-g -Wall
9CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC8CFLAGS_P=$(CFLAGS) -pg -static -DCONFIG_TCC_STATIC
10LIBS_P=9LIBS_P=
11 10
@@ -217,12 +216,17 @@ libtcc1.a : FORCE · 205 unmodified lines
217lib/%/libtcc1.a : FORCE $(PROGS_CROSS)216lib/%/libtcc1.a : FORCE $(PROGS_CROSS)
218 @$(MAKE) -C lib cross TARGET=$*217 @$(MAKE) -C lib cross TARGET=$*
219bcheck.o : lib/bcheck.c218bcheck.o : lib/bcheck.c
220 gcc -c $< -o $@ -O2 -Wall219 gcc -c $< -o $@ $(CFLAGS)
221FORCE:220FORCE:
222 221
223# install222# install
224TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h tcclib.h223TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h tcclib.h
225INSTALL=install224INSTALL=install
225ifdef STRIP_BINARIES
226INSTALLBIN=$(INSTALL) -s
227else
228INSTALLBIN=$(INSTALL)
229endif
226 230
227ifndef CONFIG_WIN32231ifndef CONFIG_WIN32
228install: $(PROGS) $(TCCLIBS) $(TCCDOCS)232install: $(PROGS) $(TCCLIBS) $(TCCDOCS)
@@ -230,7 +234,7 @@ install: $(PROGS) $(TCCLIBS) $(TCCDOCS) · 1 unmodified line
230ifeq ($(CC),tcc)234ifeq ($(CC),tcc)
231 $(INSTALL) -m755 $(PROGS) "$(bindir)"235 $(INSTALL) -m755 $(PROGS) "$(bindir)"
232else236else
233 $(INSTALL) -s -m755 $(PROGS) "$(bindir)"237 $(INSTALLBIN) -m755 $(PROGS) "$(bindir)"
234endif238endif
235 mkdir -p "$(mandir)/man1"239 mkdir -p "$(mandir)/man1"
236 -$(INSTALL) tcc.1 "$(mandir)/man1"240 -$(INSTALL) tcc.1 "$(mandir)/man1"
@@ -291,7 +295,7 @@ install: $(PROGS) $(TCCLIBS) $(TCCDOCS) · 54 unmodified lines
291 mkdir -p "$(tccdir)/examples"295 mkdir -p "$(tccdir)/examples"
292 mkdir -p "$(tccdir)/doc"296 mkdir -p "$(tccdir)/doc"
293 mkdir -p "$(tccdir)/libtcc"297 mkdir -p "$(tccdir)/libtcc"
294 $(INSTALL) -s -m755 $(PROGS) "$(tccdir)"298 $(INSTALLBIN) -m755 $(PROGS) "$(tccdir)"
295 $(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib"299 $(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib"
296 cp -r win32/include/. "$(tccdir)/include"300 cp -r win32/include/. "$(tccdir)/include"
297 cp -r win32/examples/. "$(tccdir)/examples"301 cp -r win32/examples/. "$(tccdir)/examples"
configure+7−1
@@ -146,6 +146,8 @@ for opt do · 145 unmodified lines
146 ;;146 ;;
147 --disable-rpath) disable_rpath="yes"147 --disable-rpath) disable_rpath="yes"
148 ;;148 ;;
149 --strip-binaries) strip_binaries="yes"
150 ;;
149 --with-libgcc) use_libgcc="yes"151 --with-libgcc) use_libgcc="yes"
150 ;;152 ;;
151 --with-selinux) have_selinux="yes"153 --with-selinux) have_selinux="yes"
@@ -157,7 +159,7 @@ done · 5 unmodified lines
157 159
158# Checking for CFLAGS160# Checking for CFLAGS
159if test -z "$CFLAGS"; then161if test -z "$CFLAGS"; then
160 CFLAGS="-O2"162 CFLAGS="-Wall -g -O2"
161fi163fi
162 164
163cc="${cross_prefix}${cc}"165cc="${cross_prefix}${cc}"
@@ -253,6 +255,7 @@ echo " --sysroot=PREFIX prepend PREFIX to library/include paths []" · 89 unmodified lines
253echo " --cc=CC use C compiler CC [$cc]"255echo " --cc=CC use C compiler CC [$cc]"
254echo " --disable-static make libtcc.so instead of libtcc.a"256echo " --disable-static make libtcc.so instead of libtcc.a"
255echo " --disable-rpath disable use of -rpath with the above"257echo " --disable-rpath disable use of -rpath with the above"
258echo " --strip-binaries strip symbol tables from resulting binaries"
256echo " --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a"259echo " --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a"
257echo " --enable-mingw32 build windows version on linux with mingw32"260echo " --enable-mingw32 build windows version on linux with mingw32"
258echo " --enable-cygwin build windows version on windows with cygwin"261echo " --enable-cygwin build windows version on windows with cygwin"
@@ -419,6 +422,9 @@ fi · 160 unmodified lines
419if test "$disable_rpath" = "yes" ; then422if test "$disable_rpath" = "yes" ; then
420 echo "DISABLE_RPATH=yes" >> config.mak423 echo "DISABLE_RPATH=yes" >> config.mak
421fi424fi
425if test "$strip_binaries" = "yes" ; then
426 echo "STRIP_BINARIES=yes" >> config.mak
427fi
422if test "$use_libgcc" = "yes" ; then428if test "$use_libgcc" = "yes" ; then
423 echo "#define CONFIG_USE_LIBGCC" >> $TMPH429 echo "#define CONFIG_USE_LIBGCC" >> $TMPH
424 echo "CONFIG_USE_LIBGCC=yes" >> config.mak430 echo "CONFIG_USE_LIBGCC=yes" >> config.mak

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t