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]
22 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
30 ELFCAP
= $(SRC
)/common
/elfcap
31 SGSRTCID
= $(SRC
)/common
/sgsrtcid
33 LOBJS
= file.o elf_read32.o elf_read64.o magicutils.o
34 OBJS
= $(LOBJS
) elfcap.o
35 XPG4OBJS
= $(OBJS
:%.o
=xpg4_
%.o
)
36 SRCS
= file.c elf_read.c magicutils.c
$(ELFCAP
)/elfcap.c
38 include ..
/Makefile.cmd
40 CERRWARN
+= -_gcc
=-Wno-uninitialized
41 CERRWARN
+= -_gcc
=-Wno-type-limits
44 POFILES
= $(SRCS
:%.c
=%.po
)
46 # The debug binary can be built using the flag
47 # -D COPTFLAG=-g CGLOBALSTATIC=
48 # This will avoid the multiple symbols definition error
49 # for static global variables in elf_read32.o and elf_read64.o
52 CPPFLAGS
+= -I
$(ELFCAP
) -I
$(SGSRTCID
)
53 $(XPG4
) := CFLAGS
+= -DXPG4
55 ROOTETCMAGIC
= $(MAGIC
:%=$(ROOTETC
)/%)
57 $(ROOTETCMAGIC
) := FILEMODE
= $(LIBFILEMODE
)
59 .PARALLEL
: $(OBJS
) $(XPG4OBJS
) $(POFILES
)
63 all: $(PROG
) $(XPG4
) $(MAGIC
)
66 $(LINK.c
) $(OBJS
) -o
$@
$(LDLIBS
)
70 $(LINK.c
) $(XPG4OBJS
) -o
$@
$(LDLIBS
)
80 $(COMPILE.c
) -D_ELF64
-o
$@
$<
89 $(COMPILE.c
) -D_ELF64
-o
$@
$<
91 elfcap.o
: $(ELFCAP
)/elfcap.c
92 $(COMPILE.c
) -o
$@
$(ELFCAP
)/elfcap.c
94 xpg4_elfcap.o
: $(ELFCAP
)/elfcap.c
95 $(COMPILE.c
) -o
$@
$(ELFCAP
)/elfcap.c
101 install: all $(ROOTPROG
) $(ROOTXPG4PROG
) $(ROOTETCMAGIC
)
104 $(RM
) $(OBJS
) $(XPG4OBJS
)
107 include ..
/Makefile.targ