SH Port - Makefile
Hi Lethal.
Browsing the changes for SH - which mostly look really good - a few questions popped up:
Quoted 1 line
From
arch/sh/Makefile:
# We don't necessarily agree with the top-level Makefile with regards to what
# does and does not qualify as a noconfig_targets rule. In this case, we're # still dependant on .config settings in order for core-y (machdir-y in # particular) to resolve the proper directory. So we just manually include it # if it hasn't been already.. # ifndef include_config -include .config endif
Could you elaborate a bit more about this.
I cannot see why core-y is really needed for any noconfig_targets. Note that "make clean" do not need to descend in all directories to delete .o files, a find is used for that.
target_links
Will it be possible for SH to implement the scheme used for i386 instead. We have one symlink today, and I like to keep it down on that level.
arch/sh/tools
Something not yet merged?
BOOTIMAGE
No need to define a variable and then only use it once.
Sam
Quoted 11 lines · Sam Ravnborg
From
arch/sh/Makefile:
# We don't necessarily agree with the top-levelMakefilewith regards to what# does and does not qualify as a noconfig_targets rule. In this case, we're # still dependant on .config settings in order for core-y (machdir-y in # particular) to resolve the proper directory. So we just manually include it # if it hasn't been already.. # ifndef include_config -include .config endif
Quoted 5 lines
Could you elaborate a bit more about this.
I cannot see why core-y is really needed for anynoconfig_targets. Note that "make clean" do not need to descend in all directories to delete .o files, a find is used for that.
Okay, the main reason why I needed to do this was so that a make clean would get the proper directory path. The problem was that machdir-y wasn't getting the board name correctly since at make clean time the CONFIG_SH_xxx names weren't being resolved.
Thus, in the case of:
core-y += arch/sh/boards/$(machdir-y)/
make clean was only getting arch/sh/boards/, which doesn't have a Makefile in it, which resulted in an error when doing the clean.
I'll admit I haven't spent much time investigating this further and just used the .config include as a quick workaround, so if there's a better solution for this, I'll gladly adopt it.
Quoted 5 lines
target_links
Will it be possible for SH to implement the scheme used for i386 instead. We have one symlink today, and I like to keep it down on that level.
I haven't looked at the i386 code for this yet, I'll look into this.
Quoted 3 lines
arch/sh/tools
Something not yet merged?
Not merged yet, will be shortly. I just wanted to get the board stuff out of the way.
Quoted 3 lines
BOOTIMAGE
No need to define a variable and then only use it once.
Thanks for catching this, I'll clean that up.
Quoted 4 lines · Paul Mundt
Okay, the main reason why I needed to do this was so that a make clean would get the proper directory path. The problem was that machdir-y wasn't getting the board name correctly since at make clean time the
CONFIG_SH_xxxnames weren't being resolved.
The following should do the trick.
I also rearranged a few things.
Whith respect to removing the framepointer from CFLAGS. There is already a CONFIG option for that CONFIG_FRAME_POINTER. It would be much cleaner using that one in combination with CONFIG_SH_KGDB
Sam
===== arch/sh/Makefile 1.16 vs edited =====
arch/sh/Makefile +22 -35
@@ -14,17 +14,6 @@ # this architecture # -# -# We don't necessarily agree with the top-level Makefile with regards to what -# does and does not qualify as a noconfig_targets rule. In this case, we're -# still dependant on .config settings in order for core-y (machdir-y in -# particular) to resolve the proper directory. So we just manually include it -# if it hasn't been already.. -# -ifndef include_config --include .config -endif - cpu-y := -mb cpu-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml
@@ -66,24 +55,24 @@ core-y += arch/sh/kernel/ arch/sh/mm/ # Boards -machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x -machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751 -machdir-$(CONFIG_SH_STB1_HARP) := harp -machdir-$(CONFIG_SH_STB1_OVERDRIVE) := overdrive -machdir-$(CONFIG_SH_HP620) := hp6xx/hp620 -machdir-$(CONFIG_SH_HP680) := hp6xx/hp680 -machdir-$(CONFIG_SH_HP690) := hp6xx/hp690 -machdir-$(CONFIG_SH_CQREEK) := cqreek -machdir-$(CONFIG_SH_DMIDA) := dmida -machdir-$(CONFIG_SH_EC3104) := ec3104 -machdir-$(CONFIG_SH_SATURN) := saturn -machdir-$(CONFIG_SH_DREAMCAST) := dreamcast -machdir-$(CONFIG_SH_CAT68701) := cat68701 -machdir-$(CONFIG_SH_BIGSUR) := bigsur -machdir-$(CONFIG_SH_SH2000) := sh2000 -machdir-$(CONFIG_SH_ADX) := adx -machdir-$(CONFIG_SH_MPC1211) := mpc1211 -machdir-$(CONFIG_SH_UNKNOWN) := unknown +machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x/ +machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751/ +machdir-$(CONFIG_SH_STB1_HARP) := harp/ +machdir-$(CONFIG_SH_STB1_OVERDRIVE) := overdrive/ +machdir-$(CONFIG_SH_HP620) := hp6xx/hp620/ +machdir-$(CONFIG_SH_HP680) := hp6xx/hp680/ +machdir-$(CONFIG_SH_HP690) := hp6xx/hp690/ +machdir-$(CONFIG_SH_CQREEK) := cqreek/ +machdir-$(CONFIG_SH_DMIDA) := dmida/ +machdir-$(CONFIG_SH_EC3104) := ec3104/ +machdir-$(CONFIG_SH_SATURN) := saturn/ +machdir-$(CONFIG_SH_DREAMCAST) := dreamcast/ +machdir-$(CONFIG_SH_CAT68701) := cat68701/ +machdir-$(CONFIG_SH_BIGSUR) := bigsur/ +machdir-$(CONFIG_SH_SH2000) := sh2000/ +machdir-$(CONFIG_SH_ADX) := adx/ +machdir-$(CONFIG_SH_MPC1211) := mpc1211/ +machdir-$(CONFIG_SH_UNKNOWN) := unknown/ incdir-y := $(machdir-y)
@@ -91,7 +80,7 @@ incdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se7751 incdir-$(CONFIG_SH_HP600) := hp6xx -core-y += arch/sh/boards/$(machdir-y)/ +core-y += arch/sh/boards/$(machdir-y) # Companion chips core-$(CONFIG_HD64461) += arch/sh/cchips/hd6446x/hd64461/
@@ -103,7 +92,6 @@ libs-y += arch/sh/lib/ $(LIBGCC) -boot := arch/sh/boot AFLAGS_vmlinux.lds.o := -traditional
@@ -119,11 +107,10 @@ $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h -BOOTIMAGE=arch/sh/boot/zImage -zImage: vmlinux - $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE) +boot := arch/sh/boot -compressed: zImage +zImage: vmlinux + $(Q)$(MAKE) $(build)=$(boot) arch/sh/boot/zImage archclean: $(Q)$(MAKE) $(clean)=$(boot)
Quoted 9 lines · Sam Ravnborg
Quoted 4 lines · Paul Mundt
Okay, the main reason why I needed to do this was so that a make clean would get the proper directory path. The problem was that machdir-y wasn't getting the board name correctly since at make clean time the
CONFIG_SH_xxxnames weren't being resolved.The following should do the trick.
I also rearranged a few things.
Unfortunately this still yields the same problem as before when it comes to resolving machdir-y properly at make clean time:
[lethal@unusual linux-sh-2.5.71]$ make ARCH=sh CROSS_COMPILE=sh-uclibc- clean scripts/Makefile.clean:10: arch/sh/boards/Makefile: No such file or directory make[1]: *** No rule to make target `arch/sh/boards/Makefile'. Stop.
make: *** [_clean_arch/sh/boards] Error 2
At make clean time, .config isn't available properly due to it not being included since its a noconfig_targets target, which causes the above problem. This will also happen for the rest of the noconfig_targets, hence the manual inclusion of .config to fixup the path lookup issue.
Any other suggestions?
Quoted 5 lines
Whith respect to removing the framepointer from CFLAGS. There is already a CONFIG option for that
CONFIG_FRAME_POINTER. It would be much cleaner using that one in combination withCONFIG_SH_KGDB
Agreed, I'll add this in. Thanks.