Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #
  2. # (C) Copyright 2000
  3. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. #
  5. # See file CREDITS for list of people who contributed to this
  6. # project.
  7. #
  8. # This program is free software; you can redistribute it and/or
  9. # modify it under the terms of the GNU General Public License as
  10. # published by the Free Software Foundation; either version 2 of
  11. # the License, or (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. # MA 02111-1307 USA
  22. #
  23. LOAD_ADDR = 0x40000
  24. include $(TOPDIR)/config.mk
  25. SREC = hello_world.srec
  26. BIN = hello_world.bin
  27. ifeq ($(ARCH),ppc)
  28. SREC += sched.srec
  29. BIN += sched.bin
  30. endif
  31. ifeq ($(ARCH),mips)
  32. SREC =
  33. BIN =
  34. endif
  35. # The following example is pretty 8xx specific...
  36. ifeq ($(CPU),mpc8xx)
  37. SREC += timer.srec
  38. BIN += timer.bin
  39. endif
  40. # The following example is 8260 specific...
  41. ifeq ($(CPU),mpc8260)
  42. SREC += mem_to_mem_idma2intr.srec
  43. BIN += mem_to_mem_idma2intr.bin
  44. endif
  45. # Utility for resetting i82559 EEPROM
  46. ifeq ($(BOARD),oxc)
  47. SREC += eepro100_eeprom.srec
  48. endif
  49. OBJS = $(SREC:.srec=.o)
  50. LIB = libsyscall.a
  51. LIBAOBJS= syscall.o
  52. ifeq ($(ARCH),ppc)
  53. LIBAOBJS+= $(ARCH)_longjmp.o $(ARCH)_setjmp.o
  54. endif
  55. LIBCOBJS=
  56. LIBOBJS = $(LIBAOBJS) $(LIBCOBJS)
  57. CPPFLAGS += -I..
  58. all: .depend $(LIB) $(SREC) $(BIN)
  59. #########################################################################
  60. $(LIB): .depend $(LIBOBJS)
  61. $(AR) crv $@ $(LIBOBJS)
  62. %.srec: %.o $(LIB)
  63. $(LD) -g -Ttext $(LOAD_ADDR) -o $(<:.o=) -e $(<:.o=) $< $(LIB)
  64. $(OBJCOPY) -O srec $(<:.o=) $@
  65. %.bin: %.srec
  66. $(OBJCOPY) -O binary $< $@ 2>/dev/null
  67. #########################################################################
  68. .depend: Makefile $(OBJS:.o=.c) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S)
  69. $(CC) -M $(CFLAGS) $(OBJS:.o=.c) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S) > $@
  70. sinclude .depend
  71. #########################################################################