OSDN Git Service

Rework the config system. Better utilize the Kconfig language
[uclinux-h8/uClibc.git] / Makefile
index 24232ab..7fe64c8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ noconfig_targets := menuconfig config oldconfig randconfig \
 TOPDIR=./
 include Rules.mak
 
-DIRS = extra ldso libc libcrypt libresolv libnsl libutil libm libpthread
+DIRS = ldso libc libcrypt libresolv libnsl libutil libm libpthread
 ifeq ($(strip $(UCLIBC_HAS_GETTEXT_AWARENESS)),y)
        DIRS += libintl
 endif
@@ -118,13 +118,13 @@ include/bits/uClibc_config.h: .config
        fi;
        $(RM) -r include/bits
        $(INSTALL) -d include/bits
-       @./extra/config/conf -o extra/Configs/Config.$(TARGET_ARCH)
+       @./extra/config/conf -o extra/Configs/Config.in
 
 headers: include/bits/uClibc_config.h
 ifeq ($(strip $(UCLIBC_HAS_MMU)),y)
-       @./extra/scripts/fix_includes.sh -k $(KERNEL_SOURCE) -t $(TARGET_ARCH)
+       @set -x; ./extra/scripts/fix_includes.sh -k $(KERNEL_SOURCE) -t $(TARGET_ARCH)
 else
-       @./extra/scripts/fix_includes.sh -k $(KERNEL_SOURCE) -t $(TARGET_ARCH) -n
+       @set -x; ./extra/scripts/fix_includes.sh -k $(KERNEL_SOURCE) -t $(TARGET_ARCH) -n
 endif
        @if [ "$(TARGET_ARCH)" = "mipsel" ]; then \
            $(LN) -fs mips libc/sysdeps/linux/mipsel; \
@@ -159,6 +159,7 @@ endif
        else \
                mv -f include/bits/sysnum.h.new include/bits/sysnum.h; \
        fi
+       $(MAKE) -C libc/sysdeps/linux/common headers
        $(MAKE) -C libc/sysdeps/linux/$(TARGET_ARCH) headers
 
 # Command used to download source code
@@ -189,7 +190,6 @@ install: install_dev install_runtime install_utils finished2
 # Installs header files and development library links.
 install_dev:
        $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/lib
-       $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/usr/lib
        $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/include
        -$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)/lib/
        tar -chf - include | tar -xf - -C $(PREFIX)$(DEVEL_PREFIX);
@@ -244,7 +244,7 @@ ifneq ($(strip $(UCLIBC_HAS_GNU_GETOPT)),y)
        $(RM) $(PREFIX)$(DEVEL_PREFIX)/include/getopt.h
 endif
        -@for i in `find  $(PREFIX)$(DEVEL_PREFIX) -type d` ; do \
