NetBSD-Users archive

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

Re: What is BSD make?



 >> 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?
See below. If you're talking about daily development and paths to libraries,
then use LD_LIBRARY_PATH.

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.

> 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.

 >>> 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? ;-)

> 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 ;-)

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

 >>> 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?

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index