123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- TOPDIR = ../../
- include $(TOPDIR)Rules.mak
- UCLIBC_DIR = $(shell (cd ../.. ; /bin/pwd))
- 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 ld-uClibc
- gcc-uClibc.h: $(TOPDIR)/Config
- @echo "/* this file was autogenerated by make */" > 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
- @echo "#define GCC_LIB " \"$(GCC_LIB)\" >> gcc-uClibc.h
- @echo "#define GCC_INCDIR " \"-I$(GCCINCDIR)/\" >> gcc-uClibc.h
- @echo "#define TARGET_ARCH " \"$(TARGET_ARCH)\" >> gcc-uClibc.h
- @echo "#define DYNAMIC_LINKER " \"$(DYNAMIC_LINKER)\" >> gcc-uClibc.h
- @echo "#define BUILD_DYNAMIC_LINKER " \"$(UCLIBC_DIR)/lib/$(UCLIBC_LDSO)\" >> gcc-uClibc.h
- gcc-uClibc: gcc-uClibc.h gcc-uClibc.c
- gcc -Wall -O2 -s gcc-uClibc.c -o $(TARGET_ARCH)-uclibc-gcc
- 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$(DEVEL_PREFIX)/lib -L$(DEVEL_PREFIX)/usr/lib "\
- "-L$(UCLIBC_DIR) \$$@" >> $(TARGET_ARCH)-uclibc-ld
- 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
- 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}; \
- done
- clean:
- rm -f gcc-uClibc.h *-uclibc-gcc *-uclibc-ld core
|