1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 
  22 #
  23 # Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
  24 # Copyright 2018 Joyent, Inc.
  25 #
  26 
  27 LIBRARY =       libconv.a
  28 
  29 COMOBJS32 =     cap_machelf32.o         dynamic_machelf32.o \
  30                 globals_machelf32.o     sections_machelf32.o \
  31                 symbols_machelf32.o     symbols_sparc_machelf32.o
  32 
  33 COMOBJS64 =     cap_machelf64.o         dynamic_machelf64.o \
  34                 globals_machelf64.o     sections_machelf64.o \
  35                 symbols_machelf64.o     symbols_sparc_machelf64.o
  36 
  37 COMOBJS=        arch.o                  audit.o \
  38                 c_literal.o \
  39                 cap.o                   config.o \
  40                 corenote.o              data.o \
  41                 deftag.o                demangle.o \
  42                 dl.o                    dwarf.o \
  43                 dwarf_ehe.o             dynamic.o \
  44                 elf.o                   entry.o \
  45                 globals.o               group.o \
  46                 lddstub.o               map.o \
  47                 phdr.o                  relocate.o \
  48                 relocate_i386.o         relocate_amd64.o \
  49                 relocate_sparc.o        sections.o \
  50                 segments.o              strproc.o \
  51                 symbols.o               syminfo.o \
  52                 tokens.o                time.o \
  53                 version.o
  54 
  55 ELFCAP_OBJS=    elfcap.o
  56 
  57 ASOBJS=         vernote.o
  58 
  59 BLTOBJS=        arch_msg.o              audit_msg.o \
  60                 c_literal_msg.o \
  61                 cap_msg.o               config_msg.o \
  62                 corenote_msg.o          data_msg.o \
  63                 deftag_msg.o            demangle_msg.o \
  64                 dl_msg.o                dwarf_msg.o \
  65                 dwarf_ehe_msg.o         dynamic_msg.o \
  66                 elf_msg.o               entry_msg.o \
  67                 globals_msg.o           group_msg.o \
  68                 map_msg.o               lddstub_msg.o \
  69                 phdr_msg.o              relocate_amd64_msg.o \
  70                 relocate_i386_msg.o     relocate_sparc_msg.o \
  71                 sections_msg.o          segments_msg.o \
  72                 symbols_msg.o           symbols_sparc_msg.o \
  73                 syminfo_msg.o           time_msg.o \
  74                 version_msg.o
  75 
  76 
  77 OBJECTS =       $(COMOBJS) $(COMOBJS32) $(COMOBJS64) $(ELFCAP_OBJS) \
  78                 $(ASOBJS) $(BLTOBJS)
  79 
  80 #
  81 # This library is unusual since it's a static archive of PIC objects.
  82 # Since static archives should never contain CTF data (regardless of
  83 # whether the object code is position-independent), we disable CTF.
  84 #
  85 NOCTFOBJS =     $(OBJECTS)
  86 CTFMERGE_LIB =  :
  87 
  88 include $(SRC)/lib/Makefile.lib
  89 include $(SRC)/cmd/sgs/Makefile.com
  90 
  91 CERRWARN        += -_gcc=-Wno-type-limits
  92 CERRWARN        += -_gcc=-Wno-switch
  93 
  94 # not linted
  95 SMATCH=off
  96 
  97 CTFCONVERT_O=
  98 
  99 README_REVISION=../../packages/common/readme_revision
 100 ONLDREADME=     ../../packages/common/SUNWonld-README
 101 
 102 PICS=           $(OBJECTS:%=pics/%)
 103 
 104 CPPFLAGS +=     -I$(SRCBASE)/lib/libc/inc -I$(ELFCAP) \
 105                 -I$(SRC)/common/sgsrtcid
 106 
 107 ARFLAGS=        cr
 108 
 109 AS_CPPFLAGS=    -P -D_ASM $(CPPFLAGS)
 110 
 111 BLTDATA=        $(BLTOBJS:%.o=%.c) $(BLTOBJS:%.o=%.h) report_bufsize.h
 112 
 113 SRCS=           ../common/llib-lconv
 114 LINTSRCS=       $(COMOBJS:%.o=../common/%.c) \
 115                     $(COMOBJS_NOMSG:%.o=../common/%.c) \
 116                     $(ELFCOM_OBJS:%.o=$(ELFCAP)/%.c) ../common/lintsup.c
 117 LINTSRCS32 =    $(COMOBJS32:%32.o=../common/%.c)
 118 LINTSRCS64 =    $(COMOBJS64:%64.o=../common/%.c)
 119 
 120 # Since libconv uses dlopen(3C) to load libdemangle-sys.so (much like it did
 121 # for the old Sun Studio libdemangle.so) in order to avoid messy bootstrapping
 122 # problems, but it also needs the definitions from demangle-sys.h for
 123 # SYSDEM_LANG_AUTO, lint will complain about sysdemangle() being defined but not
 124 # used unless it is explicitly included during the lint pass
 125 $(LINTOUT32)    := LDLIBS += -ldemangle-sys
 126 $(LINTOUT64)    := LDLIBS += -ldemangle-sys
 127 
 128 SGSMSGTARG=     $(BLTOBJS:%_msg.o=../common/%.msg)
 129 
 130 LINTFLAGS +=    -u -erroff=E_NAME_DECL_NOT_USED_DEF2
 131 LINTFLAGS64 +=  -u -erroff=E_NAME_DECL_NOT_USED_DEF2
 132 
 133 CLEANFILES +=   $(BLTDATA) $(LINTOUTS) bld_vernote vernote.s
 134 CLOBBERFILES += $(LINTLIBS)