From dd43462ee234a3d32e50f485d1d687bc979d2e21 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 11 Jan 2002 21:09:54 +0000 Subject: More build system cleanups... --- Makefile | 19 ++++++++++--------- Rules.mak | 18 +++++------------- ldso/Makefile | 6 ++++++ libcrypt/Makefile | 2 +- libm/Makefile | 5 ++--- libm/powerpc/Makefile | 5 ++--- libpthread/Makefile | 2 +- libresolv/Makefile | 2 +- libutil/Makefile | 2 +- 9 files changed, 29 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index d9c46baeb..846e2f935 100644 --- a/Makefile +++ b/Makefile @@ -170,7 +170,7 @@ $(patsubst %, _dir_%, $(DIRS)) : dummy tags: ctags -R -install: install_dev install_runtime install_gcc +install: install_dev install_runtime install_toolchain # Installs header files and development library links. @@ -198,11 +198,6 @@ ifeq ($(strip $(HAVE_SHARED)),true) install -d $(PREFIX)$(DEVEL_PREFIX)/bin install -m 644 lib/lib*-$(MAJOR_VERSION).$(MINOR_VERSION).so $(PREFIX)$(DEVEL_PREFIX)/lib cp -a lib/*.so.* $(PREFIX)$(DEVEL_PREFIX)/lib - install -m 755 ldso/util/ldd $(PREFIX)$(DEVEL_PREFIX)/bin - install -m 755 ldso/util/readelf $(PREFIX)$(DEVEL_PREFIX)/bin - install -d $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin - ln -fs $(DEVEL_PREFIX)/bin/ldd $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldd - ln -fs $(DEVEL_PREFIX)/bin/readelf $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-readelf @if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so ] ; then \ set -x -e; \ install -m 755 lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so $(PREFIX)$(DEVEL_PREFIX)/lib; \ @@ -210,15 +205,21 @@ ifeq ($(strip $(HAVE_SHARED)),true) ln -s $(DEVEL_PREFIX)/lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so \ $(PREFIX)$(SHARED_LIB_LOADER_PATH)/$(UCLIBC_LDSO) || true; \ fi; +endif + +install_toolchain: + @$(MAKE) -C ldso shared + install -m 755 ldso/util/ldd $(PREFIX)$(DEVEL_PREFIX)/bin + install -m 755 ldso/util/readelf $(PREFIX)$(DEVEL_PREFIX)/bin + install -d $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin + ln -fs $(DEVEL_PREFIX)/bin/ldd $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldd + ln -fs $(DEVEL_PREFIX)/bin/readelf $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-readelf @if [ -x ldso/util/ldconfig ] ; then \ set -x -e; \ install -d $(PREFIX)$(DEVEL_PREFIX)/etc; \ install -m 755 ldso/util/ldconfig $(PREFIX)$(DEVEL_PREFIX)/bin; \ ln -fs $(DEVEL_PREFIX)/sbin/ldconfig $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldconfig; \ fi; -endif - -install_gcc: $(MAKE) -C extra/gcc-uClibc install diff --git a/Rules.mak b/Rules.mak index 70f22fe8c..2093d4285 100644 --- a/Rules.mak +++ b/Rules.mak @@ -70,28 +70,17 @@ endif ARFLAGS=r -CCFLAGS=$(WARNINGS) $(OPTIMIZATION) -fno-builtin -nostdinc $(CPUFLAGS) -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D_LIBC -TARGET_CCFLAGS=--uclibc-use-build-dir $(WARNINGS) $(OPTIMIZATION) $(CPUFLAGS) -CFLAGS=$(ARCH_CFLAGS) $(CCFLAGS) $(DEFS) $(ARCH_CFLAGS2) -TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc -TARGET_CFLAGS=$(ARCH_CFLAGS) $(TARGET_CCFLAGS) $(DEFS) $(ARCH_CFLAGS2) +CFLAGS=$(WARNINGS) $(OPTIMIZATION) -fno-builtin -nostdinc $(CPUFLAGS) \ + -nostdinc -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D_LIBC $(ARCH_CFLAGS) NATIVE_CFLAGS=-O2 -Wall ifeq ($(strip $(DODEBUG)),true) CFLAGS += -g - TARGET_CFLAGS += -g LDFLAGS = -shared -nostdlib --warn-common --warn-once -z combreloc - TARGET_LDFLAGS = --uclibc-use-build-dir -Wl,-warn-common STRIPTOOL = /bin/true -Since_we_are_debugging else CFLAGS += -DNDEBUG #-fomit-frame-pointer - TARGET_CFLAGS += -DNDEBUG #-fomit-frame-pointer LDFLAGS = -s -shared -nostdlib --warn-common --warn-once -z combreloc - TARGET_LDFLAGS = --uclibc-use-build-dir -s -Wl,-warn-common -endif -ifeq ($(strip $(DOPIC)),true) - CFLAGS += -fPIC - TARGET_CFLAGS += -fPIC endif ifeq ($(strip $(HAVE_SHARED)),true) @@ -106,6 +95,9 @@ else BUILD_DYNAMIC_LINKER=/lib/$(notdir $(SYSTEM_LDSO)) endif endif +ifeq ($(strip $(DOPIC)),true) + CFLAGS += -fPIC -D__PIC__ +endif # TARGET_PREFIX is the directory under which which the uClibc runtime # environment will be installed and used on the target system. The diff --git a/ldso/Makefile b/ldso/Makefile index 8eedd40b0..3031ef5f3 100644 --- a/ldso/Makefile +++ b/ldso/Makefile @@ -29,12 +29,18 @@ ALL_SUBDIRS = ldso libdl util all: ifeq ($(strip $(BUILD_UCLIBC_LDSO)),true) $(MAKE) -C $(LIBRARY_CACHE) ldso; +else + echo "Not building ld-uClibc" endif shared: ifeq ($(strip $(BUILD_UCLIBC_LDSO)),true) $(MAKE) -C $(LIBRARY_CACHE) libdl; +else + echo "Not building libdl" endif + +utils: $(MAKE) -C $(LIBRARY_CACHE) util; clean: diff --git a/libcrypt/Makefile b/libcrypt/Makefile index 8d72741ef..9e054f055 100644 --- a/libcrypt/Makefile +++ b/libcrypt/Makefile @@ -42,7 +42,7 @@ ar-target: $(OBJS) install -m 644 $(LIBCRYPT) $(TOPDIR)lib $(OBJS): %.o : %.c - $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o $(OBJ): Makefile diff --git a/libm/Makefile b/libm/Makefile index 51d7be8f7..fc1322c35 100644 --- a/libm/Makefile +++ b/libm/Makefile @@ -45,8 +45,7 @@ ALL_SUBDIRS = powerpc LIBM=libm.a LIBM_SHARED=libm.so LIBM_SHARED_FULLNAME=libm-$(MAJOR_VERSION).$(MINOR_VERSION).so -TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc -TARGET_CFLAGS+=-D_IEEE_LIBM -D_ISOC99_SOURCE -D_SVID_SOURCE +CFLAGS+=-D_IEEE_LIBM -D_ISOC99_SOURCE -D_SVID_SOURCE ifeq ($(strip $(DO_C99_MATH)),true) CSRC = e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c\ @@ -108,7 +107,7 @@ ar-target: $(OBJS) $(AR) $(ARFLAGS) $(LIBM) $(OBJS) $(COBJS): %.o : %.c - $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o $(OBJ): Makefile diff --git a/libm/powerpc/Makefile b/libm/powerpc/Makefile index 5922d361e..58ab7fbf5 100644 --- a/libm/powerpc/Makefile +++ b/libm/powerpc/Makefile @@ -35,8 +35,7 @@ TOPDIR=../../ include $(TOPDIR)Rules.mak LIBM=../libm.a -TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc -TARGET_CFLAGS+=-D_IEEE_LIBM -D_ISOC99_SOURCE -D_SVID_SOURCE +CFLAGS+=-D_IEEE_LIBM -D_ISOC99_SOURCE -D_SVID_SOURCE ifeq ($(strip $(DO_C99_MATH)),true) CSRC = s_ceil.c s_floor.c s_ldexp.c s_frexp.c s_logb.c s_modf.c w_scalb.c s_copysign.c s_rint.c @@ -59,7 +58,7 @@ ar-target: $(OBJS) $(AR) $(ARFLAGS) $(LIBM) $(OBJS) $(COBJS): %.o : %.c - $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o $(OBJ): Makefile diff --git a/libpthread/Makefile b/libpthread/Makefile index fa6e0e371..28f5764a9 100644 --- a/libpthread/Makefile +++ b/libpthread/Makefile @@ -42,7 +42,7 @@ ar-target: $(OBJS) install -m 644 $(LIBPTHREAD) $(TOPDIR)lib $(OBJS): %.o : %.c - $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o $(OBJ): Makefile diff --git a/libresolv/Makefile b/libresolv/Makefile index c494afc17..920555c88 100644 --- a/libresolv/Makefile +++ b/libresolv/Makefile @@ -43,7 +43,7 @@ ar-target: $(OBJS) install -m 644 $(LIBRESOLV) $(TOPDIR)lib $(OBJS): %.o : %.c - $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o $(OBJ): Makefile diff --git a/libutil/Makefile b/libutil/Makefile index f86f7c8f5..4609086df 100644 --- a/libutil/Makefile +++ b/libutil/Makefile @@ -46,7 +46,7 @@ ar-target: $(OBJS) install -m 644 $(LIBUTIL) $(TOPDIR)lib/ $(OBJS): %.o : %.c - $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o shared: all -- cgit v1.2.3