Home | History | Annotate | Download | only in common
      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 2008 Sun Microsystems, Inc.  All rights reserved.
     24 # Use is subject to license terms.
     25 #
     26 
     27 MACH:sh=	uname -p
     28 
     29 sparc_XARCH=
     30 sparc64_XARCH=	-m64
     31 i386_XARCH=	
     32 i38664_XARCH=	-m64
     33 C_PICFLAGS=	-Kpic
     34 C_PICFLAGS64=	-Kpic
     35 
     36 PROGS=		dumpbind
     37 LIBS=		truss.so.1 symbindrep.so.1 perfcnt.so.1 who.so.1 bindings.so.1
     38 KSHSRC=		sotruss.ksh symbindrep.ksh perfcnt.ksh whocalls.ksh
     39 SCRIPTS=	$(KSHSRC:%.ksh=%)
     40 
     41 DIRS=		obj32 obj64 lib32 lib64
     42 
     43 sparc_LIBS32=	$(LIBS:%=lib32/%)
     44 sparc_LIBS64=	$(LIBS:%=lib64/%)
     45 i386_LIBS32=	$(LIBS:%=lib32/%)
     46 i386_LIBS64=	$(LIBS:%=lib64/%)
     47 
     48 LIBS64=		$($(MACH)_LIBS64)
     49 LIBS32=		$($(MACH)_LIBS32)
     50 
     51 ALLIBS=		$(LIBS32) $(LIBS64)
     52 
     53 $(LIBS32):=	CFLAGS += $($(MACH)_XARCH) $(C_PICFLAGS)
     54 $(LIBS32):=	LDLIBS += -lmapmalloc -ldl -lc
     55 $(LIBS64):=	CFLAGS += $($(MACH)64_XARCH) $(C_PICFLAGS64)
     56 $(LIBS64):=	LDLIBS += -lmapmalloc -ldl -lc
     57 
     58 CPPFLAGS +=	-Isrc -D__EXTENSIONS__
     59 LDFLAGS =	$(ZDEFS) $(ZTEXT) $(ZIGNORE)
     60 
     61 
     62 .KEEP_STATE:
     63 
     64 all:	$(DIRS) .WAIT $(ALLIBS) $(SCRIPTS) $(PROGS)
     65 
     66 %:	src/%.ksh
     67 	$(RM) $@
     68 	cat $< | sed -e s,/opt/SUNWonld/lib/,`pwd`/lib, | \
     69 		sed -e s,/usr/lib/link_audit/,`pwd`/lib, > $@
     70 	chmod a+x $@
     71 
     72 obj32/%.o \
     73 obj64/%.o: src/%.c
     74 	$(COMPILE.c) $< -o $@
     75 
     76 dumpbind: \
     77 	obj32/dumpbind.o
     78 	$(LINK.c) obj32/dumpbind.o -o $@
     79 
     80 lib32/bindings.so.1: \
     81 	obj32/bindings.o obj32/env.o
     82 	$(LINK.c) -G obj32/bindings.o obj32/env.o -o $@ $(LDLIBS)
     83 
     84 lib64/bindings.so.1: \
     85 	obj64/bindings.o obj64/env.o
     86 	$(LINK.c) -G obj64/bindings.o obj64/env.o -o $@ $(LDLIBS)
     87 
     88 lib32/perfcnt.so.1: \
     89 	obj32/perfcnt.o obj32/hash.o obj32/env.o
     90 	$(LINK.c) -G obj32/perfcnt.o obj32/hash.o obj32/env.o -o $@ $(LDLIBS)
     91 
     92 lib64/perfcnt.so.1: \
     93 	obj64/perfcnt.o obj64/hash.o obj64/env.o
     94 	$(LINK.c) -G obj64/perfcnt.o obj64/hash.o obj64/env.o -o $@ $(LDLIBS)
     95 
     96 lib32/symbindrep.so.1: \
     97 	obj32/symbindrep.o obj32/env.o
     98 	$(LINK.c) -G obj32/symbindrep.o obj32/env.o -o $@ $(LDLIBS)
     99 
    100 lib64/symbindrep.so.1: \
    101 	obj64/symbindrep.o obj64/env.o
    102 	$(LINK.c) -G obj64/symbindrep.o obj64/env.o -o $@ $(LDLIBS)
    103 
    104 lib32/truss.so.1: \
    105 	obj32/truss.o obj32/env.o
    106 	$(LINK.c) -G obj32/truss.o obj32/env.o -o $@ $(LDLIBS)
    107 
    108 lib64/truss.so.1: \
    109 	obj64/truss.o obj64/env.o
    110 	$(LINK.c) -G obj64/truss.o obj64/env.o -o $@ $(LDLIBS)
    111 
    112 lib32/who.so.1: \
    113 	obj32/who.o obj32/env.o
    114 	$(LINK.c) -G obj32/who.o obj32/env.o -o $@ -lelf $(LDLIBS)
    115 
    116 lib64/who.so.1: \
    117 	obj64/who.o obj64/env.o
    118 	$(LINK.c) -G obj64/who.o obj64/env.o -o $@ -lelf $(LDLIBS)
    119 
    120 obj32 \
    121 obj64 \
    122 lib32 \
    123 lib64:
    124 	@mkdir $@ | cat
    125 
    126 clean \
    127 clobber:FRC
    128 	$(RM) -r $(DIRS) $(SCRIPTS) $(PROGS) core .make.state
    129 
    130 FRC:
    131