You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@worldgate.com> on 1997/09/06 06:22:57 UTC

new makefiles

are all the patches applied?  Dependencies are still messed up.

First I make a server with mod_proxy.

Then I rm modules/proxy/*.o

Then when I type make it does nothing.

Then I rm modules/proxy/libproxy.a

When I type make it tries to link but can't because libproxy isn't there.

When I type make a second time, it builds things as it should.


Re: new makefiles

Posted by Ben Laurie <be...@algroup.co.uk>.
Marc Slemko wrote:
> 
> Grrr.  I hate gnu make, but I'm thinking I hate BSD make more.  It
> insists on thinking that a target of foo has to be called foo on
> disk.

I think hating make for doing what it is supposed to do is strange. Just
make the target something that isn't on disk.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 994 6435|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 994 6472|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Re: new makefiles

Posted by Paul Sutton <pa...@ukweb.com>.
On Sat, 6 Sep 1997, Marc Slemko wrote:
> Grrr.  I hate gnu make, but I'm thinking I hate BSD make more.  It
> insists on thinking that a target of foo has to be called foo on 
> disk.  That doesn't work right because in our case it is looking
> at the times on the proxy _directory_ to see if it is up to date.

Erm, maybe its time to rewrite the modules/Makefile to use something like

all clean ::
	for i in $(SUBDIRS) ; do (cd $$i; $(MAKE) $@); done

and remove all the fake *_build and *_clean targets. I would like to use
this method in src/Makefile as well (esp. since regex is now treated just
like the other dirs). Do you think this will work on BSD make? 

//pcs




Re: new makefiles

Posted by Marc Slemko <ma...@worldgate.com>.
On Sat, 6 Sep 1997, Marc Slemko wrote:

> Grrr.  I hate gnu make, but I'm thinking I hate BSD make more.  It
> insists on thinking that a target of foo has to be called foo on 
> disk.  That doesn't work right because in our case it is looking

let me rephrase that: it insists on checking files on disk that it
should not be checking because of a forced target.  If the target
is forced, it shouldn't matter at all what is on disk.  BSD make
is stupid because it likes pretending that files exist on disk
when they either don't or the version on disk doesn't matter.

It is _not_ doing what it is supposed to.

> at the times on the proxy _directory_ to see if it is up to date.

The below patch to BSD make (from FreeBSD-current source) fixes
the problem.  Too bad we will still have to work around it.


Index: compat.c
===================================================================
RCS file: /mnt/misc1/cvs//src/usr.bin/make/compat.c,v
retrieving revision 1.8
diff -u -r1.8 compat.c
--- compat.c	1997/02/22 19:27:07	1.8
+++ compat.c	1997/09/06 17:37:23
@@ -486,7 +486,7 @@
 	     * check for gn->children being empty as well...
 	     */
 	    if (!Lst_IsEmpty(gn->commands) || Lst_IsEmpty(gn->children)) {
-		gn->mtime = now;
+		gn->mtime = now+1;
 	    }
 #else
 	    /*
@@ -508,7 +508,7 @@
 	     * -- ardeb 1/12/88
 	     */
 	    if (noExecute || Dir_MTime(gn) == 0) {
-		gn->mtime = now;
+		gn->mtime = now+1;
 	    }
 	    if (gn->cmtime > gn->mtime)
 		gn->mtime = gn->cmtime;


Re: new makefiles

Posted by Marc Slemko <ma...@worldgate.com>.
Grrr.  I hate gnu make, but I'm thinking I hate BSD make more.  It
insists on thinking that a target of foo has to be called foo on 
disk.  That doesn't work right because in our case it is looking
at the times on the proxy _directory_ to see if it is up to date.

Using the following makefile:
#----------------------------------------------------------------------
default: proxy
	@echo "Done building module subdirectories"

proxy: ForceMe
	@echo making: $@

ForceMe:
#----------------------------------------------------------------------

I get:

marcs@alive:/tmp/tm$ touch proxy; make
Done building module subdirectories
marcs@alive:/tmp/tm$ touch proxy; sleep 1 ; make
making: proxy

Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrgh.

Since we are already using seperate targets for *_clean, perhaps we
should just do a proxy_build or something instead of just relying
on the list in MODULES.  Grr.

I see the same thing on taz.  

Some debug output from a slightly modified modules makefile (seperate ForceMe
targets for each module)

update time: 10:45:29 Sep 6, 1997
SuffFindDeps (proxy)
        No known suffix on proxy. Using .NULL suffix
not adding suffix rules
proxy:@ = proxy
proxy:* = proxy
Expanding "ForceMe.$(.TARGET)"...ForceMe.proxy...
SuffFindDeps (ForceMe.proxy)
        No known suffix on ForceMe.proxy. Using .NULL suffix
not adding suffix rules
ForceMe.proxy:@ = ForceMe.proxy
ForceMe.proxy:* = ForceMe.proxy
Examining ForceMe.proxy...non-existent...! operator...out-of-date.
ForceMe.proxy:? = 
ForceMe.proxy:> = 
update time: 10:45:29 Sep 6, 1997
Examining proxy...modified 10:45:26 Sep 6, 1997...modified before source...out-o
f-date.
proxy:> = ForceMe.proxy
proxy:? = ForceMe.proxy
(cd proxy; make CC='cc' AUX_CFLAGS=' ' RANLIB='ranlib')


