shared:
@$(MAKE) -C libc shared
- @$(MAKE) -C ldso/util
+ @$(MAKE) -C $(LIBRARY_CACHE) ldso/util
ifeq ($(LDSO_PRESENT), $(TARGET_ARCH))
- @$(MAKE) -C ldso shared
+ @$(MAKE) -C $(LIBRARY_CACHE) ldso shared
endif
@$(MAKE) -C libcrypt shared
@$(MAKE) -C libutil shared
# directory.
install_target:
ifeq ($(DO_SHARED),shared)
- install -d $(TARGET_PREFIX)/lib
- install -d $(TARGET_PREFIX)/etc
- install -d $(TARGET_PREFIX)/sbin
- install -d $(TARGET_PREFIX)/usr/bin
- install -m 644 lib/lib*-0.9.5.so $(TARGET_PREFIX)/lib
- cp -a lib/*.so.* $(TARGET_PREFIX)/lib
+ install -d $(DESTDIR)$(TARGET_PREFIX)/lib
+ install -d $(DESTDIR)$(TARGET_PREFIX)/etc
+ install -d $(DESTDIR)$(TARGET_PREFIX)/sbin
+ install -d $(DESTDIR)$(TARGET_PREFIX)/usr/bin
+ install -m 644 lib/lib*-0.9.5.so $(DESTDIR)$(TARGET_PREFIX)/lib
+ cp -a lib/*.so.* $(DESTDIR)$(TARGET_PREFIX)/lib
ifeq ($(LDSO_PRESENT),$(TARGET_ARCH))
- install -m 755 lib/ld-uClibc-0.9.5.so $(TARGET_PREFIX)/lib
- install -m 755 ldso/util/ldd $(TARGET_PREFIX)/usr/bin
- install -m 755 ldso/util/ldconfig $(TARGET_PREFIX)/sbin
+ install -m 755 lib/ld-uClibc-0.9.5.so $(DESTDIR)$(TARGET_PREFIX)/lib
+ install -m 755 ldso/util/ldd $(DESTDIR)$(TARGET_PREFIX)/usr/bin
+ install -m 755 ldso/util/readelf $(DESTDIR)$(TARGET_PREFIX)/usr/bin
+ if [ -x ldso/util/ldconfig ] ; then \
+ install -m 755 ldso/util/ldconfig $(DESTDIR)$(TARGET_PREFIX)/sbin; \
+ fi;
endif
ifeq ($(NATIVE_ARCH), $(TARGET_ARCH))
# -@if [ -x ldso/util/ldconfig ] ; then ldso/util/ldconfig; fi
# libary as the primary libc.
install_runtime:
ifeq ($(DO_SHARED),shared)
- install -d $(DEVEL_PREFIX)/lib
- install -d $(DEVEL_PREFIX)/etc
- install -d $(DEVEL_PREFIX)/bin
- install -m 644 lib/lib*-0.9.5.so $(DEVEL_PREFIX)/lib
- cp -a lib/*.so.* $(DEVEL_PREFIX)/lib
+ install -d $(DESTDIR)$(DEVEL_PREFIX)/lib
+ install -d $(DESTDIR)$(DEVEL_PREFIX)/etc
+ install -d $(DESTDIR)$(DEVEL_PREFIX)/bin
+ install -m 644 lib/lib*-0.9.5.so $(DESTDIR)$(DEVEL_PREFIX)/lib
+ cp -a lib/*.so.* $(DESTDIR)$(DEVEL_PREFIX)/lib
ifeq ($(LDSO_PRESENT),$(TARGET_ARCH))
- install -m 755 lib/ld-uClibc-0.9.5.so $(DEVEL_PREFIX)/lib
- install -m 755 ldso/util/ldd $(DEVEL_PREFIX)/bin
- install -m 755 ldso/util/ldconfig $(DEVEL_PREFIX)/bin
- install -d $(TARGET_PREFIX)/bin
- ln -fs $(DEVEL_PREFIX)/bin/ldd $(TARGET_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldd
- install -d $(TARGET_PREFIX)/sbin
- ln -fs $(DEVEL_PREFIX)/sbin/ldconfig $(TARGET_PREFIX)/sbin/$(TARGET_ARCH)-uclibc-ldconfig
+ install -m 755 lib/ld-uClibc-0.9.5.so $(DESTDIR)$(DEVEL_PREFIX)/lib
+ install -m 755 ldso/util/ldd $(DESTDIR)$(DEVEL_PREFIX)/bin
+ install -m 755 ldso/util/readelf $(DESTDIR)$(DEVEL_PREFIX)/bin
+ install -d $(DESTDIR)$(DEVEL_PREFIX)/bin
+ ln -fs $(DEVEL_PREFIX)/bin/ldd $(DESTDIR)$(DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldd
+ if [ -x ldso/util/ldconfig ] ; then \
+ install -m 755 ldso/util/ldconfig $(DESTDIR)$(DEVEL_PREFIX)/bin; \
+ install -d $(DESTDIR)$(DEVEL_PREFIX)/sbin; \
+ ln -fs $(DEVEL_PREFIX)/sbin/ldconfig $(DESTDIR)$(DEVEL_PREFIX)/sbin/$(TARGET_ARCH)-uclibc-ldconfig; \
+ fi;
endif
endif
# Installs header files and development library links.
# DEVEL_PREFIX should be $(PREFIX)/$(target)-linux-uclibc/
install_dev:
- install -d $(DEVEL_PREFIX)/lib
- install -m 644 lib/*.[ao] $(DEVEL_PREFIX)/lib/
+ install -d $(DESTDIR)$(DEVEL_PREFIX)/lib
+ install -m 644 lib/*.[ao] $(DESTDIR)$(DEVEL_PREFIX)/lib/
ifeq ($(DO_SHARED),shared)
- find lib/ -type l -name '*.so' -exec cp -a {} $(DEVEL_PREFIX)/lib ';'
+ find lib/ -type l -name '*.so' -exec cp -a {} $(DESTDIR)$(DEVEL_PREFIX)/lib ';'
ifeq ($(NATIVE_ARCH), $(TARGET_ARCH))
# -@if [ -x ldso/util/ldconfig ] ; then ldso/util/ldconfig; fi
endif
endif
- install -d $(DEVEL_PREFIX)/include
+ install -d $(DESTDIR)$(DEVEL_PREFIX)/include
find include/ -name '*.h' -depth -follow -exec install \
- -D -m 644 {} $(DEVEL_PREFIX)/'{}' ';'
+ -D -m 644 {} $(DESTDIR)$(DEVEL_PREFIX)/'{}' ';'
install_gcc:
$(MAKE) -C extra/gcc-uClibc install
ifeq ($(LDSO_PRESENT), $(TARGET_ARCH))
LDSO=$(TOPDIR)lib/$(UCLIBC_LDSO)
- DYNAMIC_LINKER=/lib/$(UCLIBC_LDSO)
+ DYNAMIC_LINKER=$(DESTDIR)$(PREFIX)/lib/$(UCLIBC_LDSO)
BUILD_DYNAMIC_LINKER=$(shell cd $(TOPDIR)lib; pwd)/$(UCLIBC_LDSO)
else
LDSO=$(SYSTEM_LDSO)
DYNAMIC_LINKER=/lib/$(notdir $(SYSTEM_LDSO))
BUILD_DYNAMIC_LINKER=$(shell cd $(TOPDIR)lib; pwd)/$(UCLIBC_LDSO)
endif
+LIBRARY_CACHE=#-DUSE_CACHE
# Disable libm if HAS_FLOATING_POINT isn't true.
ifneq ($(HAS_FLOATING_POINT),true)
DOPIC = false
# PREFIX is the directory prefix that is applied to all installed
-# files. Typically, it is set to /usr or /usr/local, although it
-# could also be /opt/vendor_name_here/some/random/path/. The
-# install_runtime makefile target installs a few symbolic links
-# based on PREFIX, not DEVEL_PREFIX.
+# files. Typically, it is set to /usr or /usr/local, although it could
+# also be /opt/vendor_name_here/some/random/path/. The install_runtime
+# makefile target installs a few symbolic links based on PREFIX, not
+# DEVEL_PREFIX.
+#
+# DEVEL_PREFIX is the directory where the development environment will
+# be installed. The uClibc header files are installed into
+# $(DEVEL_PREFIX)/include, static libraries are installed into
+# $(DEVEL_PREFIX)/lib, etc. This directory is compiled into the uclibc
+# cross compiler spoofer. Generally, DEVEL_PREFIX should be set to
+# the same thing as $(PREFIX). DEVEL_PREFIX is used by the Makefile install
+# targets install_gcc, install_dev, and install_runtime.
#
-# DEVEL_PREFIX is the directory into which the development environment
-# will be installed. Include files are installed into
-# $(DEVEL_PREFIX)/include, libraries into $(DEVEL_PREFIX)/lib, etc.
-# This directory is compiled into the uclibc cross compiler spoofer.
-# Generally, DEVEL_PREFIX should be $(PREFIX)/$(TARGET_ARCH)-uclibc-linux.
-# DEVEL_PREFIX is used by the Makefile install targets install_gcc,
-# install_dev, and install_runtime.
-#
# TARGET_PREFIX is the directory into which the target runtime
-# environment is installed. The target runtime environment is
-# what one would use for a embedded system where uclibc is the
-# native libaray. This will typically be a staging area for
-# creating a root filesystem for the target system, so the default
-# is in the local directory.
+# environment is installed. The target runtime environment is what one
+# would use for a embedded system where uclibc is the native libaray.
+# This will typically be a staging area for creating a root filesystem
+# for the target system, so the default is in the local directory.
#
-# If you want to install to a temporary directory before copying
-# files to their final location, you can change PREFIX after build
-# but before 'make install'.
-PREFIX = /usr
-DEVEL_PREFIX = $(PREFIX)/$(TARGET_ARCH)-linux-uclibc
-TARGET_PREFIX = $(TOPDIR)/_install
+# If you want to install to a temporary directory before copying files
+# to their final location, define DESTDIR during the install step,
+# i.e., 'make install DESTDIR=/home/foo/uclibc/_install'.
+PREFIX = /usr/$(TARGET_ARCH)-linux-uclibc
+DEVEL_PREFIX = $(PREFIX)
+TARGET_PREFIX = /
DOPIC = false
# PREFIX is the directory prefix that is applied to all installed
-# files. Typically, it is set to /usr or /usr/local, although it
-# could also be /opt/vendor_name_here/some/random/path/. The
-# install_runtime makefile target installs a few symbolic links
-# based on PREFIX, not DEVEL_PREFIX.
+# files. Typically, it is set to /usr or /usr/local, although it could
+# also be /opt/vendor_name_here/some/random/path/. The install_runtime
+# makefile target installs a few symbolic links based on PREFIX, not
+# DEVEL_PREFIX.
+#
+# DEVEL_PREFIX is the directory where the development environment will
+# be installed. The uClibc header files are installed into
+# $(DEVEL_PREFIX)/include, static libraries are installed into
+# $(DEVEL_PREFIX)/lib, etc. This directory is compiled into the uclibc
+# cross compiler spoofer. Generally, DEVEL_PREFIX should be set to
+# the same thing as $(PREFIX). DEVEL_PREFIX is used by the Makefile install
+# targets install_gcc, install_dev, and install_runtime.
#
-# DEVEL_PREFIX is the directory into which the development environment
-# will be installed. Include files are installed into
-# $(DEVEL_PREFIX)/include, libraries into $(DEVEL_PREFIX)/lib, etc.
-# This directory is compiled into the uclibc cross compiler spoofer.
-# Generally, DEVEL_PREFIX should be $(PREFIX)/$(TARGET_ARCH)-uclibc-linux.
-# DEVEL_PREFIX is used by the Makefile install targets install_gcc,
-# install_dev, and install_runtime.
-#
# TARGET_PREFIX is the directory into which the target runtime
-# environment is installed. The target runtime environment is
-# what one would use for a embedded system where uclibc is the
-# native libaray. This will typically be a staging area for
-# creating a root filesystem for the target system, so the default
-# is in the local directory.
+# environment is installed. The target runtime environment is what one
+# would use for a embedded system where uclibc is the native libaray.
+# This will typically be a staging area for creating a root filesystem
+# for the target system, so the default is in the local directory.
#
-# If you want to install to a temporary directory before copying
-# files to their final location, you can change PREFIX after build
-# but before 'make install'.
+# If you want to install to a temporary directory before copying files
+# to their final location, define DESTDIR during the install step,
+# i.e., 'make install DESTDIR=/home/foo/uclibc/_install'.
PREFIX = /opt/uClinux
DEVEL_PREFIX = $(PREFIX)/$(TARGET_ARCH)-elf
TARGET_PREFIX = $(TOPDIR)/_install
# Set the following to `true' to make a debuggable build, and `false' for
# production builds.
-DODEBUG = false
+DODEBUG = true
# Compiler warnings you want to see
WARNINGS=-Wall
DOPIC = false
# PREFIX is the directory prefix that is applied to all installed
-# files. Typically, it is set to /usr or /usr/local, although it
-# could also be /opt/vendor_name_here/some/random/path/. The
-# install_runtime makefile target installs a few symbolic links
-# based on PREFIX, not DEVEL_PREFIX.
+# files. Typically, it is set to /usr or /usr/local, although it could
+# also be /opt/vendor_name_here/some/random/path/. The install_runtime
+# makefile target installs a few symbolic links based on PREFIX, not
+# DEVEL_PREFIX.
+#
+# DEVEL_PREFIX is the directory where the development environment will
+# be installed. The uClibc header files are installed into
+# $(DEVEL_PREFIX)/include, static libraries are installed into
+# $(DEVEL_PREFIX)/lib, etc. This directory is compiled into the uclibc
+# cross compiler spoofer. Generally, DEVEL_PREFIX should be set to
+# the same thing as $(PREFIX). DEVEL_PREFIX is used by the Makefile install
+# targets install_gcc, install_dev, and install_runtime.
#
-# DEVEL_PREFIX is the directory into which the development environment
-# will be installed. Include files are installed into
-# $(DEVEL_PREFIX)/include, libraries into $(DEVEL_PREFIX)/lib, etc.
-# This directory is compiled into the uclibc cross compiler spoofer.
-# Generally, DEVEL_PREFIX should be $(PREFIX)/$(TARGET_ARCH)-uclibc-linux.
-# DEVEL_PREFIX is used by the Makefile install targets install_gcc,
-# install_dev, and install_runtime.
-#
# TARGET_PREFIX is the directory into which the target runtime
-# environment is installed. The target runtime environment is
-# what one would use for a embedded system where uclibc is the
-# native libaray. This will typically be a staging area for
-# creating a root filesystem for the target system, so the default
-# is in the local directory.
+# environment is installed. The target runtime environment is what one
+# would use for a embedded system where uclibc is the native libaray.
+# This will typically be a staging area for creating a root filesystem
+# for the target system, so the default is in the local directory.
#
-# If you want to install to a temporary directory before copying
-# files to their final location, you can change PREFIX after build
-# but before 'make install'.
-PREFIX = /usr
-DEVEL_PREFIX = $(PREFIX)/$(TARGET_ARCH)-linux-uclibc
-TARGET_PREFIX = $(TOPDIR)/_install
+# If you want to install to a temporary directory before copying files
+# to their final location, define DESTDIR during the install step,
+# i.e., 'make install DESTDIR=/home/foo/uclibc/_install'.
+PREFIX = /usr/$(TARGET_ARCH)-linux-uclibc
+DEVEL_PREFIX = $(PREFIX)
+TARGET_PREFIX = /
# PREFIX is the directory prefix that is applied to all installed
-# files. Typically, it is set to /usr or /usr/local, although it
-# could also be /opt/vendor_name_here/some/random/path/. The
-# install_runtime makefile target installs a few symbolic links
-# based on PREFIX, not DEVEL_PREFIX.
+# files. Typically, it is set to /usr or /usr/local, although it could
+# also be /opt/vendor_name_here/some/random/path/. The install_runtime
+# makefile target installs a few symbolic links based on PREFIX, not
+# DEVEL_PREFIX.
+#
+# DEVEL_PREFIX is the directory where the development environment will
+# be installed. The uClibc header files are installed into
+# $(DEVEL_PREFIX)/include, static libraries are installed into
+# $(DEVEL_PREFIX)/lib, etc. This directory is compiled into the uclibc
+# cross compiler spoofer. Generally, DEVEL_PREFIX should be set to
+# the same thing as $(PREFIX). DEVEL_PREFIX is used by the Makefile install
+# targets install_gcc, install_dev, and install_runtime.
#
-# DEVEL_PREFIX is the directory into which the development environment
-# will be installed. Include files are installed into
-# $(DEVEL_PREFIX)/include, libraries into $(DEVEL_PREFIX)/lib, etc.
-# This directory is compiled into the uclibc cross compiler spoofer.
-# Generally, DEVEL_PREFIX should be $(PREFIX)/$(TARGET_ARCH)-uclibc-linux.
-# DEVEL_PREFIX is used by the Makefile install targets install_gcc,
-# install_dev, and install_runtime.
-#
# TARGET_PREFIX is the directory into which the target runtime
-# environment is installed. The target runtime environment is
-# what one would use for a embedded system where uclibc is the
-# native libaray. This will typically be a staging area for
-# creating a root filesystem for the target system, so the default
-# is in the local directory.
+# environment is installed. The target runtime environment is what one
+# would use for a embedded system where uclibc is the native libaray.
+# This will typically be a staging area for creating a root filesystem
+# for the target system, so the default is in the local directory.
#
-# If you want to install to a temporary directory before copying
-# files to their final location, you can change PREFIX after build
-# but before 'make install'.
+# If you want to install to a temporary directory before copying files
+# to their final location, define DESTDIR during the install step,
+# i.e., 'make install DESTDIR=/home/foo/uclibc/_install'.
PREFIX = /opt/uClinux
DEVEL_PREFIX = $(PREFIX)/$(TARGET_ARCH)-elf
TARGET_PREFIX = $(TOPDIR)/_install
HAVE_ELF = false
# PREFIX is the directory prefix that is applied to all installed
-# files. Typically, it is set to /usr or /usr/local, although it
-# could also be /opt/vendor_name_here/some/random/path/. The
-# install_runtime makefile target installs a few symbolic links
-# based on PREFIX, not DEVEL_PREFIX.
+# files. Typically, it is set to /usr or /usr/local, although it could
+# also be /opt/vendor_name_here/some/random/path/. The install_runtime
+# makefile target installs a few symbolic links based on PREFIX, not
+# DEVEL_PREFIX.
+#
+# DEVEL_PREFIX is the directory where the development environment will
+# be installed. The uClibc header files are installed into
+# $(DEVEL_PREFIX)/include, static libraries are installed into
+# $(DEVEL_PREFIX)/lib, etc. This directory is compiled into the uclibc
+# cross compiler spoofer. Generally, DEVEL_PREFIX should be set to
+# the same thing as $(PREFIX). DEVEL_PREFIX is used by the Makefile install
+# targets install_gcc, install_dev, and install_runtime.
#
-# DEVEL_PREFIX is the directory into which the development environment
-# will be installed. Include files are installed into
-# $(DEVEL_PREFIX)/include, libraries into $(DEVEL_PREFIX)/lib, etc.
-# This directory is compiled into the uclibc cross compiler spoofer.
-# Generally, DEVEL_PREFIX should be $(PREFIX)/$(TARGET_ARCH)-uclibc-linux.
-# DEVEL_PREFIX is used by the Makefile install targets install_gcc,
-# install_dev, and install_runtime.
-#
# TARGET_PREFIX is the directory into which the target runtime
-# environment is installed. The target runtime environment is
-# what one would use for a embedded system where uclibc is the
-# native libaray. This will typically be a staging area for
-# creating a root filesystem for the target system, so the default
-# is in the local directory.
+# environment is installed. The target runtime environment is what one
+# would use for a embedded system where uclibc is the native libaray.
+# This will typically be a staging area for creating a root filesystem
+# for the target system, so the default is in the local directory.
#
-# If you want to install to a temporary directory before copying
-# files to their final location, you can change PREFIX after build
-# but before 'make install'.
-
+# If you want to install to a temporary directory before copying files
+# to their final location, define DESTDIR during the install step,
+# i.e., 'make install DESTDIR=/home/foo/uclibc/_install'.
PREFIX = /opt/uClinux
DEVEL_PREFIX = $(PREFIX)/$(TARGET_ARCH)-coff
TARGET_PREFIX = $(TOPDIR)/_install
DOPIC = false
# PREFIX is the directory prefix that is applied to all installed
-# files. Typically, it is set to /usr or /usr/local, although it
-# could also be /opt/vendor_name_here/some/random/path/. The
-# install_runtime makefile target installs a few symbolic links
-# based on PREFIX, not DEVEL_PREFIX.
+# files. Typically, it is set to /usr or /usr/local, although it could
+# also be /opt/vendor_name_here/some/random/path/. The install_runtime
+# makefile target installs a few symbolic links based on PREFIX, not
+# DEVEL_PREFIX.
+#
+# DEVEL_PREFIX is the directory where the development environment will
+# be installed. The uClibc header files are installed into
+# $(DEVEL_PREFIX)/include, static libraries are installed into
+# $(DEVEL_PREFIX)/lib, etc. This directory is compiled into the uclibc
+# cross compiler spoofer. Generally, DEVEL_PREFIX should be set to
+# the same thing as $(PREFIX). DEVEL_PREFIX is used by the Makefile install
+# targets install_gcc, install_dev, and install_runtime.
#
-# DEVEL_PREFIX is the directory into which the development environment
-# will be installed. Include files are installed into
-# $(DEVEL_PREFIX)/include, libraries into $(DEVEL_PREFIX)/lib, etc.
-# This directory is compiled into the uclibc cross compiler spoofer.
-# Generally, DEVEL_PREFIX should be $(PREFIX)/$(TARGET_ARCH)-uclibc-linux.
-# DEVEL_PREFIX is used by the Makefile install targets install_gcc,
-# install_dev, and install_runtime.
-#
# TARGET_PREFIX is the directory into which the target runtime
-# environment is installed. The target runtime environment is
-# what one would use for a embedded system where uclibc is the
-# native libaray. This will typically be a staging area for
-# creating a root filesystem for the target system, so the default
-# is in the local directory.
+# environment is installed. The target runtime environment is what one
+# would use for a embedded system where uclibc is the native libaray.
+# This will typically be a staging area for creating a root filesystem
+# for the target system, so the default is in the local directory.
#
-# If you want to install to a temporary directory before copying
-# files to their final location, you can change PREFIX after build
-# but before 'make install'.
-PREFIX = /usr
-DEVEL_PREFIX = $(PREFIX)/$(TARGET_ARCH)-linux-uclibc
-TARGET_PREFIX = $(TOPDIR)/_install
+# If you want to install to a temporary directory before copying files
+# to their final location, define DESTDIR during the install step,
+# i.e., 'make install DESTDIR=/home/foo/uclibc/_install'.
+PREFIX = /usr/$(TARGET_ARCH)-linux-uclibc
+DEVEL_PREFIX = $(PREFIX)
+TARGET_PREFIX = /
DOPIC = false
# PREFIX is the directory prefix that is applied to all installed
-# files. Typically, it is set to /usr or /usr/local, although it
-# could also be /opt/vendor_name_here/some/random/path/. The
-# install_runtime makefile target installs a few symbolic links
-# based on PREFIX, not DEVEL_PREFIX.
+# files. Typically, it is set to /usr or /usr/local, although it could
+# also be /opt/vendor_name_here/some/random/path/. The install_runtime
+# makefile target installs a few symbolic links based on PREFIX, not
+# DEVEL_PREFIX.
+#
+# DEVEL_PREFIX is the directory where the development environment will
+# be installed. The uClibc header files are installed into
+# $(DEVEL_PREFIX)/include, static libraries are installed into
+# $(DEVEL_PREFIX)/lib, etc. This directory is compiled into the uclibc
+# cross compiler spoofer. Generally, DEVEL_PREFIX should be set to
+# the same thing as $(PREFIX). DEVEL_PREFIX is used by the Makefile install
+# targets install_gcc, install_dev, and install_runtime.
#
-# DEVEL_PREFIX is the directory into which the development environment
-# will be installed. Include files are installed into
-# $(DEVEL_PREFIX)/include, libraries into $(DEVEL_PREFIX)/lib, etc.
-# This directory is compiled into the uclibc cross compiler spoofer.
-# Generally, DEVEL_PREFIX should be $(PREFIX)/$(TARGET_ARCH)-uclibc-linux.
-# DEVEL_PREFIX is used by the Makefile install targets install_gcc,
-# install_dev, and install_runtime.
-#
# TARGET_PREFIX is the directory into which the target runtime
-# environment is installed. The target runtime environment is
-# what one would use for a embedded system where uclibc is the
-# native libaray. This will typically be a staging area for
-# creating a root filesystem for the target system, so the default
-# is in the local directory.
+# environment is installed. The target runtime environment is what one
+# would use for a embedded system where uclibc is the native libaray.
+# This will typically be a staging area for creating a root filesystem
+# for the target system, so the default is in the local directory.
#
-# If you want to install to a temporary directory before copying
-# files to their final location, you can change PREFIX after build
-# but before 'make install'.
-PREFIX = /usr
-DEVEL_PREFIX = $(PREFIX)/$(TARGET_ARCH)-linux-uclibc
-TARGET_PREFIX = $(TOPDIR)/_install
+# If you want to install to a temporary directory before copying files
+# to their final location, define DESTDIR during the install step,
+# i.e., 'make install DESTDIR=/home/foo/uclibc/_install'.
+PREFIX = /usr/$(TARGET_ARCH)-linux-uclibc
+DEVEL_PREFIX = $(PREFIX)
+TARGET_PREFIX = /
DOPIC = false
# PREFIX is the directory prefix that is applied to all installed
-# files. Typically, it is set to /usr or /usr/local, although it
-# could also be /opt/vendor_name_here/some/random/path/. The
-# install_runtime makefile target installs a few symbolic links
-# based on PREFIX, not DEVEL_PREFIX.
+# files. Typically, it is set to /usr or /usr/local, although it could
+# also be /opt/vendor_name_here/some/random/path/. The install_runtime
+# makefile target installs a few symbolic links based on PREFIX, not
+# DEVEL_PREFIX.
+#
+# DEVEL_PREFIX is the directory where the development environment will
+# be installed. The uClibc header files are installed into
+# $(DEVEL_PREFIX)/include, static libraries are installed into
+# $(DEVEL_PREFIX)/lib, etc. This directory is compiled into the uclibc
+# cross compiler spoofer. Generally, DEVEL_PREFIX should be set to
+# the same thing as $(PREFIX). DEVEL_PREFIX is used by the Makefile install
+# targets install_gcc, install_dev, and install_runtime.
#
-# DEVEL_PREFIX is the directory into which the development environment
-# will be installed. Include files are installed into
-# $(DEVEL_PREFIX)/include, libraries into $(DEVEL_PREFIX)/lib, etc.
-# This directory is compiled into the uclibc cross compiler spoofer.
-# Generally, DEVEL_PREFIX should be $(PREFIX)/$(TARGET_ARCH)-uclibc-linux.
-# DEVEL_PREFIX is used by the Makefile install targets install_gcc,
-# install_dev, and install_runtime.
-#
# TARGET_PREFIX is the directory into which the target runtime
-# environment is installed. The target runtime environment is
-# what one would use for a embedded system where uclibc is the
-# native libaray. This will typically be a staging area for
-# creating a root filesystem for the target system, so the default
-# is in the local directory.
+# environment is installed. The target runtime environment is what one
+# would use for a embedded system where uclibc is the native libaray.
+# This will typically be a staging area for creating a root filesystem
+# for the target system, so the default is in the local directory.
#
-# If you want to install to a temporary directory before copying
-# files to their final location, you can change PREFIX after build
-# but before 'make install'.
-PREFIX = /usr
-DEVEL_PREFIX = $(PREFIX)/$(TARGET_ARCH)-linux-uclibc
+# If you want to install to a temporary directory before copying files
+# to their final location, define DESTDIR during the install step,
+# i.e., 'make install DESTDIR=/home/foo/uclibc/_install'.
+PREFIX = /usr/$(TARGET_ARCH)-linux-uclibc
+DEVEL_PREFIX = $(PREFIX)
TARGET_PREFIX = $(TOPDIR)/_install
DOPIC = false
# PREFIX is the directory prefix that is applied to all installed
-# files. Typically, it is set to /usr or /usr/local, although it
-# could also be /opt/vendor_name_here/some/random/path/. The
-# install_runtime makefile target installs a few symbolic links
-# based on PREFIX, not DEVEL_PREFIX.
+# files. Typically, it is set to /usr or /usr/local, although it could
+# also be /opt/vendor_name_here/some/random/path/. The install_runtime
+# makefile target installs a few symbolic links based on PREFIX, not
+# DEVEL_PREFIX.
+#
+# DEVEL_PREFIX is the directory where the development environment will
+# be installed. The uClibc header files are installed into
+# $(DEVEL_PREFIX)/include, static libraries are installed into
+# $(DEVEL_PREFIX)/lib, etc. This directory is compiled into the uclibc
+# cross compiler spoofer. Generally, DEVEL_PREFIX should be set to
+# the same thing as $(PREFIX). DEVEL_PREFIX is used by the Makefile install
+# targets install_gcc, install_dev, and install_runtime.
#
-# DEVEL_PREFIX is the directory into which the development environment
-# will be installed. Include files are installed into
-# $(DEVEL_PREFIX)/include, libraries into $(DEVEL_PREFIX)/lib, etc.
-# This directory is compiled into the uclibc cross compiler spoofer.
-# Generally, DEVEL_PREFIX should be $(PREFIX)/$(TARGET_ARCH)-uclibc-linux.
-# DEVEL_PREFIX is used by the Makefile install targets install_gcc,
-# install_dev, and install_runtime.
-#
# TARGET_PREFIX is the directory into which the target runtime
-# environment is installed. The target runtime environment is
-# what one would use for a embedded system where uclibc is the
-# native libaray. This will typically be a staging area for
-# creating a root filesystem for the target system, so the default
-# is in the local directory.
+# environment is installed. The target runtime environment is what one
+# would use for a embedded system where uclibc is the native libaray.
+# This will typically be a staging area for creating a root filesystem
+# for the target system, so the default is in the local directory.
#
-# If you want to install to a temporary directory before copying
-# files to their final location, you can change PREFIX after build
-# but before 'make install'.
+# If you want to install to a temporary directory before copying files
+# to their final location, define DESTDIR during the install step,
+# i.e., 'make install DESTDIR=/home/foo/uclibc/_install'.
PREFIX = /opt/uClinux
DEVEL_PREFIX = $(PREFIX)/$(TARGET_ARCH)-elf
TARGET_PREFIX = $(TOPDIR)/_install
gcc-uClibc.h: $(TOPDIR)/Config
@echo "/* this file was autogenerated by make */" > gcc-uClibc.h
+ @echo "#define UCLIBC_TARGET_PREFIX " \"$(TARGET_PREFIX)\" >> gcc-uClibc.h
@echo "#define UCLIBC_DEVEL_PREFIX " \"$(DEVEL_PREFIX)\" >> gcc-uClibc.h
@echo "#define UCLIBC_BUILD_DIR " \"$(UCLIBC_DIR)/\" >> gcc-uClibc.h
@echo "#define GCC_BIN " \"$(GCC_BIN)\" >> gcc-uClibc.h
chmod a+x $(TARGET_ARCH)-uclibc-ld
install: all
- install -d $(DEVEL_PREFIX)/bin;
- install -d $(DEVEL_PREFIX)/usr/bin;
- install -m 755 $(TARGET_ARCH)-uclibc-gcc $(DEVEL_PREFIX)/usr/bin/
- install -m 755 $(TARGET_ARCH)-uclibc-ld $(DEVEL_PREFIX)/usr/bin/
- ln -fs $(TARGET_ARCH)-uclibc-gcc $(DEVEL_PREFIX)/usr/bin/$(TARGET_ARCH)-uclibc-cc
- ln -fs $(DEVEL_PREFIX)/usr/bin/$(TARGET_ARCH)-uclibc-gcc $(DEVEL_PREFIX)/bin/gcc
- ln -fs $(DEVEL_PREFIX)/usr/bin/$(TARGET_ARCH)-uclibc-gcc $(DEVEL_PREFIX)/bin/cc
- ln -fs $(DEVEL_PREFIX)/usr/bin/$(TARGET_ARCH)-uclibc-ld $(DEVEL_PREFIX)/bin/ld
+ install -d $(DESTDIR)$(DEVEL_PREFIX)/bin;
+ install -m 755 $(TARGET_ARCH)-uclibc-gcc $(DESTDIR)$(DEVEL_PREFIX)/bin/
+ install -m 755 $(TARGET_ARCH)-uclibc-ld $(DESTDIR)$(DEVEL_PREFIX)/bin/
+ ln -fs $(TARGET_ARCH)-uclibc-gcc $(DESTDIR)$(DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-cc
+ ln -fs $(DESTDIR)$(DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(DESTDIR)$(DEVEL_PREFIX)/bin/gcc
+ ln -fs $(DESTDIR)$(DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(DESTDIR)$(DEVEL_PREFIX)/bin/cc
+ ln -fs $(DESTDIR)$(DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ld $(DESTDIR)$(DEVEL_PREFIX)/bin/ld
for app in addr2line ar as cpp gasp nm objcopy \
objdump ranlib size strings strip; do \
- ln -fs `which $(CROSS)$${app}` $(DEVEL_PREFIX)/bin/$${app}; \
- ln -fs `which $(CROSS)$${app}` $(DEVEL_PREFIX)/usr/bin/$(TARGET_ARCH)-uclibc-$${app}; \
+ ln -fs `which $(CROSS)$${app}` $(DESTDIR)$(DEVEL_PREFIX)/bin/$${app}; \
+ ln -fs `which $(CROSS)$${app}` $(DESTDIR)$(DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-$${app}; \
done
clean:
# define LDSO_PRELOAD "../util/ld.so.preload"
# define LDDSTUB "../util/lddstub"
#else
-# define LDSO_IMAGE UCLIBC_PREFIX "/lib/ld.so"
-# define LDSO_CONF UCLIBC_PREFIX "/etc/ld.so.conf"
-# define LDSO_CACHE UCLIBC_PREFIX "/etc/ld.so.cache"
-# define LDSO_PRELOAD UCLIBC_PREFIX "/etc/ld.so.preload"
-# define LDDSTUB UCLIBC_PREFIX "/usr/lib/lddstub"
+# define LDSO_IMAGE UCLIBC_TARGET_PREFIX "lib/ld.so"
+# define LDSO_CONF UCLIBC_TARGET_PREFIX "etc/ld.so.conf"
+# define LDSO_CACHE UCLIBC_TARGET_PREFIX "etc/ld.so.cache"
+# define LDSO_PRELOAD UCLIBC_TARGET_PREFIX "etc/ld.so.preload"
+# define LDDSTUB UCLIBC_TARGET_PREFIX "usr/lib/lddstub"
#endif
#define LDD_ARGV0 "__LDD_ARGV0"
TOPDIR=../../
include $(TOPDIR)Rules.mak
-TARGET_CFLAGS += #-DUSE_CACHE #-DDL_DEBUG #-funroll-loops
+TARGET_CFLAGS += #-DDL_DEBUG #-funroll-loops
LDSO_FULLNAME=ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so
-TARGET_CFLAGS+=-fPIC -D__PIC__ -DUCLIBC_PREFIX=\"$(PREFIX)\" \
+TARGET_CFLAGS+=-fPIC -D__PIC__ -DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
-DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
-DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR); pwd)\"
CSRC= boot1.c hash.c readelflib1.c $(TARGET_ARCH)/elfinterp.c
#endif
/* Check in <prefix>/usr/lib */
- pnt1 = UCLIBC_PREFIX "/usr/lib/";
+ pnt1 = UCLIBC_TARGET_PREFIX "/usr/lib/";
pnt = mylibname;
while (*pnt1)
*pnt++ = *pnt1++;
return tpnt1;
/* Check in <prefix>/lib */
- pnt1 = UCLIBC_PREFIX "/lib/";
+ pnt1 = UCLIBC_TARGET_PREFIX "/lib/";
pnt = mylibname;
while (*pnt1)
*pnt++ = *pnt1++;
#endif
/* Check in <prefix>/usr/lib */
- pnt1 = UCLIBC_PREFIX "/usr/lib/";
+ pnt1 = UCLIBC_TARGET_PREFIX "/usr/lib/";
pnt = mylibname;
while (*pnt1)
*pnt++ = *pnt1++;
return tpnt1;
/* Check in <prefix>/lib */
- pnt1 = UCLIBC_PREFIX "/lib/";
+ pnt1 = UCLIBC_TARGET_PREFIX "/lib/";
pnt = mylibname;
while (*pnt1)
*pnt++ = *pnt1++;
}
/* Generate the correct symbols that we need. */
+#if 0
weak_alias(_dlopen, dlopen);
weak_alias(_dlerror, dlerror);
weak_alias(_dlclose, dlclose);
weak_alias(_dlsym, dlsym);
weak_alias(_dladdr, dladdr);
+#endif
+asm(".weak dlopen;dlopen=_dlopen");
+asm(".weak dlerror;dlerror=_dlerror");
+asm(".weak dlclose;dlclose=_dlclose");
+asm(".weak dlsym;dlsym=_dlsym");
+asm(".weak dladdr;dladdr=_dladdr");
+
/* This is a real hack. We need access to the dynamic linker, but we
also need to make it possible to link against this library without any
unresolved externals. We provide these weak symbols to make the link
possible, but at run time the normal symbols are accessed. */
-static void foobar()
+static void __attribute__ ((unused)) foobar()
{
_dl_fprintf(2, "libdl library not correctly linked\n");
_dl_exit(1);
}
-static int __attribute__ ((unused)) foobar1 = (int) foobar; /* Use as pointer */
+asm(".weak _dl_fprintf; _dl_fprintf = foobar");
+asm(".weak _dl_find_hash; _dl_find_hash = foobar");
+asm(".weak _dl_load_shared_library; _dl_load_shared_library = foobar");
+asm(".weak _dl_parse_relocation_information; _dl_parse_relocation_information = foobar");
+asm(".weak _dl_parse_lazy_relocation_information; _dl_parse_lazy_relocation_information = foobar");
+#ifdef USE_CACHE
+asm(".weak _dl_map_cache; _dl_map_cache = foobar");
+asm(".weak _dl_unmap_cache; _dl_unmap_cache = foobar");
+#endif
+#if 0
+weak_alias(_dl_fprintf, foobar);
weak_alias(_dl_find_hash, foobar);
-weak_alias(_dl_symbol_tables, foobar1);
-weak_alias(_dl_handles, foobar1);
-weak_alias(_dl_loaded_modules, foobar1);
-weak_alias(_dl_debug_addr, foobar1);
-weak_alias(_dl_error_number, foobar1);
weak_alias(_dl_load_shared_library, foobar);
+weak_alias(_dl_parse_relocation_information, foobar);
+weak_alias(_dl_parse_lazy_relocation_information, foobar);
#ifdef USE_CACHE
weak_alias(_dl_map_cache, foobar);
weak_alias(_dl_unmap_cache, foobar);
#endif
-weak_alias(_dl_malloc_function, foobar1);
-weak_alias(_dl_parse_relocation_information, foobar);
-weak_alias(_dl_parse_lazy_relocation_information, foobar);
-weak_alias(_dl_fprintf, foobar);
+#endif
+
+static int __attribute__ ((unused)) foobar1 = (int) foobar; /* Use as pointer */
+asm(".weak _dl_symbol_tables; _dl_symbol_tables = foobar1");
+asm(".weak _dl_handles; _dl_handles = foobar1");
+asm(".weak _dl_loaded_modules; _dl_loaded_modules = foobar1");
+asm(".weak _dl_debug_addr; _dl_debug_addr = foobar1");
+asm(".weak _dl_error_number; _dl_error_number = foobar1");
+asm(".weak _dl_malloc_function; _dl_malloc_function = foobar1");
+#if 0
+weak_alias(_dl_symbol_tables, foobar1);
+weak_alias(_dl_handles, foobar1);
+weak_alias(_dl_loaded_modules, foobar1);
+weak_alias(_dl_debug_addr, foobar1);
+weak_alias(_dl_error_number, foobar1);
+weak_alias(_dl_malloc_function, foobar1);
+#endif
/*
* Dump information to stderrr about the current loaded modules
}
/* Generate the correct symbols that we need. */
+#if 0
weak_alias(_dlopen, dlopen);
weak_alias(_dlerror, dlerror);
weak_alias(_dlclose, dlclose);
weak_alias(_dlsym, dlsym);
weak_alias(_dladdr, dladdr);
+#endif
+asm(".weak dlopen;dlopen=_dlopen");
+asm(".weak dlerror;dlerror=_dlerror");
+asm(".weak dlclose;dlclose=_dlclose");
+asm(".weak dlsym;dlsym=_dlsym");
+asm(".weak dladdr;dladdr=_dladdr");
+
/* This is a real hack. We need access to the dynamic linker, but we
also need to make it possible to link against this library without any
unresolved externals. We provide these weak symbols to make the link
possible, but at run time the normal symbols are accessed. */
-static void foobar()
+static void __attribute__ ((unused)) foobar()
{
_dl_fprintf(2, "libdl library not correctly linked\n");
_dl_exit(1);
}
-static int __attribute__ ((unused)) foobar1 = (int) foobar; /* Use as pointer */
+asm(".weak _dl_fprintf; _dl_fprintf = foobar");
+asm(".weak _dl_find_hash; _dl_find_hash = foobar");
+asm(".weak _dl_load_shared_library; _dl_load_shared_library = foobar");
+asm(".weak _dl_parse_relocation_information; _dl_parse_relocation_information = foobar");
+asm(".weak _dl_parse_lazy_relocation_information; _dl_parse_lazy_relocation_information = foobar");
+#ifdef USE_CACHE
+asm(".weak _dl_map_cache; _dl_map_cache = foobar");
+asm(".weak _dl_unmap_cache; _dl_unmap_cache = foobar");
+#endif
+#if 0
+weak_alias(_dl_fprintf, foobar);
weak_alias(_dl_find_hash, foobar);
-weak_alias(_dl_symbol_tables, foobar1);
-weak_alias(_dl_handles, foobar1);
-weak_alias(_dl_loaded_modules, foobar1);
-weak_alias(_dl_debug_addr, foobar1);
-weak_alias(_dl_error_number, foobar1);
weak_alias(_dl_load_shared_library, foobar);
+weak_alias(_dl_parse_relocation_information, foobar);
+weak_alias(_dl_parse_lazy_relocation_information, foobar);
#ifdef USE_CACHE
weak_alias(_dl_map_cache, foobar);
weak_alias(_dl_unmap_cache, foobar);
#endif
-weak_alias(_dl_malloc_function, foobar1);
-weak_alias(_dl_parse_relocation_information, foobar);
-weak_alias(_dl_parse_lazy_relocation_information, foobar);
-weak_alias(_dl_fprintf, foobar);
+#endif
+
+static int __attribute__ ((unused)) foobar1 = (int) foobar; /* Use as pointer */
+asm(".weak _dl_symbol_tables; _dl_symbol_tables = foobar1");
+asm(".weak _dl_handles; _dl_handles = foobar1");
+asm(".weak _dl_loaded_modules; _dl_loaded_modules = foobar1");
+asm(".weak _dl_debug_addr; _dl_debug_addr = foobar1");
+asm(".weak _dl_error_number; _dl_error_number = foobar1");
+asm(".weak _dl_malloc_function; _dl_malloc_function = foobar1");
+#if 0
+weak_alias(_dl_symbol_tables, foobar1);
+weak_alias(_dl_handles, foobar1);
+weak_alias(_dl_loaded_modules, foobar1);
+weak_alias(_dl_debug_addr, foobar1);
+weak_alias(_dl_error_number, foobar1);
+weak_alias(_dl_malloc_function, foobar1);
+#endif
/*
* Dump information to stderrr about the current loaded modules
$(STRIPTOOL) -x -R .note -R .comment $*.o
ldconfig.o: ldconfig.c
- $(TARGET_CC) $(TARGET_CFLAGS) -DUCLIBC_PREFIX=\"$(PREFIX)\" \
+ $(TARGET_CC) $(TARGET_CFLAGS) -DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
-c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(TARGET_CC) $(TARGET_CFLAGS) -static readelf.c -o $@
$(STRIPTOOL) -x -R .note -R .comment $@
+ifeq ($(strip $(LIBRARY_CACHE)),)
+ldconfig:
+ echo "LIBRARY_CACHE disabled -- not building ldconfig"
+else
ldconfig: ldconfig.o readsoname.o
$(TARGET_CC) $(TARGET_CFLAGS) -static $^ -o $@
$(STRIPTOOL) -x -R .note -R .comment $@
+endif
ldd: ldd.c
- $(TARGET_CC) $(TARGET_CFLAGS) -DUCLIBC_PREFIX=\"$(PREFIX)\" \
+ $(TARGET_CC) $(TARGET_CFLAGS) -DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
-DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
-DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR); pwd)\" \
+ -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" \
-static ldd.c -o $@
$(STRIPTOOL) -x -R .note -R .comment $@
free(extpath);
}
- scan_dir(UCLIBC_PREFIX "/usr/lib");
- scan_dir(UCLIBC_PREFIX "/lib");
+ scan_dir(UCLIBC_TARGET_PREFIX "/usr/lib");
+ scan_dir(UCLIBC_TARGET_PREFIX "/lib");
}
if (!nocache)
if (!s || !strlen(s))
return 1;
+ /* We add libc.so.0 elsewhere */
+ if (strcmp(s, UCLIBC_LDSO)==0)
+ return 1;
+
for (cur = lib_list; cur; cur=cur->next) {
if(strcmp(cur->name, s)==0) {
/* Lib is already in the list */
/* Print the list */
+ got_em_all=0;
for (cur = lib_list; cur; cur=cur->next) {
+ got_em_all=1;
printf("\t%s => %s\n", cur->name, cur->path);
}
+ if (got_em_all==0)
+ printf("\tnot a dynamic executable\n");
return 0;
}
return '?'; /* erroneous-option marker */
}
-extern int getopt (int argc, char *const *argv, const char *optstring)
- __attribute__ ((__weak__));
-
-int getopt (int argc, char *const *argv, const char *optstring)
+int __attribute__ ((__weak__)) getopt (int argc, char *const *argv, const char *optstring)
{
static int sp = 1; /* position within argument */
register int osp; /* saved `sp' for param test */
TESTDIR=../
include $(TESTDIR)/Rules.mak
-TARGETS=ctype
+TARGETS=ctype ctype_run
all: $(TARGETS)
ctype: ctype.c ../testsuite.h Makefile $(TESTDIR)/Config $(TESTDIR)/Rules.mak $(CC)
$(CC) $(CFLAGS) -c $< -o $@.o
$(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LIBS)
$(STRIPTOOL) -x -R .note -R .comment $@
- ./$@
+
+ctype_run:
+ ./ctype
-@ echo " "
clean:
rm -f *.[oa] *~ core $(TARGETS)