Skip to contentSkip to conversation

Fixed examples/Makefile to work with gmake 3.81

PATCH New John Rigby 1 participant 1 message Oct 4, 2006

lore
Share & tools
lore

John Rigby

author
#0 lore raw

PATCH 1/1 Fixed examples/Makefile to work with gmake 3.81

Building u-boot with GNU make version 3.81 or greater gets an error when making the examples directory.

GNU make version 3.81 and later seam to be sensitive to order of prereqs. Not sure if this is a bug or a feature but this patch fixes the problem.

Now create the BIN target and a new DOTBIN target from the SREC target. Put BIN before SREC and DOTBIN in the list of dependencies for the all target.

CHANGELOG:

* Fix examples/Makefile to work with GNU Make version 3.81

---
 examples/Makefile |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
examples/Makefile +4 -11
index d7cd843..59b2237 100644
@@ -1,4 +1,3 @@
-#
 # (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd at denx.de.
 #
@@ -60,50 +59,41 @@ endif
 include $(TOPDIR)/config.mk
 
 SREC	= hello_world.srec
-BIN	= hello_world.bin hello_world
 
 ifeq ($(CPU),mpc8xx)
 SREC	= test_burst.srec
-BIN	= test_burst.bin test_burst
 endif
 
 ifeq ($(ARCH),i386)
 SREC   += 82559_eeprom.srec
-BIN    += 82559_eeprom.bin 82559_eeprom
 endif
 
 ifeq ($(ARCH),ppc)
 SREC   += sched.srec
-BIN    += sched.bin sched
 endif
 
 ifeq ($(ARCH),blackfin)
 SREC	+= smc91111_eeprom.srec
-BIN 	+= smc91111_eeprom.bin smc91111_eeprom
 endif
 
 # The following example is pretty 8xx specific...
 ifeq ($(CPU),mpc8xx)
 SREC   += timer.srec
-BIN    += timer.bin timer
 endif
 
 # The following example is 8260 specific...
 ifeq ($(CPU),mpc8260)
 SREC   += mem_to_mem_idma2intr.srec
-BIN    += mem_to_mem_idma2intr.bin mem_to_mem_idma2intr
 endif
 
 # Demo for 52xx IRQs
 ifeq ($(CPU),mpc5xxx)
 SREC   += interrupt.srec
-BIN    += interrupt.bin interrupt
 endif
 
 # Utility for resetting i82559 EEPROM
 ifeq ($(BOARD),oxc)
 SREC   += eepro100_eeprom.srec
-BIN    += eepro100_eeprom.bin eepro100_eeprom
 endif
 
 ifeq ($(BIG_ENDIAN),y)
@@ -111,6 +101,8 @@ EX_LDFLAGS += -EB
 endif
 
 COBJS	:= $(SREC:.srec=.o)
+BIN	:= $(SREC:.srec=)
+DOTBIN	:= $(SREC:.srec=.bin)
 
 LIB	= $(obj)libstubs.a
 LIBAOBJS=
@@ -128,13 +120,14 @@ SRCS	:= $(COBJS:.o=.c) $(LIBCOBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 BIN	:= $(addprefix $(obj),$(BIN))
 SREC	:= $(addprefix $(obj),$(SREC))
+DOTBIN	:= $(addprefix $(obj),$(DOTBIN))
 
 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
 clibdir := $(shell dirname `$(CC) $(CFLAGS) -print-file-name=libc.a`)
 
 CPPFLAGS += -I..
 
-all:	$(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN)
+all:	$(obj).depend $(OBJS) $(LIB) $(BIN) $(SREC) $(DOTBIN)
 
 #########################################################################
 $(LIB):	$(obj).depend $(LIBOBJS)

-