fix ATM build with O=
PATCH 1/1 fix ATM build with O=
Chas,
I noticed today, while trying to build with the O= make option (which allows the objects to be in a different directory than the source), that ATM throws a warning. Turns out there is an explicit dependency on where include is. But, with O=, include only contains asm-offsets.s and include2 contains the appropriate files.
Here is a first attempt at a fix... Ideally, I could just check KBUILD_OUTPUT's value (which should be set with O= or the environmental variable KBUILD_OUTPUT). But I couldn't get that to work (can try again with some guidance, though). Instead, I just check if the source and object trees are different -- which I think can only be the case if you use O= or KBUILD_OUTPUT. I think the change from $(src) to $(obj) is also correct...
Description: Fix the build process for ATM when the make command-line option O= is used. The current code assumes the files will be availabled in the src directory (not the case with O=) and that include is the directory to look in (not the case with O=). I would prefer to use KBUILD_OUTPUT, but was unable to get it working.
drivers/atm/Makefile renamed from drivers/atm/Makefile.orig +5 -1
@@ -39,7 +39,11 @@ ifeq ($(CONFIG_ATM_FORE200E_PCA),y) fore_200e-objs += fore200e_pca_fw.o # guess the target endianess to choose the right PCA-200E firmware image ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y) - CONFIG_ATM_FORE200E_PCA_FW = $(shell if test -n "`$(CC) -E -dM $(src)/../../include/asm/byteorder.h | grep ' __LITTLE_ENDIAN '`"; then echo $(obj)/pca200e.bin; else echo $(obj)/pca200e_ecd.bin2; fi) + ifneq ($(srctree),$(objtree)) + CONFIG_ATM_FORE200E_PCA_FW = $(shell if test -n "`$(CC) -E -dM $(obj)/../../include2/asm/byteorder.h | grep ' __LITTLE_ENDIAN '`"; then echo $(obj)/pca200e.bin; else echo $(obj)/pca200e_ecd.bin2; fi) + else + CONFIG_ATM_FORE200E_PCA_FW = $(shell if test -n "`$(CC) -E -dM $(obj)/../../include/asm/byteorder.h | grep ' __LITTLE_ENDIAN '`"; then echo $(obj)/pca200e.bin; else echo $(obj)/pca200e_ecd.bin2; fi) + endif endif endif