Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. TOPDIR = ../../
  2. include $(TOPDIR)Rules.mak
  3. # NOTE: This may need to be modified for your system
  4. DYNAMIC_LINKER = /usr/$(TARGET_ARCH)-linux-uclibc/lib/ld-linux-uclibc.so.$(MAJOR_VERSION)
  5. UCLIBC_DIR = $(shell (cd ../.. ; /bin/pwd))
  6. GCC_BIN = $(CC)
  7. GCC_LIB = $(shell $(CC) -print-libgcc-file-name )
  8. #GCCINCDIR inherited from Rules.mak
  9. all: gcc-uClibc
  10. gcc-uClibc.h: clean
  11. @echo "/* this file is created by make */" > gcc-uClibc.h
  12. @echo "#define UCLIBC_INSTALL_DIR " \"$(INSTALL_DIR)/\" >> gcc-uClibc.h
  13. @echo "#define UCLIBC_BUILD_DIR " \"$(UCLIBC_DIR)/\" >> gcc-uClibc.h
  14. @echo "#define GCC_BIN " \"$(GCC_BIN)\" >> gcc-uClibc.h
  15. @echo "#define GCC_LIB " \"$(GCC_LIB)\" >> gcc-uClibc.h
  16. @echo "#define GCC_INCDIR " \"-I$(GCCINCDIR)/\" >> gcc-uClibc.h
  17. @echo "#define TARGET_ARCH " \"$(TARGET_ARCH)\" >> gcc-uClibc.h
  18. @echo "#define DYNAMIC_LINKER " \"$(DYNAMIC_LINKER)\" >> gcc-uClibc.h
  19. gcc-uClibc: gcc-uClibc.h gcc-uClibc.c
  20. gcc -Wall -O2 -s gcc-uClibc.c -o $(TARGET_ARCH)-uclibc-gcc
  21. install:
  22. @if [ -f $(TARGET_ARCH)-uclibc-gcc ] ; then \
  23. install -m 755 $(TARGET_ARCH)-uclibc-gcc $(INSTALL_DIR)/bin/ ; \
  24. fi
  25. $(shell (for app in addr2line ar as gasp ld nm objcopy objdump ranlib size strings strip; do \
  26. ln -fs `which $(CROSS)$${app}` $(INSTALL_DIR)/bin/$${app}; \
  27. done)\
  28. )
  29. $(shell (for app in cc1 cc1plus; do \
  30. ln -fs $(CC1DIR)$${app} $(INSTALL_DIR)/bin/$${app}; \
  31. done)\
  32. )
  33. clean:
  34. rm -f gcc-uClibc.h *-uclibc-gcc core