-           chmod -f 755 $$i; chmod -f 644 $$i/*.h; \
+           chmod 755 $$i; chmod 644 $$i/*.h > /dev/null 2>&1; \
        done;
        -find $(PREFIX)$(DEVEL_PREFIX) -name CVS | xargs $(RM) -r;
        -chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$$/\1.\2/'` $(PREFIX)$(DEVEL_PREFIX)
@@ -275,13 +275,6 @@ ifeq ($(strip $(HAVE_SHARED)),y)
        fi;
 endif
 
-install_toolchain:
-       $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/lib
-       $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/bin
-       $(INSTALL) -d $(PREFIX)$(DEVEL_TOOL_PREFIX)/bin
-       $(INSTALL) -d $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin
-       $(MAKE) -C extra/gcc-uClibc install
-
 ifeq ($(strip $(HAVE_SHARED)),y)
 utils: $(TOPDIR)ldso/util/ldd
        $(MAKE) -C ldso utils
@@ -291,25 +284,16 @@ endif
 
 install_utils: utils
 ifeq ($(strip $(HAVE_SHARED)),y)
-       $(INSTALL) -d $(PREFIX)$(DEVEL_TOOL_PREFIX)/bin;
+       $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)/sbin
+       $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)/usr/bin
        $(INSTALL) -m 755 ldso/util/ldd \
-               $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldd
-       $(LN) -fs $(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldd \
-               $(PREFIX)$(DEVEL_TOOL_PREFIX)/bin/ldd
+               $(PREFIX)$(RUNTIME_PREFIX)/usr/bin/ldd
+       $(INSTALL) -m 755 ldso/util/ldconfig \
+               $(PREFIX)$(RUNTIME_PREFIX)/sbin/ldconfig;
        # For now, don't bother with readelf since surely the host
        # system has binutils, or we couldn't have gotten this far...
        #$(INSTALL) -m 755 ldso/util/readelf \
-       #       $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-readelf
-       #$(LN) -fs $(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-readelf \
-       #       $(PREFIX)$(DEVEL_TOOL_PREFIX)/bin/readelf
-       @if [ -x ldso/util/ldconfig ] ; then \
-           set -x -e; \
-           $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)/etc; \
-           $(INSTALL) -m 755 ldso/util/ldconfig \
-                   $(PREFIX)$(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldconfig; \
-           $(LN) -fs $(SYSTEM_DEVEL_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ldconfig \
-                   $(PREFIX)$(DEVEL_TOOL_PREFIX)/bin/ldconfig; \
-       fi;
+       #       $(PREFIX)$(RUNTIME_PREFIX)/usr/bin/readelf
 endif
 
 # Installs run-time libraries and helper apps in preparation for
@@ -357,56 +341,46 @@ all: menuconfig
 
 # configuration
 # ---------------------------------------------------------------------------
-extra/config/conf: buildconf
-       -@if [ ! -f .config ] ; then \
-               cp extra/Configs/Config.$(TARGET_ARCH).default .config; \
-       fi
-
-buildconf:
+extra/config/conf:
        make -C extra/config conf
 
-extra/config/mconf: buildmconf
-       -@if [ ! -f .config ] ; then \
-               cp extra/Configs/Config.$(TARGET_ARCH).default .config; \
-       fi
-
-buildmconf:
+extra/config/mconf:
        make -C extra/config ncurses mconf
 
 menuconfig: extra/config/mconf
        $(RM) -r include/bits
        $(INSTALL) -d include/bits
-       @./extra/config/mconf extra/Configs/Config.$(TARGET_ARCH)
+       @./extra/config/mconf extra/Configs/Config.in
 
 config: extra/config/conf
        $(RM) -r include/bits
        $(INSTALL) -d include/bits
-       @./extra/config/conf extra/Configs/Config.$(TARGET_ARCH)
+       @./extra/config/conf extra/Configs/Config.in
 
 oldconfig: extra/config/conf
        $(RM) -r include/bits
        $(INSTALL) -d include/bits
-       @./extra/config/conf -o extra/Configs/Config.$(TARGET_ARCH)
+       @./extra/config/conf -o extra/Configs/Config.in
 
 randconfig: extra/config/conf
        $(RM) -r include/bits
        $(INSTALL) -d include/bits
-       @./extra/config/conf -r extra/Configs/Config.$(TARGET_ARCH)
+       @./extra/config/conf -r extra/Configs/Config.in
 
 allyesconfig: extra/config/conf
        $(RM) -r include/bits
        $(INSTALL) -d include/bits
-       @./extra/config/conf -y extra/Configs/Config.$(TARGET_ARCH)
+       @./extra/config/conf -y extra/Configs/Config.in
 
 allnoconfig: extra/config/conf
        $(RM) -r include/bits
        $(INSTALL) -d include/bits
-       @./extra/config/conf -n extra/Configs/Config.$(TARGET_ARCH)
+       @./extra/config/conf -n extra/Configs/Config.in
 
 defconfig: extra/config/conf
        $(RM) -r include/bits
        $(INSTALL) -d include/bits
-       @./extra/config/conf -d extra/Configs/Config.$(TARGET_ARCH)
+       @./extra/config/conf -d extra/Configs/Config.in
 
 
 clean:
@@ -418,7 +392,6 @@ clean:
        $(MAKE) -C libc/misc/wchar clean
        $(MAKE) -C libc/unistd clean
        $(MAKE) -C libc/sysdeps/linux/common clean
-       $(MAKE) -C extra/gcc-uClibc clean
        $(MAKE) -C extra/locale clean
        @set -e; \
        for i in `(cd $(TOPDIR)/libc/sysdeps/linux/common/sys; ls *.h)` ; do \