gah. Gnuish for no good reason.
> MODLIB=$(INSTALL_MOD_PATH)/lib/modules/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL);\
That should be a little more complicated. MODLIB is the target, and we want to
make that configurable. You've invented part of the name, and that may not
be what the user wants. So you should allow him to override it by defining
MODLIB explicitly, using make install_modules MODLIB=foo, or MODLIB=foo make
modules
if [ -n "$(MODLIB)" ]; then MODLIB=${MODLIB-"$(MODLIB)"}; else
MODLIB=$(INSTALL_MOD_PATH)/lib/modules/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)
fi
or something like that.
> ALLMODS=`ls *.o`; \
People already commented that that should be something like
ALLMODS="`echo *.o`"
The double quotes are important. This command will fail otherwise.
> echo "Installing modules under $$MODLIB"; \
> for d in `ls *_MODULES`; do \
Same kind of improvement, this time without double quotes or echo
for d in *_MODULES; do
> nd=`echo $$d | sed 's/_MODULES//' | tr A-Z a-z`; \
That's the dirname? Yes.
> echo -n " $$nd"; \
> mkdir -p $$MODLIB/$$nd; \
I'm retarded. I don't know what -p does for mkdir!
> for m in `cat $$d`; do \
> ALLMODS=`echo $$ALLMODS | sed "s/$$m//"`; \
?? Why are you changing ALLMODS? Oh. I see, you're subtracting the modules
listed in $d. BTW there's two syntactic mistakes here. It should be
ALLMODS="`echo $$ALLMODS | sed -e 's/'$$m'//'`"; \
(and I'm not even thinking about the makefile quoting!) Well .. I prefer
doing that without sed. At least without calling sed each time! But it's
OK. I offered a shell function that did the subtraction last time.
> cp $$m $$MODLIB/$$nd; \
You place the module in the target and subtract from ALLMODS at the same
time. OK.
> done; \
> done; \
> if [ -n "$$ALLMODS" ]; then \
> echo -n " misc"; \
You're missing a mkdir -p $$MODLIB/misc here, aren't you?
> for m in $$ALLMODS; do \
> cp $$m $$MODLIB/misc; \
> done; \
> fi; \
> echo) 2>/dev/null
>
>
> G'day!
A well known signoff.
Does anybody understand VPATH? I'm trying to use it, with no luck at all. It
doesn't seem to be invoked in implicit (.c.o style) rules.
Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/