[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT -- gentle makefile assistance?



On Sun, Jan 26, 2003 at 04:27:15PM +0000, Karl E. Jorgensen wrote:
> My solution was to use a dummy .$(SCRIPT)-run.stamp file - and use the
> timestamp on this file to remember when $(SCRIPT).sql was last run:
> 
> #/usr/bin/make -f
> SQLFILES = fns.sql person.sql dates.sql
> STAMPFILES = $(SQLFILES:%.sql=.%-run.stamp)
> 
> .PHONY : default
> default : $(STAMPFILES)
> 
> # If an *.sql file changes, run it
> .%-run.stamp : %.sql
>         $(PG) $(@:.%-run.stamp=%.sql)
>         touch $@
> 
> # if fns.sql changes, re-run person.sql
> .person-run.stamp : fns.sql
> 
> # if person.sql changes, re-run dates.sql
> .dates-run.stamp : person.sql
> 
> # End of makefile
> 
> This will make sure that if an *.sql file changes, it gets run.
> Additionally, person.sql will get re-run if fns.sql changes, and if
> person.sql changes, dates.sql will be re-run too.

most cool. i'll have to study those %.this=%.that patterns and
re-scan the info docs for a fifth time. maybe a live example
like this will help it sink in. :)

> HTH

most likely! thanks!

-- 
I use Debian/GNU Linux version 3.0;
Linux server 2.4.20-k6 #1 Mon Jan 13 23:49:14 EST 2003 i586 unknown
 
DEBIAN NEWBIE TIP #104 from Sean Quinlan <smq@gmx.co.uk>
:
Looking to CUSTOMIZE THE COLORS USED BY LS?  I find its easier
to run "dircolors -p >~/.dircolors" and then add "eval
`dircolors -b ~/.dircolors`" to my .bashrc and then make all
changes to ~/.dircolors (instead of the system-wide
/etc/DIR_COLORS).  Probably more pertinent on a multi user
system, but good policy nevertheless.

Also see http://newbieDoc.sourceForge.net/ ...



Reply to: