dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / sgs / libelf / demo / Makefile
blob8c4e0f9aa717feece2d429fc125456dc3b6fdc42
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
22 # Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
25 PROGS= pcom acom dcom tpcom dispsyms
26 LDLIBS= -lelf
28 OBJS= $(PROGS:%=%.o)
30 .KEEP_STATE:
32 all: libobj.a .WAIT $(PROGS)
34 libobj.a: $(OBJS)
35 ar -r $@ $(OBJS)
37 %.o: %.c
38 $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
39 mcs -d -a "ELF demo: object comment: $@" $@
41 %: %.o
42 $(CC) $(CFLAGS) -o $@ $< $(LDLIBS)
43 mcs -d -a "ELF demo: executable comment: $@" $@
45 test: test1 test2 test3 test4 test5 test6
47 test1: pcom FRC
48 @ echo ""
49 @ echo "<<< Test 1 >>>"
50 @ echo "Print comments of pcom"
51 pcom pcom
52 @ echo
53 @ echo "Print comments from archive libobj.a"
54 pcom libobj.a
56 test2: dcom pcom FRC
57 @ echo ""
58 @ echo "<<< Test 2 >>>"
59 @ echo "Delete the comment section from pcom"
60 TMPDIR= dcom pcom
61 pcom pcom
63 test3: pcom acom test2 FRC
64 @ echo ""
65 @ echo "<<< Test 3 >>>"
66 @ echo "update comments from pcom and then print them out."
67 acom "Newly Updated Comments" pcom
68 pcom pcom
70 test4: acom pcom test3 FRC
71 @ echo ""
72 @ echo "<<< Test 4 >>>"
73 @ echo "Append to the comment section of pcom."
74 acom "This comment has been appended" pcom
75 pcom pcom
77 test5: $(PROGS) FRC
78 @ echo ""
79 @ echo "<<< Test 5 >>>"
80 @ echo "Relabel the new utilities using the new utilities."
81 TMPDIR= dcom $(PROGS)
82 cp acom acom.safe
83 acom.safe "libelf Demonstration Tools" $(PROGS)
84 pcom $(PROGS)
85 $(RM) acom.safe
87 test6: dispsyms FRC
88 @ echo ""
89 @ echo "<<< Test 6 >>>"
90 @ echo "Display symbols in dispsyms itself."
91 dispsyms dispsyms | egrep -v "LOCL|ABS|SECT|UNDEF"
93 test-extra: tpcom FRC
94 @ echo ""
95 @ echo "<<< Test-extra >>>"
96 @ echo "Using the threaded tpcom, go through and examine all"
97 @ echo "libraries in /lib. This is an output intensive test."
98 tpcom /lib/lib*.so.?
100 clean: FRC
101 $(RM) $(OBJS) $(PROGS) libobj.a core
103 FRC: