NetBSD-Users archive

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

Re: What is BSD make?



Aleksey Cheusov <cheusov%tut.by@localhost> writes:

>  >> 0 dictd_bsd_make>cat dict_common/Makefile.inc 
>  >> LDFLAGS+=       -L../dict_common
>  >> LDADD+=         -ldict_common
>
>> Now do the same, except link it statically.
> dict_common is static librarya, oit contains the code common for dict, dictd,
> dictfmt and dictzip. While libmaa is shared library. What's the problem?

It doesn't link that way in general case.

> 0 dictd_bsd_make>ls -la libmaa/
> total 28
> drwxr-xr-x  2 cheusov  syntagma  512 Oct  4 15:55 .
> drwxr-xr-x  8 cheusov  syntagma  512 Oct  1 23:27 ..
> -rw-r--r--  1 cheusov  syntagma   24 Oct  1 23:41 1.c
> -rw-r--r--  1 cheusov  syntagma   24 Oct  1 22:52 2.c
> -rw-r--r--  1 cheusov  syntagma   24 Oct  1 23:18 3.c
> -rw-r--r--  1 cheusov  syntagma  105 Oct  1 23:38 Makefile
> -rw-r--r--  1 cheusov  syntagma  151 Oct  1 23:37 Makefile.inc
> 0 dictd_bsd_make>cat libmaa/Makefile
> LIB=            maa
> SRCS=           1.c 2.c 3.c # etc.
>
> SHLIB_MAJOR=    2
> SHLIB_MINOR=    0
> SHLIB_TEENY=    3
>
> .include <bsd.lib.mk>
> 0 dictd_bsd_make>ls -la 
> /tmp/some/where/home/cheusov/prjs/dictd_bsd_make/libmaa/lib*
> -rw-r--r--  1 cheusov  wheel  2154 Oct 13 10:34 
> /tmp/some/where/home/cheusov/prjs/dictd_bsd_make/libmaa/libmaa.a
> lrwxr-xr-x  1 cheusov  wheel    15 Oct 13 10:34 
> /tmp/some/where/home/cheusov/prjs/dictd_bsd_make/libmaa/libmaa.so -> 
> libmaa.so.2.0.3
> lrwxr-xr-x  1 cheusov  wheel    15 Oct 13 10:34 
> /tmp/some/where/home/cheusov/prjs/dictd_bsd_make/libmaa/libmaa.so.2 -> 
> libmaa.so.2.0.3
> -rwxr-xr-x  1 cheusov  wheel  4122 Oct 13 10:34 
> /tmp/some/where/home/cheusov/prjs/dictd_bsd_make/libmaa/libmaa.so.2.0.3
> -rw-r--r--  1 cheusov  wheel  2400 Oct 13 10:34 
> /tmp/some/where/home/cheusov/prjs/dictd_bsd_make/libmaa/libmaa_p.a
> -rw-r--r--  1 cheusov  wheel  2154 Oct 13 10:34 
> /tmp/some/where/home/cheusov/prjs/dictd_bsd_make/libmaa/libmaa_pic.a
> 0 dictd_bsd_make>
>
>
>  >> DPADD+=         ../dict_common/libdict_common.a
>
>> And, try it without setting MAKEOBJDIRPREFIX and running "make obj"
>> for the whole tree.
> Why? Before building an entire project it is normnally to build
> target obj directories. This is not a problem because
> I don't create subprojects/subdirectories every day.

Sure, you have made it special case, but make tool isn't for building
the whole project, it is development tool first and foremost.
Its predestination is to make development builds more convenient
by not rebuilding all what you did. Otherwise simple shell script would
be sufficient.

>> Don't create objdir for "dict" and create it for "dict_common".
>> This is valid usage, but your build fails.
> This is strained problem.
> It is not  a problem to run 'make obj' manually every time
> you create new subprojects.

It is problem to use it in development, because it is less convenient.
You don't work on the whole tree usually, thus different object
directories for different parts are usual.

>  >>> 3. Recursive makes.
>  >>
>  >> I personally don't beleive in "Recursive make considered harmful" by
>  >> Peter Miller. Most of those problems can easily be solved using bmake.
>
>> Now tell us,
> Us? ;-)

We write on mailing list, if you didn't notice.

>> how are you going to build those libraries you depend on
>> without calling recursive make?
> I didn't say I will not call recursive make.
> I said that I don't think that recursive make is a problem at all ;-)

Yes, and that is one of indications, that you don't understand problems.

>> How are you going to pass flags to you recursive make?
> What exactly flags?  How about environment variables?

How about not polluting environment?

There're other flags, if you didn't notice. "-n" for instance.

>  >>> I have absolutely no idea how to handle recursive makes right now.
>  >> Natively with bsd.subdir.mk?
>
>> You don't understand the problem.
>
> Are you sure?

Yes, I'm sure, and I showed it in previous messages and in this one.


-- 
HE CE3OH...



Home | Main Index | Thread Index | Old Index