]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - examples/Makefile
Fix MIPS build problem
[karo-tx-uboot.git] / examples / Makefile
index e6a3023913f9162a1c5c4738e72632f9ac5de97a..b9056dd16149394e13dbbf96f9fda0ec05107b9c 100644 (file)
@@ -26,9 +26,11 @@ LOAD_ADDR = 0x40000
 include $(TOPDIR)/config.mk
 
 SREC   = hello_world.srec
+BIN    = hello_world.bin
 
 ifeq ($(CPU),mips)
 SREC =
+BIN =
 endif
 
 # The following example is pretty 8xx specific...
@@ -50,7 +52,7 @@ LIBOBJS       = $(LIBAOBJS) $(LIBCOBJS)
 
 CPPFLAGS += -I..
 
-all:   .depend $(LIB) $(SREC)
+all:   .depend $(LIB) $(SREC) $(BIN)
 
 #########################################################################
 $(LIB): .depend $(LIBOBJS)
@@ -60,6 +62,9 @@ $(LIB): .depend $(LIBOBJS)
        $(LD) -g -Ttext $(LOAD_ADDR) -o $(<:.o=) -e $(<:.o=) $< $(LIB)
        $(OBJCOPY) -O srec $(<:.o=) $@
 
+%.bin: %.srec
+       $(OBJCOPY) -O binary $< $@ 2>/dev/null
+
 #########################################################################
 
 .depend:       Makefile $(OBJS:.o=.c) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S)