8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / sgs / link_audit / common / Makefile.demo
blob528c2283e82892f23af121b6e3773b7ad1112112
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
23 # Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2015 RackTop Systems.
27 MACH:sh=        uname -p
29 sparc_XARCH=
30 sparc64_XARCH=  -m64
31 i386_XARCH=     
32 i38664_XARCH=   -m64
33 C_PICFLAGS=     -Kpic
34 C_PICFLAGS64=   -Kpic
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=%)
41 DIRS=           obj32 obj64 lib32 lib64
43 sparc_LIBS32=   $(LIBS:%=lib32/%)
44 sparc_LIBS64=   $(LIBS:%=lib64/%)
45 i386_LIBS32=    $(LIBS:%=lib32/%)
46 i386_LIBS64=    $(LIBS:%=lib64/%)
48 LIBS64=         $($(MACH)_LIBS64)
49 LIBS32=         $($(MACH)_LIBS32)
51 ALLIBS=         $(LIBS32) $(LIBS64)
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
58 CPPFLAGS +=     -Isrc -D__EXTENSIONS__
59 LDFLAGS =       $(ZDEFS) $(ZTEXT) $(ZIGNORE)
62 .KEEP_STATE:
64 all:    $(DIRS) .WAIT $(ALLIBS) $(SCRIPTS) $(PROGS)
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 $@
72 obj32/%.o \
73 obj64/%.o: src/%.c
74         $(COMPILE.c) $< -o $@
76 dumpbind: \
77         obj32/dumpbind.o
78         $(LINK.c) obj32/dumpbind.o -o $@ $(LDLIBS)
80 lib32/bindings.so.1: \
81         obj32/bindings.o obj32/env.o
82         $(LINK.c) -G obj32/bindings.o obj32/env.o -o $@ $(LDLIBS)
84 lib64/bindings.so.1: \
85         obj64/bindings.o obj64/env.o
86         $(LINK.c) -G obj64/bindings.o obj64/env.o -o $@ $(LDLIBS)
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)
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)
96 lib32/symbindrep.so.1: \
97         obj32/symbindrep.o obj32/env.o
98         $(LINK.c) -G obj32/symbindrep.o obj32/env.o -o $@ $(LDLIBS)
100 lib64/symbindrep.so.1: \
101         obj64/symbindrep.o obj64/env.o
102         $(LINK.c) -G obj64/symbindrep.o obj64/env.o -o $@ $(LDLIBS)
104 lib32/truss.so.1: \
105         obj32/truss.o obj32/env.o
106         $(LINK.c) -G obj32/truss.o obj32/env.o -o $@ $(LDLIBS)
108 lib64/truss.so.1: \
109         obj64/truss.o obj64/env.o
110         $(LINK.c) -G obj64/truss.o obj64/env.o -o $@ $(LDLIBS)
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)
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)
120 obj32 \
121 obj64 \
122 lib32 \
123 lib64:
124         @mkdir $@ | cat
126 clean \
127 clobber:FRC
128         $(RM) -r $(DIRS) $(SCRIPTS) $(PROGS) core .make.state
130 FRC: