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

Re: Makefile Magic. And now also - Autoconf.





>COBJS += $(patsubst %.c,%.o,$(filter %.c,$(SRCS)))
>CXXOBJS += $(patsubst %.cc,%.o,$(filter %.cc,$(SRCS)))
>
>AFAIK this will work nicely as long as we don't rely on implicit rules for
>building
Then we add 
OBJS=$(COBJS) $(CXXOBJS)
Dynamic, recursive variable expansion GOOD!

>
>>>dir-clean:
>>>	rm -f *.o *.a $(TARGETS)
>>># *.so / *.dll etc (depending on the platform) is also important
>>Yep, this sort of think is always a problem for "make clean".  Again I couldn't
>>be bothered thinkng of an elegant solution at the time.
>
>Hmm, as the error value of rm should be ignored anyway it's propably the
>best to simply specify all possible suffixes.
Maybe, it all depends on how much effor we want to put in.  

>
>>see with them is that they are gnu make dependent.  Perhaps we should switch
>>to Automake (I certainly don't want to do a sophisticated non-gmake system by
>>hand!).
>
>Uh-oh. Things get more complicated :-((
>But I assume you're right. Writing the makefiles per hand is even worse...
Well by hand is not too bad with gnu make at least, if you put some effort
into writing the original makefiles and use the "include" directive maintainance
is OK.  The real issue is whether we want to be dependent on gnu make.
On non Unix systems it is a moot, and Unix systems normally have gmake,
but should we rely on that?

>
><Where's my autoconf manual??> <mmmbl> <???> Nothing in that §$%& Manual
>says anything about needing a cross compilation context or something
>similar for that check. It's the AC_C_BIGENDIAN test, right?
>
Yep.

>>The other thing was that bash quite reasonably refused to execute "unistd.h"
>>as a command during "configure".  The cause of this was that Chris had written
>>
>>AC_CHECK_HEADERS (unistd.h)
>>
>>But m4 does not like whitespace between macro name and the args (I think that
>
>Eeeek!! I always thought that m4 was weird but good once you got familiar
>with it. But that's just [------------censored-----------] !!!
Actually it is reasonably sane behaviour.  CPP does it too, remember
preproccessors need to be quite conservative about what they consider as
a macro invocation.

PS.  The people who wrote autoconf must be bloody clever since m4 blows my
brain after a program hits about 50 lines.  (Quoting you see).