On Thu, Aug 18, 2011 at 02:03:43PM -0400, Arnaud Lacombe wrote:Can the second file just contain a "#include " of the 1st?Hi,It is to be able to reuse the same file source file in both the main
On Wed, Aug 17, 2011 at 11:44 PM, Nicolas Pitre<nico@xxxxxxxxxxx> wrote:On Fri, 12 Aug 2011, Arnaud Lacombe wrote:What is your use-case ? Is it re-use of code in a differentOn Fri, Aug 12, 2011 at 4:48 PM, Arnaud Lacombe<lacombar@xxxxxxxxx> wrote:Any progress on this?On Fri, Aug 12, 2011 at 3:00 PM, Stephen Boyd<sboyd@xxxxxxxxxxxxxx> wrote:I withdraw this proposal and will hack around this to find a properdiff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/MakefileYou should be able to avoid the extra copy altogether by doing something ala:
index 0c74a6f..937fd26 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma
targets := vmlinux vmlinux.lds \
piggy.$(suffix_y) piggy.$(suffix_y).o \
- font.o font.c head.o misc.o $(OBJS)
+ font.o font.c head.o misc.o lib1funcs.o lib1funcs.S $(OBJS)
# Make sure files are removed during clean
extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
@@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X
LDFLAGS_vmlinux += -T
# For __aeabi_uidivmod
-lib1funcs = $(obj)/lib1funcs.o
-
-$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
+$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S
$(call cmd,shipped)
$(obj)/lib1funcs.o: $(srctree)/arch/arm/lib/lib1funcs.S
$(call cmd,as_o_S)
note that I also remove the $(SRCARCH), as there is no other
`arch/*/lib/lib1funcs.S' than `arch/arm/lib/lib1funcs.S'
solution from within kbuild, and eventually come back on these uses
:-)
I have a patch doing multiple similar $(call cmd,shipped) at the moment
and this is far from looking nice.
subdirectory (use-case presented in this thread), or aliasing of the
same source under different object name in the same directory (as used
in the alpha tree) ?
kernel and the decompressor, sometimes rebuilding it with differing
options from the main kernel build.
As the two environments are entirely separate, it is not always
appropriate to clone the previously built object file.
Hence, we copy the source file and re-build it.
The alternative is that we could keep two copies of the same source
in two different locations, but that's just plain idiotic just to
satisfy some silly kbuild restriction.