xref: /titanic_53/usr/src/lib/libmd/Makefile.com (revision 734b6a94890be549309b21156f8ed6d4561cac51)
1*734b6a94Sdarrenm#
2*734b6a94Sdarrenm# CDDL HEADER START
3*734b6a94Sdarrenm#
4*734b6a94Sdarrenm# The contents of this file are subject to the terms of the
5*734b6a94Sdarrenm# Common Development and Distribution License (the "License").
6*734b6a94Sdarrenm# You may not use this file except in compliance with the License.
7*734b6a94Sdarrenm#
8*734b6a94Sdarrenm# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*734b6a94Sdarrenm# or http://www.opensolaris.org/os/licensing.
10*734b6a94Sdarrenm# See the License for the specific language governing permissions
11*734b6a94Sdarrenm# and limitations under the License.
12*734b6a94Sdarrenm#
13*734b6a94Sdarrenm# When distributing Covered Code, include this CDDL HEADER in each
14*734b6a94Sdarrenm# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*734b6a94Sdarrenm# If applicable, add the following below this CDDL HEADER, with the
16*734b6a94Sdarrenm# fields enclosed by brackets "[]" replaced with your own identifying
17*734b6a94Sdarrenm# information: Portions Copyright [yyyy] [name of copyright owner]
18*734b6a94Sdarrenm#
19*734b6a94Sdarrenm# CDDL HEADER END
20*734b6a94Sdarrenm#
21*734b6a94Sdarrenm#
22*734b6a94Sdarrenm# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23*734b6a94Sdarrenm# Use is subject to license terms.
24*734b6a94Sdarrenm#
25*734b6a94Sdarrenm# ident	"%Z%%M%	%I%	%E% SMI"
26*734b6a94Sdarrenm#
27*734b6a94Sdarrenm# lib/libmd/Makefile.com
28*734b6a94Sdarrenm#
29*734b6a94Sdarrenm
30*734b6a94Sdarrenm# $LIBRARY is set in lower makefiles so we can have platform and
31*734b6a94Sdarrenm# processor optimised versions of this library via libmd_psr and libmd_hwcapN
32*734b6a94Sdarrenm
33*734b6a94Sdarrenm#LIBRARY= libmd.a
34*734b6a94SdarrenmVERS= .1
35*734b6a94Sdarrenm
36*734b6a94SdarrenmOBJECTS= md4.o md5.o sha1.o sha2.o
37*734b6a94Sdarrenm
38*734b6a94Sdarrenm# Use $(SRC) to include makefiles rather than ../../ because the
39*734b6a94Sdarrenm# platform subdirs are one level deeper so it would be ../../../ for them
40*734b6a94Sdarrenminclude $(SRC)/lib/Makefile.lib
41*734b6a94Sdarrenminclude $(SRC)/lib/Makefile.rootfs
42*734b6a94Sdarrenm
43*734b6a94SdarrenmLIBS =		$(DYNLIB) $(LINTLIB)
44*734b6a94SdarrenmSRCS = \
45*734b6a94Sdarrenm	$(COMDIR)/md4/md4.c \
46*734b6a94Sdarrenm	$(COMDIR)/md5/md5.c \
47*734b6a94Sdarrenm	$(COMDIR)/sha1/sha1.c \
48*734b6a94Sdarrenm	$(COMDIR)/sha2/sha2.c
49*734b6a94Sdarrenm
50*734b6a94SdarrenmCOMDIR= $(SRC)/common/crypto
51*734b6a94Sdarrenm
52*734b6a94Sdarrenm$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
53*734b6a94SdarrenmLDLIBS +=	-lc
54*734b6a94Sdarrenm
55*734b6a94SdarrenmSRCDIR =	../common
56*734b6a94SdarrenmCOMDIR =	$(SRC)/common/crypto
57*734b6a94SdarrenmMAPDIR =	../spec/$(TRANSMACH)
58*734b6a94SdarrenmSPECMAPFILE =	$(MAPDIR)/mapfile
59*734b6a94Sdarrenm
60*734b6a94SdarrenmCFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
61*734b6a94SdarrenmCFLAGS64 += $(C_BIGPICFLAGS)
62*734b6a94SdarrenmCPPFLAGS += -I$(SRCDIR)
63*734b6a94Sdarrenm
64*734b6a94Sdarrenm# The md5 and sha1 code is very careful about data alignment
65*734b6a94Sdarrenm# but lint doesn't know that, so just shut lint up.
66*734b6a94SdarrenmLINTFLAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
67*734b6a94SdarrenmLINTFLAGS64 += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
68*734b6a94Sdarrenm
69*734b6a94Sdarrenm
70*734b6a94SdarrenmROOTLINT= $(LINTSRC:%=$(ROOTLIBDIR)/%)
71*734b6a94Sdarrenm
72*734b6a94Sdarrenm.KEEP_STATE:
73*734b6a94Sdarrenm
74*734b6a94Sdarrenmall: $(LIBS) fnamecheck
75*734b6a94Sdarrenm
76*734b6a94Sdarrenmlint: lintcheck
77*734b6a94Sdarrenm
78*734b6a94Sdarrenmpics/%.o: $(COMDIR)/md4/%.c
79*734b6a94Sdarrenm	$(COMPILE.c) -I$(COMDIR)/md4 -o $@ $<
80*734b6a94Sdarrenm	$(POST_PROCESS_O)
81*734b6a94Sdarrenm
82*734b6a94Sdarrenmpics/%.o: $(COMDIR)/md5/%.c
83*734b6a94Sdarrenm	$(COMPILE.c) -I$(COMDIR)/md5 $(INLINES) -o $@ $<
84*734b6a94Sdarrenm	$(POST_PROCESS_O)
85*734b6a94Sdarrenm
86*734b6a94Sdarrenmpics/%.o: $(COMDIR)/sha1/%.c
87*734b6a94Sdarrenm	$(COMPILE.c) -I$(COMDIR)/sha1 -o $@ $<
88*734b6a94Sdarrenm	$(POST_PROCESS_O)
89*734b6a94Sdarrenm
90*734b6a94Sdarrenmpics/%.o: $(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
91*734b6a94Sdarrenm	$(COMPILE.s) -P -DPIC -D_ASM -o $@ $<
92*734b6a94Sdarrenm	$(POST_PROCESS_O)
93*734b6a94Sdarrenm
94*734b6a94Sdarrenmpics/%.o: $(COMDIR)/sha2/%.c
95*734b6a94Sdarrenm	$(COMPILE.c) -I$(COMDIR)/sha2 -o $@ $<
96*734b6a94Sdarrenm	$(POST_PROCESS_O)
97*734b6a94Sdarrenm
98*734b6a94Sdarrenm#
99*734b6a94Sdarrenm# Used when building links in /platform/$(PLATFORM)/lib for libmd_psr.so.1
100*734b6a94Sdarrenm#
101*734b6a94Sdarrenm
102*734b6a94SdarrenmLIBMD_PSR_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib)
103*734b6a94SdarrenmLIBMD_PSR_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MODULE))
104*734b6a94Sdarrenm
105*734b6a94SdarrenmLIBMD_PSR64_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64))
106*734b6a94SdarrenmLIBMD_PSR64_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64)/$(MODULE))
107*734b6a94Sdarrenm
108*734b6a94SdarrenmINS.slink6 = $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@ $(CHOWNLINK) $(CHGRPLINK)
109*734b6a94Sdarrenm
110*734b6a94SdarrenmINS.slink64 = $(RM) -r $@; $(SYMLINK) ../../../$(PLATFORM)/lib/$(MACH64)/$(MODULE) $@ $(CHOWNLINK) $(CHGRPLINK)
111*734b6a94Sdarrenm
112*734b6a94Sdarrenm$(LIBMD_PSR_DIRS):
113*734b6a94Sdarrenm	-$(INS.dir.root.bin)
114*734b6a94Sdarrenm
115*734b6a94Sdarrenm$(LIBMD_PSR_LINKS): $(LIBMD_PSR_DIRS)
116*734b6a94Sdarrenm	-$(INS.slink6)
117*734b6a94Sdarrenm
118*734b6a94Sdarrenm$(LIBMD_PSR64_DIRS):
119*734b6a94Sdarrenm	-$(INS.dir.root.bin)
120*734b6a94Sdarrenm
121*734b6a94Sdarrenm$(LIBMD_PSR64_LINKS): $(LIBMD_PSR64_DIRS)
122*734b6a94Sdarrenm	-$(INS.slink64)
123*734b6a94Sdarrenm
124*734b6a94Sdarrenminclude $(SRC)/lib/Makefile.targ
125