Commit a4814a69d3bca6ee05f4bfc4c4e965e8fcd544e6

Authored by Stefano Babic
Committed by Wolfgang Denk
1 parent 99ffccbd3e

Makefile : fix generation of cpu related asm-offsets.h

commit 0edf8b5b2fa0d210ebc4d6da0fd1aceeb7e44e47 breaks
building on a different directory with the O= parameter.
The patch wil fix this issue, generating always asm-offsets.h before
the other targets.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Matthias Weisser <weisserm@arcor.de>
CC: Wolfgang Denk <wd@denx.de>

Showing 13 changed files with 25 additions and 27 deletions Side-by-side Diff

... ... @@ -464,7 +464,8 @@
464 464 # parallel sub-makes creating .depend files simultaneously.
465 465 depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \
466 466 $(obj)include/autoconf.mk \
467   - $(obj)include/generated/generic-asm-offsets.h
  467 + $(obj)include/generated/generic-asm-offsets.h \
  468 + $(obj)include/generated/asm-offsets.h
468 469 for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \
469 470 $(MAKE) -C $$dir _depend ; done
470 471  
... ... @@ -527,6 +528,21 @@
527 528 $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
528 529 -o $@ $(src)lib/asm-offsets.c -c -S
529 530  
  531 +$(obj)include/generated/asm-offsets.h: $(obj)include/autoconf.mk.dep \
  532 + $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
  533 + @echo Generating $@
  534 + tools/scripts/make-asm-offsets $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s $@
  535 +
  536 +$(obj)$(CPUDIR)/$(SOC)/asm-offsets.s: $(obj)include/autoconf.mk.dep
  537 + @mkdir -p $(obj)$(CPUDIR)/$(SOC)
  538 + if [ -f $(src)$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
  539 + $(CC) -DDO_DEPS_ONLY \
  540 + $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
  541 + -o $@ $(src)$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \
  542 + else \
  543 + touch $@; \
  544 + fi
  545 +
530 546 #########################################################################
531 547 else # !config.mk
532 548 all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
... ... @@ -939,6 +955,8 @@
939 955 $(obj)arch/blackfin/cpu/init.{lds,elf}
940 956 @rm -f $(obj)include/bmp_logo.h
941 957 @rm -f $(obj)lib/asm-offsets.s
  958 + @rm -f $(obj)include/generated/asm-offsets.h
  959 + @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
942 960 @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map}
943 961 @rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
944 962 @rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
arch/arm/cpu/arm1136/mx35/Makefile
... ... @@ -39,8 +39,6 @@
39 39 $(LIB): $(OBJS)
40 40 $(call cmd_link_o_target, $(OBJS))
41 41  
42   -$(OBJS) : $(TOPDIR)/include/asm/arch/asm-offsets.h
43   -
44 42  
45 43 #########################################################################
46 44  
arch/arm/cpu/arm926ejs/mb86r0x/Makefile
... ... @@ -37,8 +37,6 @@
37 37 $(LIB): $(OBJS)
38 38 $(call cmd_link_o_target, $(OBJS))
39 39  
40   -$(OBJS) : $(TOPDIR)/include/asm/arch/asm-offsets.h
41   -
42 40 #########################################################################
43 41  
44 42 # defines $(obj).depend target
arch/arm/cpu/arm926ejs/mx25/Makefile
... ... @@ -34,8 +34,6 @@
34 34 $(LIB): $(OBJS)
35 35 $(call cmd_link_o_target, $(OBJS))
36 36  
37   -$(OBJS) : $(TOPDIR)/include/asm/arch/asm-offsets.h
38   -
39 37 #########################################################################
40 38  
41 39 # defines $(obj).depend target
arch/arm/cpu/arm926ejs/mx27/Makefile
... ... @@ -34,8 +34,6 @@
34 34 $(LIB): $(OBJS)
35 35 $(call cmd_link_o_target, $(OBJS))
36 36  
37   -$(OBJS) : $(TOPDIR)/include/asm/arch/asm-offsets.h
38   -
39 37 #########################################################################
40 38  
41 39 # defines $(obj).depend target
arch/arm/cpu/armv7/mx5/Makefile
... ... @@ -45,7 +45,5 @@
45 45  
46 46 sinclude $(obj).depend
47 47  
48   -lowlevel_init.o : $(TOPDIR)/include/asm/arch/asm-offsets.h
49   -
50 48 #########################################################################
arch/arm/cpu/armv7/mx5/lowlevel_init.S
... ... @@ -21,7 +21,7 @@
21 21  
22 22 #include <config.h>
23 23 #include <asm/arch/imx-regs.h>
24   -#include <asm/arch/asm-offsets.h>
  24 +#include <generated/asm-offsets.h>
