xref: /titanic_41/usr/src/tools/elfsign/Makefile (revision 7c2fbfb345896881c631598ee3852ce9ce33fb07)
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#ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28
29PROG=		elfsign
30SHFILES=	elfsigncmp
31
32LIBOBJS=	elfcertlib.o elfsignlib.o
33OBJS=		$(PROG).o $(LIBOBJS)
34
35.PARALLEL:	$(OBJS)
36
37CMDDIR=	$(SRC)/cmd/cmd-crypto/elfsign
38LIBDIR=	$(SRC)/lib/libelfsign/common
39SRCS=	$(CMDDIR)/$(PROG).c $(LIBOBJS:%.o=$(LIBDIR)/%.c)
40CLEANFILES=	$(PROG) $(OBJS) $(SHFILES)
41
42include ../../../src/tools/Makefile.tools
43
44OWNER=	root
45GROUP=	bin
46CFLAGS += $(CCVERBOSE)
47CFLAGS += -_gcc=-fasm
48
49CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS
50CPPFLAGS +=	-I$(SRC)/lib/libelfsign/common
51CPPFLAGS +=	-I$(SRC)/uts/common
52CPPFLAGS +=	-I$(SRC)/lib/libkmf/include
53CPPFLAGS +=	-I$(SRC)/lib/libcryptoutil/common
54LDFLAGS +=	-lmd -lelf -lkmf -lcryptoutil -lc
55
56#
57# While the gate builds a libelfsign.so linked staticly against
58# pksc11_softtoken, the tools version of libelfsign is dynamically linked
59# against the build machines pkcs11_softtoken.so.
60#
61SOFTTOKENDIR =	/usr/lib/security
62SOFTTOKENLIB =	pkcs11_softtoken.so
63LDFLAGS +=	-R $(SOFTTOKENDIR) $(SOFTTOKENDIR)/$(SOFTTOKENLIB)
64
65MKDIR=	mkdir
66
67.KEEP_STATE:
68
69all:	$(PROG) $(SHFILES)
70
71install: all .WAIT $(ROOTONBLDMACHPROG) $(ROOTONBLDSHFILES)
72
73$(PROG):	$(OBJS)
74	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
75	$(POST_PROCESS)
76
77%.o:	$(CMDDIR)/%.c
78	$(COMPILE.c) -o $@ $<
79
80%.o:	$(LIBDIR)/%.c
81	$(COMPILE.c) -o $@ $<
82
83lint:	lint_SRCS
84
85clean:
86	$(RM) $(CLEANFILES)
87
88include ../../../src/tools/Makefile.targ
89