openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

Make.kernlib (1718B)


      1 #
      2 #  Copyright 2017 Broadcom
      3 #  
      4 #  This program is free software; you can redistribute it and/or modify
      5 #  it under the terms of the GNU General Public License, version 2, as
      6 #  published by the Free Software Foundation (the "GPL").
      7 #  
      8 #  This program is distributed in the hope that it will be useful, but
      9 #  WITHOUT ANY WARRANTY; without even the implied warranty of
     10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     11 #  General Public License version 2 (GPLv2) for more details.
     12 #  
     13 #  You should have received a copy of the GNU General Public License
     14 #  version 2 (GPLv2) along with this source code.
     15 #
     16 # $Id: Make.kernlib,v 1.7 Broadcom SDK $
     17 # $Copyright: (c) 2005 Broadcom Corp.
     18 # All Rights Reserved.$
     19 #
     20 # Make rules/targets for handling libraries
     21 
     22 .SECONDARY:: ${BOBJS}
     23 
     24 targetlibsoname = ${lib}.so.${SHAREDLIBVER}
     25 targetlibrealname = ${targetlibsoname}
     26 targetlibso = ${LIBDIR}/${targetlibrealname}
     27 
     28 ifeq ($(TOOLS),Borland)
     29 
     30 LIBSUFFIX=lib
     31 
     32 ${LIBDIR}/%.lib: ${BORLAND_BOBJS}
     33 	$(RM) $@
     34 	$(FOREACH) -subdir "$(LIBDIR)" \
     35 		"tlib $@ $(foreach obj, $(BORLAND_LOBJS), +-$(obj))"
     36 
     37 else	# !Borland
     38 
     39 LIBSUFFIX=a
     40 
     41 ${LIBDIR}/%.a: ${BOBJS}
     42 ifdef QUIET
     43 	@$(ECHO) Building library $(notdir $@)
     44 endif
     45 	$Q$(RM) $@
     46 	$Q$(AR) ${ARFLAGS} $@ $(sort ${BOBJS})
     47 ifeq ($(LINUX_MAKE_SHARED_LIB),1)
     48 ifeq ($(targetbase),unix)
     49 	$(CC) -shared -Wl,-soname,${targetlibsoname} -o ${targetlibso} ${BOBJS} -lc
     50 endif
     51 endif # LINUX_MAKE_SHARED_LIB #
     52 endif	# !Borland
     53 
     54 targetlib = ${LIBDIR}/${lib}.${LIBSUFFIX}
     55 
     56 all:: ${BLDDIR}/.tree ${targetlib}
     57 
     58 install:: all
     59 
     60 clean::
     61 ifdef QUIET
     62 	@$(ECHO) Cleaning objects for ${LOCALDIR} and ${lib}
     63 endif
     64 	$Q$(RM) ${BOBJS}
     65 	$Q$(RM) ${targetlib}
     66 	$Q$(RM) ${targetlibso}
     67 
     68 distclean:: clean
     69