summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-01-11 22:11:29 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-01-11 22:11:29 +0000
commit88fa5f3611fd07c2b39246659a31c3d95e89ba5c (patch)
tree1a4d3f3e61f982827abad2340fb5450bdc7d6556
parentc54be3804064662fcbd582c8c7e5a3425681b5ac (diff)
utils/Makefile.in: de-obfuscate it a bit
Rules.mak: use -Os, not -O2
-rw-r--r--Rules.mak2
-rw-r--r--utils/Makefile.in51
2 files changed, 34 insertions, 19 deletions
diff --git a/Rules.mak b/Rules.mak
index dd62469ab..481b35e24 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -51,7 +51,7 @@ STRIP_FLAGS ?= -x -R .note -R .comment
# Select the compiler needed to build binaries for your development system
HOSTCC = gcc
-BUILD_CFLAGS = -O2 -Wall
+BUILD_CFLAGS = -Os -Wall
export ARCH := $(shell uname -m | $(SED) -e s/i.86/i386/ \
-e s/sun.*/sparc/ -e s/sparc.*/sparc/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
diff --git a/utils/Makefile.in b/utils/Makefile.in
index a51f023f4..76e7ab451 100644
--- a/utils/Makefile.in
+++ b/utils/Makefile.in
@@ -3,43 +3,57 @@
# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#
-CFLAGS-utils := -DNOT_IN_libc $(SSP_ALL_CFLAGS) -B$(top_builddir)lib -Wl,-rpath-link,$(top_builddir)lib
-CFLAGS-utils-common := -I$(top_srcdir)ldso/include -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO)
-CFLAGS-utils-shared := $(PIEFLAG) $(LDPIEFLAG)
+# "make utils" flags
+
+CFLAGS-utils := -DNOT_IN_libc $(SSP_ALL_CFLAGS) \
+ -B$(top_builddir)lib -Wl,-rpath-link,$(top_builddir)lib
-CFLAGS-ldconfig := $(CFLAGS-utils-common)
+pie := $(PIEFLAG) $(LDPIEFLAG)
+CFLAGS-ldconfig := -I$(top_srcdir)ldso/include \
+ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO)
ifeq ($(UCLIBC_STATIC_LDCONFIG),y)
CFLAGS-ldconfig += -static
else
-CFLAGS-ldconfig += $(CFLAGS-utils-shared)
+CFLAGS-ldconfig += $(pie)
endif
-CFLAGS-ldd := $(CFLAGS-utils-common) $(CFLAGS-utils-shared)
+CFLAGS-ldd := -I$(top_srcdir)ldso/include \
+ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
+ $(pie)
-# needs CFLAGS-utils explicitely, because the source file is not located in utils
-CFLAGS-iconv := $(CFLAGS-utils) $(CFLAGS-utils-shared) -DL_iconv_main
-
-CFLAGS-readelf := $(CFLAGS-utils-shared)
+CFLAGS-readelf := $(pie)
+# Need CFLAGS-utils explicitly, because the source file is not located in utils
+CFLAGS-iconv := $(CFLAGS-utils) $(pie) -DL_iconv_main
CFLAGS-locale := $(CFLAGS-utils)
-BUILD_CFLAGS-utils := -include $(top_srcdir)include/elf.h
-BUILD_CFLAGS-utils-common := $(CFLAGS-utils-common)
+# "make hostutils" flags
ifeq ($(LDSO_CACHE_SUPPORT),y)
-BUILD_CFLAGS-utils-common += -D__LDSO_CACHE_SUPPORT__=1
+LDSO_CACHE_SUPPORT := -D__LDSO_CACHE_SUPPORT__=1
endif
-BUILD_CFLAGS-ldconfig.host := $(BUILD_CFLAGS-utils-common)
+BUILD_CFLAGS-ldconfig.host := -Wl,-s \
+ -include $(top_srcdir)include/elf.h \
+ -I$(top_srcdir)ldso/include \
+ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
+ $(LDSO_CACHE_SUPPORT) \
+
+BUILD_CFLAGS-ldd.host := -Wl,-s \
+ -include $(top_srcdir)include/elf.h \
+ -I$(top_srcdir)ldso/include \
+ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
+ $(LDSO_CACHE_SUPPORT) \
-BUILD_CFLAGS-ldd.host := $(BUILD_CFLAGS-utils-common)
+BUILD_CFLAGS-readelf.host := -Wl,-s \
+ -include $(top_srcdir)include/elf.h \
-BUILD_LDFLAGS-utils := -Wl,-s
+
+# Rules
utils_DIR := $(top_srcdir)utils
utils_OUT := $(top_builddir)utils
@@ -81,6 +95,7 @@ hostutils: $(hostutils_OBJ)
$(hostutils_OBJ): $(utils_OUT)/%.host : $(utils_DIR)/%.c
$(hcompile.u)
+
install-y += utils_install
# This installs both utils and hostutils, so doesn't depend on either.
@@ -96,10 +111,10 @@ ifeq ($(UCLIBC_HAS_LOCALE),y)
$(Q)$(INSTALL) -m 755 $(utils_OUT)/locale$(DOTHOST) $(PREFIX)$(DEVEL_PREFIX)bin/locale
endif
+
objclean-y += utils_clean
utils_clean:
$(do_rm) $(addprefix $(utils_OUT)/, ldconfig ldd readelf iconv locale *.host)
# This is a hack..
$(Q)$(RM) $(utils_OUT)/.*.dep
-