25 25  
26 26 /*
27 27 * L2CC Cache setup/invalidation/disable
arch/arm/include/asm/arch-mx25/macro.h
... ... @@ -31,7 +31,7 @@
31 31 #ifdef __ASSEMBLY__
32 32  
33 33 #include <asm/arch/imx-regs.h>
34   -#include <asm/arch/asm-offsets.h>
  34 +#include <generated/asm-offsets.h>
35 35  
36 36 .macro init_aips
37 37 write32 IMX_AIPS1_BASE + AIPS_MPR_0_7, 0x77777777
board/freescale/mx35pdk/lowlevel_init.S
... ... @@ -21,7 +21,7 @@
21 21  
22 22 #include <config.h>
23 23 #include <asm/arch/imx-regs.h>
24   -#include <asm/arch/asm-offsets.h>
  24 +#include <generated/asm-offsets.h>
25 25 #include "mx35pdk.h"
26 26  
27 27 /*
board/logicpd/imx27lite/lowlevel_init.S
... ... @@ -26,7 +26,7 @@
26 26 #include <version.h>
27 27 #include <asm/macro.h>
28 28 #include <asm/arch/imx-regs.h>
29   -#include <asm/arch/asm-offsets.h>
  29 +#include <generated/asm-offsets.h>
30 30  
31 31 SOC_ESDCTL_BASE_W: .word IMX_ESD_BASE
32 32 SOC_SI_ID_REG_W: .word IMX_SYSTEM_CTL_BASE
board/syteco/jadecpu/lowlevel_init.S
... ... @@ -30,7 +30,7 @@
30 30 #include <version.h>
31 31 #include <asm/macro.h>
32 32 #include <asm/arch/mb86r0x.h>
33   -#include <asm/arch/asm-offsets.h>
  33 +#include <generated/asm-offsets.h>
34 34  
35 35 /* Set up the platform, once the cpu has been initialized */
36 36 .globl lowlevel_init
board/syteco/zmx25/lowlevel_init.S
... ... @@ -27,7 +27,7 @@
27 27 #include <asm/macro.h>
28 28 #include <asm/arch/macro.h>
29 29 #include <asm/arch/imx-regs.h>
30   -#include <asm/arch/asm-offsets.h>
  30 +#include <generated/asm-offsets.h>
31 31  
32 32 /*
33 33 * clocks
... ... @@ -42,15 +42,5 @@
42 42 $(NOPEDOBJS): $(obj)%.o: %.c
43 43 $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR)) -o $@ $< -c
44 44  
45   -$(TOPDIR)/include/asm/arch/asm-offsets.h: $(TOPDIR)/include/autoconf.mk.dep \
46   - $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.s
47   - @echo Generating $@
48   - $(TOPDIR)/tools/scripts/make-asm-offsets $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.s $@
49   -
50   -$(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.s: $(TOPDIR)/include/autoconf.mk.dep \
51   - $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.c
52   - $(CC) -DDO_DEPS_ONLY \
53   - $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
54   - -o $@ $(TOPDIR)/$(CPUDIR)/$(SOC)/asm-offsets.c -c -S
55 45 #########################################################################