Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
BUILD.LIB.MK(5)		      File Formats Manual	       BUILD.LIB.MK(5)

NAME
       build.lib.mk -- bsdbuild	- compilation of libraries

SYNOPSIS
       .include	<bsd.lib.mk>

DESCRIPTION
       The  build.lib.mk module	compiles static	and/or shared libraries	from a
       set of source files.  For shared	libraries, it uses a bundled  copy  of
       GNU  libtool.   The module provides built-in support for	sources	in the
       following languages:
          C (*.c)
          C++ (*.cc or	*.cpp)
          Objective C (*.m)
          Assembler (*.asm)
          Lex (*.l)
          Yacc	(*.y)

TARGETS
       lib${LIB}.a     Compile the source files	into a static library.

       lib${LIB}.la    Compile the source files	into  static  and  shared  li-
		       braries	using libtool (libtool comes bundled with BSD-
		       Build).

       clean-lib       Clean up	object and library files.

       cleandir-lib    Clean up	for packaging.

       install-lib     Install library files to	the target installation	direc-
		       tory (see csoft.common.mk(5)).

       deinstall-lib   Uninstall libraries from	the installation directory.

VARIABLES
       LIB		   Name	of target library.   Platform-specific	trans-
			   forms will be applied to the	name.

       LIBDIR		   Target  installation	 directory for libraries (usu-
			   ally	set by configure).

       LIB_INSTALL	   If set to Yes, the install target will install  the
			   library  files,  otherwise it will be a no-op.  De-
			   faults to No.

       LIB_SHARED	   If set to Yes, a shared library will	be built.  De-
			   fault is No.

       LIB_MODULE	   If set to Yes, a dlopen(3) compatible  module  will
			   be built.  Default is No.

       LIB_GUID		   A  Global Unique Identifier (GUID) for the library.
			   Exact interpretation	is platform-specific.

       LIB_MAJOR	   Major version number	for shared libraries.

       LIB_MINOR	   Minor version number	for shared libraries.

       LIB_REVISION	   Revision number for shared libraries.

       LIBS		   Specify other libraries to link  against  this  li-
			   brary.   Bare filename arguments are	interpreted as
			   archive files ("foo.a" or "foo.la").	 Arguments  of
			   the	 form  "-L/path/to/dir"	 and  "-lfoo"  specify
			   shared libraries.

       USE_LIBTOOL	   If set to Yes, use  libtool(1)  to  build  the  li-
			   braries.   If set to	No, generate the library using
			   the traditional method involving ar(1),  ranlib(1),
			   and -fPIC.

       LIBTOOL		   Path	to GNU libtool(1).  This is usually set	by the
			   configure   script.	 BSDBuild-generated  configure
			   scripts will	 select	 BSDBuild's  bundled  copy  of
			   libtool  by default (recommended), but an alternate
			   libtool may be specified using --with-libtool=PATH.

       LIBTOOLOPTS	   Specify general libtool  arguments  (passed	before
			   --mode).  Defaults to "--quiet".

       LIBTOOLOPTS_SHARED  Specify  extra  libtool  arguments  for  linking of
			   shared libraries.

       LIBTOOLOPTS_STATIC  Specify extra libtool arguments for linking of sta-
			   tic libraries.

       CC		   Compiler for	C, C++ and Objective C	sources.   De-
			   faults to the CC environment	variable, or "cc".

       CFLAGS		   Compiler  flags  for	 C  sources.   Defaults	to the
			   CFLAGS environment variable.

       CXXFLAGS		   Compiler flags for C++ sources.   Defaults  to  the
			   CXXFLAGS environment	variable.

       OBJCFLAGS	   Compiler  flags  for	Objective C sources.  Defaults
			   to `${CFLAGS}'.

       CPPFLAGS		   Compiler preprocessor flags,	 for  sources  in  all
			   languages featuring a C preprocessor.

       ASM		   Compiler   for   assembler  sources.	  Defaults  to
			   `nasm'.

       ASMFLAGS		   Compiler flags  for	assembler.   Defaults  to  `-g
			   -w-orphan-labels'.

       LEX		   Path	to the lex(1) lexical analyzer generator.

       YACC		   Path	to the yacc(1) parser generator.

       LFLAGS		   Options for lex(1), defaults	to `'.

       YFLAGS		   Options for yacc(1),	defaults to `-d'.

       LIBL		   Libraries  to  use  for  Lex	 lexers.   Defaults to
			   `-ll'.

       WINDRES		   (Specific  to  the  win32  platform)	 Path  to  the
			   windres(1)  utility,	 which	generates  windows re-
			   source files.

       WINRES		   (Specific to	the win32 platform) Resource  file  to
			   use with windres(1).

       DATAFILES	   List	of data	files to install into ${DATADIR}.  The
			   files  must	have  been  generated  from  the build
			   process (i.e., if using a separate build with --sr-
			   cdir, the specified files must exist	in  the	 build
			   directory).

       DATAFILES_SRC	   Files to install into ${DATADIR}.  This variable is
			   handled  similarly  to  DATAFILES,  except that the
			   specified files must	exist in the source directory.

       INCLDIR		   Library header files	will be	 installed  into  this
			   directory.  See build.common.mk(5).

       INCL		   List	of library header files.

       CONFDIR		   System-wide	configuration  files will be installed
			   into	this directory.	 It is usually set relative to
			   `${SYSCONFDIR}',	       for	       example
			   `${SYSCONFDIR}/MyLibrary'.

       CONF		   List	  of   configuration  files  to	 install  into
			   ${CONFDIR}. Note that the install target  will  not
			   override  existing  configuration files, instead it
			   will	output a "The  following  configuration	 files
			   have	been preserved"	message.

       CONF_OVERWRITE	   Overwrite  any  existing  configuration file	on in-
			   stallation.	Default	is "No".

SEE ALSO
       build.common.mk(5), build.prog.mk(5)

HISTORY
       build.lib.mk first appeared in BSDBuild 1.0.

       BSDBuild	is based on the	4.4BSD build system.

FreeBSD	ports 15.0		 July 18, 2007		       BUILD.LIB.MK(5)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=build.lib.mk&sektion=5&manpath=FreeBSD+Ports+15.0>

home | help