summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-04 01:30:26 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-04 01:30:26 +0000
commit84a9d87e2d6b237ff10990338ce76f050e1c3e2a (patch)
tree1b7bd195305c168149b6e1977bac2e09174346bb
parent0f54aa4d170ec57806c66720b5055a8bffdd47ce (diff)
This is kindof neat. With this update, you can now simply set your
PATH and things will now simply compile vs uClibc. Or you can add INSTALL_DIR/usr/bin to your path and use it as a cross compiler. Either way, it works now. -Erik
-rw-r--r--Makefile14
-rw-r--r--extra/gcc-uClibc/.cvsignore12
-rw-r--r--extra/gcc-uClibc/Makefile47
3 files changed, 43 insertions, 30 deletions
diff --git a/Makefile b/Makefile
index 10eb8119b..667c961d8 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ $(LIBNAME): subdirs
shared: $(LIBNAME)
@rm -rf tmp
@mkdir tmp
- @make -C ld.so-1/d-link
+ @$(MAKE) -C ld.so-1/d-link
@(cd tmp; CC=$(CC) /bin/sh ../extra/scripts/get-needed-libgcc-objects.sh)
if [ -s ./tmp/libgcc-need.a ] ; then \
$(CC) -g $(LDFLAGS) -shared -o $(SHARED_FULLNAME) \
@@ -57,8 +57,8 @@ shared: $(LIBNAME)
@rm -rf tmp
ln -sf $(SHARED_FULLNAME) $(SHARED_MAJORNAME)
ln -sf $(SHARED_MAJORNAME) libc.so
- @make -C crypt shared
- @make -C ld.so-1
+ @$(MAKE) -C crypt shared
+ @$(MAKE) -C ld.so-1
done: $(LIBNAME) $(DO_SHARED)
@echo
@@ -97,7 +97,7 @@ tags:
clean: subdirs_clean halfclean
@rm -rf tmp
rm -f include/asm include/linux include/bits
- @make -C ld.so-1 clean
+ @$(MAKE) -C ld.so-1 clean
subdirs: $(patsubst %, _dir_%, $(DIRS))
subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS) test)
@@ -112,7 +112,7 @@ install: install_runtime install_dev install_ldso
# Installs shared library
install_runtime:
- @make -C crypt install
+ @$(MAKE) -C crypt install
ifneq ($(DO_SHARED),)
install -d $(INSTALL_DIR)/lib
rm -rf $(INSTALL_DIR)/lib/$(SHARED_FULLNAME)
@@ -148,12 +148,12 @@ install_dev:
install -m 644 $(LIBNAME) $(INSTALL_DIR)/lib/
@if [ -f crt0.o ] ; then install -m 644 crt0.o $(INSTALL_DIR)/lib/; fi
install -d $(INSTALL_DIR)/bin
- @if [ -f extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc ] ; then install -m 755 extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc $(INSTALL_DIR)/bin/ ; fi
+ $(MAKE) -C extra/gcc-uClibc install
install_ldso:
ifeq ($(strip $(DO_SHARED)),shared)
- @make -C ld.so-1 install
+ @$(MAKE) -C ld.so-1 install
$(TOPDIR)ld.so-1/util/ldconfig
else
@echo "Skipping shared library support"
diff --git a/extra/gcc-uClibc/.cvsignore b/extra/gcc-uClibc/.cvsignore
index 6c98be1b9..0232baac5 100644
--- a/extra/gcc-uClibc/.cvsignore
+++ b/extra/gcc-uClibc/.cvsignore
@@ -1,7 +1,7 @@
gcc-uClibc.h
-i386-uclibc-gcc
-m68k-uclibc-gcc
-arm-uclibc-gcc
-sh-uclibc-gcc
-powerpc-uclibc-gcc
-sparc--uclibc-gcc
+i386-uclibc-*
+m68k-uclibc-*
+arm-uclibc-*
+sh-uclibc-*
+powerpc-uclibc-*
+sparc-uclibc-*
diff --git a/extra/gcc-uClibc/Makefile b/extra/gcc-uClibc/Makefile
index 2e5793979..75c823086 100644
--- a/extra/gcc-uClibc/Makefile
+++ b/extra/gcc-uClibc/Makefile
@@ -5,14 +5,15 @@ include $(TOPDIR)Rules.mak
DYNAMIC_LINKER = $(INSTALL_DIR)/lib/ld-linux-uclibc.so.$(MAJOR_VERSION)
UCLIBC_DIR = $(shell (cd ../.. ; /bin/pwd))
-GCC_BIN = $(CC)
+GCC_BIN = $(shell which $(CC))
+LD_BIN = $(shell which $(LD))
GCC_LIB = $(shell $(CC) -print-libgcc-file-name )
#GCCINCDIR inherited from Rules.mak
-all: gcc-uClibc
+all: gcc-uClibc ld-uClibc
gcc-uClibc.h: clean
- @echo "/* this file is created by make */" > gcc-uClibc.h
+ @echo "/* this file was autogenerated by make */" > gcc-uClibc.h
@echo "#define UCLIBC_INSTALL_DIR " \"$(INSTALL_DIR)/\" >> gcc-uClibc.h
@echo "#define UCLIBC_BUILD_DIR " \"$(UCLIBC_DIR)/\" >> gcc-uClibc.h
@echo "#define GCC_BIN " \"$(GCC_BIN)\" >> gcc-uClibc.h
@@ -24,22 +25,34 @@ gcc-uClibc.h: clean
gcc-uClibc: gcc-uClibc.h gcc-uClibc.c
gcc -Wall -O2 -s gcc-uClibc.c -o $(TARGET_ARCH)-uclibc-gcc
-install:
- @if [ -f $(TARGET_ARCH)-uclibc-gcc ] ; then \
- mkdir -p $(INSTALL_DIR)/usr/bin ; \
+ld-uClibc:
+ @echo "#!/bin/sh" > $(TARGET_ARCH)-uclibc-ld
+ @echo "# This file was autogenerated by make" >> $(TARGET_ARCH)-uclibc-ld
+ @echo "$(LD_BIN) -L- -L $(INSTALL_DIR)/lib -L$(UCLIBC_DIR) \$$@" >> $(TARGET_ARCH)-uclibc-ld
+ chmod a+x $(TARGET_ARCH)-uclibc-ld
+
+install: all
+ install -d $(INSTALL_DIR)/bin;
+ install -d $(INSTALL_DIR)/usr/bin;
+ if [ -x ./$(TARGET_ARCH)-uclibc-gcc ] ; then \
install -m 755 $(TARGET_ARCH)-uclibc-gcc $(INSTALL_DIR)/usr/bin/ ; \
- fi
- $(shell (for app in addr2line ar as gasp ld nm objcopy objdump \
- ranlib size strings strip; do \
- ln -fs `which $(CROSS)$${app}` $(INSTALL_DIR)/bin/$${app}; \
- done)\
- )
- $(shell (for app in cc1 cc1plus; do \
- ln -fs $(CC1DIR)$${app} $(INSTALL_DIR)/bin/$${app}; \
- done)\
- )
+ install -m 755 $(TARGET_ARCH)-uclibc-ld $(INSTALL_DIR)/usr/bin/ ; \
+ ln -fs ../usr/bin/$(TARGET_ARCH)-uclibc-gcc $(INSTALL_DIR)/bin/cc; \
+ ln -fs ../usr/bin/$(TARGET_ARCH)-uclibc-gcc $(INSTALL_DIR)/bin/gcc; \
+ ln -fs ../usr/bin/$(TARGET_ARCH)-uclibc-ld $(INSTALL_DIR)/bin/ld; \
+ ln -fs $(TARGET_ARCH)-uclibc-gcc $(INSTALL_DIR)/usr/bin/$(TARGET_ARCH)-uclibc-cc; \
+ fi;
+ for app in addr2line ar as cpp gasp nm objcopy \
+ objdump ranlib readelf size strings strip; do \
+ ln -fs `which $(CROSS)$${app}` $(INSTALL_DIR)/bin/$${app}; \
+ done;
+ for app in addr2line ar as cpp gasp nm objcopy \
+ objdump ranlib readelf size strings strip; do \
+ ln -fs `which $(CROSS)$${app}` $(INSTALL_DIR)/usr/bin/$(TARGET_ARCH)-uclibc-$${app}; \
+ done;
+
clean:
- rm -f gcc-uClibc.h *-uclibc-gcc core
+ rm -f gcc-uClibc.h *-uclibc-gcc *-uclibc-ld core