using make to convert images to thumbs

Michael ODonnell michael.odonnell at comcast.net
Sun Feb 26 12:35:01 EST 2006


Not that using "make" won't work, but I don't see the advantage
of the approaches being discussed versus a simple shell script.

make is cool because it allows you to describe arbitrarily
complex dependency relationships between various objects so
that it can analyze those relationships to determine whether
any actions are necessary to keep those relationships current.

But it sorta looks like the approach just suggested simply
launches an instance of bash for every target, with bash doing
ALL the work, so why not just express that same logic in a
simple shell script and dispense with make entirely?

If you're really committed to using make, you might consider
generating one giant rules file using a shell script that
sweeps through the directory(s) in question and then feed
those rules to make, maybe something like this:

   cd IMAGE_DIR
   for f in $( find . -type f )
   do
   	echo "$THUMB_DIR/$f:	$IMAGE_DIR/$f"	>> /tmp/makefile
   done
   make -f /tmp/makefile

...with maybe some kind of implicit rule along the lines
of the .c.o rule to control the necessary action(s).

Just a thought, FWIW, YMMV, IANAL, IMHO, etc...

 



More information about the gnhlug-discuss mailing list