SuffFindDeps (proxy)
        No known suffix on proxy. Using .NULL suffix
not adding suffix rules
proxy:@ = proxy
proxy:* = proxy
Expanding "ForceMe.$(.TARGET)"...ForceMe.proxy...
SuffFindDeps (ForceMe.proxy)
        No known suffix on ForceMe.proxy. Using .NULL suffix
not adding suffix rules
ForceMe.proxy:@ = ForceMe.proxy
ForceMe.proxy:* = ForceMe.proxy
Examining ForceMe.proxy...non-existent...! operator...out-of-date.
ForceMe.proxy:? = 
ForceMe.proxy:> = 
update time: 10:45:26 Sep 6, 1997
Examining proxy...modified 10:45:26 Sep 6, 1997...up-to-date.



Re: new makefiles

Posted by Marc Slemko <ma...@worldgate.com>.
On Sat, 6 Sep 1997, Paul Sutton wrote:

> On Fri, 5 Sep 1997, Marc Slemko wrote:
> > are all the patches applied?  Dependencies are still messed up.
> > First I make a server with mod_proxy.
> > Then I rm modules/proxy/*.o
> > Then when I type make it does nothing.
> > Then I rm modules/proxy/libproxy.a
> > When I type make it tries to link but can't because libproxy isn't there.
> > When I type make a second time, it builds things as it should.
> 
> This should work. Now when you type make in src, it *always* does a make
> in os/unix, main and modules. The generated makefile in modules is pretty
> much the same is it was before the lib or source re-org changes, and
> always does a build in each of the sub-directories. 
> 
> Normally this means that proxy/*.o and proxy/libproxy.a get *rebuilt*
> every time, because the makefile in proxy rm's these files without
> uncontinationally before doing a build. I'm not sure why it does this. 

Something doesn't make sense.  Ahh.  Seems to work with GNU make
but not BSD make.

marcs@alive:~/archive/apache/apachen/src/modules$ make
(cd standard; make CC='cc' AUX_CFLAGS=' ' RANLIB='ranlib')
(cd proxy; make CC='cc' AUX_CFLAGS=' ' RANLIB='ranlib')
rm -f libproxy.a
ar crv libproxy.a mod_proxy.o proxy_cache.o proxy_connect.o proxy_ftp.o proxy_http.o proxy_util.o
a - mod_proxy.o
a - proxy_cache.o
a - proxy_connect.o
a - proxy_ftp.o
a - proxy_http.o
a - proxy_util.o
ranlib libproxy.a
(cd example; make CC='cc' AUX_CFLAGS=' ' RANLIB='ranlib')
Done building module subdirectories
marcs@alive:~/archive/apache/apachen/src/modules$ rm proxy/libproxy.a 
marcs@alive:~/archive/apache/apachen/src/modules$ make
(cd standard; make CC='cc' AUX_CFLAGS=' ' RANLIB='ranlib')
(cd example; make CC='cc' AUX_CFLAGS=' ' RANLIB='ranlib')
Done building module subdirectories


Above is the problem.  The second time around it doesn't even try
to do anything with the proxy.  I think this is caused by a bad
interaction with the ForceMe target.  BSD make has this horrible
habit of pretending files exist on disk because it thinks they
should; if you want a rule to make a .o file that does 
"cat source.c > foo.c; cc -c foo.c" it won't work right because
it will think foo.c exists on disk before it does and will try
to use a .c.o rule.  Well, the BSD make in FreeBSD 2.1 does this anyway.
Last I checked it wasn't fixed in 2.2.  This problem may be related.
Grr.  I will look further.


Re: new makefiles

Posted by Paul Sutton <pa...@ukweb.com>.
On Fri, 5 Sep 1997, Marc Slemko wrote:
> are all the patches applied?  Dependencies are still messed up.
> First I make a server with mod_proxy.
> Then I rm modules/proxy/*.o
> Then when I type make it does nothing.
> Then I rm modules/proxy/libproxy.a
> When I type make it tries to link but can't because libproxy isn't there.
> When I type make a second time, it builds things as it should.

This should work. Now when you type make in src, it *always* does a make
in os/unix, main and modules. The generated makefile in modules is pretty
much the same is it was before the lib or source re-org changes, and
always does a build in each of the sub-directories. 

Normally this means that proxy/*.o and proxy/libproxy.a get *rebuilt*
every time, because the makefile in proxy rm's these files without
uncontinationally before doing a build. I'm not sure why it does this. 

I'm concentrating on os abstraction at the moment, but there are some
cleanups which could be done to the configure process, mostly from
left-overs from before the updates. Namely

 a. remove the fake dependencies built into src/Makefile by Configure
 b. make modules/Makefile use a SUBDIRS=... macro and build alternate
    dependencies like "all clean depend :: for i in $(SUBDIRS) ..."
 c. update regex so its default target is "make all" then treat it
    just like any other sub-dir from src/Makefile
 d. change proxy/Makefile so it doesn't rebuild libproxy every build

//pcs