lkml.org 
[lkml]   [1998]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: The /tmp and modules_install saga
Date
"A month of sundays ago Nicholas J. Leon wrote:"
>
> How about the following (please note that using my _exact_ implementation
> would require fixing nls to put its modules into FS_MODULES and
> NET_MISC_MODULES be folded into NET_MODULES -- unless we like having an
> modules/nls and modules/net_misc directory).
>
> modules_install:
> @(cd modules; \

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/

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:2.101 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site