[uClibc]Re: Rules.make $(CROSS) change

Miles Bader miles at lsi.nec.co.jp
Fri Nov 8 06:03:41 UTC 2002


Erik Andersen <andersen at codepoet.org> writes:
> > As I mentioned in an earlier message, it's something of a regression
> > that you have to specify _anything_ on the make command line, and having
> > to specify CROSS is especially ugly -- it's not a `nice' value (it feels
> > like an internal implementation artifact).
> 
> I agree.  But I don't really have a good way to work around it.

How about something like this (I've only changed the `oldconfig:'
target, but the rest would be the same):


--- start diff ---

--- Makefile.~1.189.~	2002-11-08 09:50:25.000000000 +0900
+++ Makefile	2002-11-08 14:57:18.000000000 +0900
@@ -29,7 +29,11 @@
 noconfig_targets := menuconfig config oldconfig randconfig \
 	defconfig allyesconfig allnoconfig clean distclean \
 	release tags TAGS
+
 TOPDIR=./
+
+-include .config.target
+
 include Rules.mak
 
 DIRS = extra ldso libc libcrypt libresolv libutil libm libpthread
@@ -308,6 +312,8 @@ oldconfig: extra/config/conf
 	rm -rf include/bits
 	mkdir -p include/bits
 	@./extra/config/conf -o extra/Configs/Config.$(TARGET_ARCH)
+	@echo "TARGET_ARCH=$(TARGET_ARCH)" > .config.target
+	@[ x"$(CROSS)" = x ] || echo "CROSS=$(CROSS)" >> .config.target
 
 randconfig: extra/config/conf
 	rm -rf include/bits

---  end diff  ---


The above doesn't handle a `configured' value for $(CROSS), but it
could be made to do so, e.g., instead of the above shell commands,
change them to be something like `@$(MAKE) -f extra/config/upd-conf-targ.mk',
where `extra/config/upd-conf-targ.mk' just contains:

include .config
.config.target:
	@echo "TARGET_ARCH=$(TARGET_ARCH)" > .config.target
	@[ x"$(CROSS)" = x ] || echo "CROSS=$(CROSS)" >> .config.target


> The linux kernel requires you specify CROSS (either by editing
> the top level Makefile, or by specifying it on the command line).
> We effective now require the same sortof thing.

It sucks with the kernel too (I presume it's not been fixed because 99%
of the people out there don't cross compile the kernel -- but think 99%
of the people using uClibc _do_ cross-compile :-).

Thanks,

-Miles
-- 
o The existentialist, not having a pillow, goes everywhere with the book by
  Sullivan, _I am going to spit on your graves_.



More information about the uClibc mailing list