xref: /titanic_52/usr/src/lib/libmd/Makefile.com (revision 3c112a2b34403220c06c3e2fcac403358cfba168)
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# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26# $LIBRARY is set in lower makefiles so we can have platform and
27# processor optimised versions of this library via libmd_psr and libmd_hwcapN
28
29#LIBRARY= libmd.a
30VERS= .1
31
32OBJECTS= md4.o md5.o $(MD5_PSR_OBJECTS) sha1.o $(SHA1_PSR_OBJECTS) \
33		sha2.o $(SHA2_PSR_OBJECTS)
34
35# Use $(SRC) to include makefiles rather than ../../ because the
36# platform subdirs are one level deeper so it would be ../../../ for them
37include $(SRC)/lib/Makefile.lib
38include $(SRC)/lib/Makefile.rootfs
39
40LIBS =		$(DYNLIB) $(LINTLIB)
41SRCS = \
42	$(COMDIR)/md4/md4.c \
43	$(COMDIR)/md5/md5.c \
44	$(COMDIR)/sha1/sha1.c \
45	$(COMDIR)/sha2/sha2.c
46
47COMDIR= $(SRC)/common/crypto
48
49$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
50LDLIBS +=	-lc
51
52SRCDIR =	../common
53COMDIR =	$(SRC)/common/crypto
54
55CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
56CFLAGS64 += $(C_BIGPICFLAGS)
57CPPFLAGS += -I$(SRCDIR)
58
59ROOTLINT= $(LINTSRC:%=$(ROOTLIBDIR)/%)
60
61.KEEP_STATE:
62
63all: $(LIBS)
64
65lint: lintcheck
66
67pics/%.o: $(COMDIR)/md4/%.c
68	$(COMPILE.c) -I$(COMDIR)/md4 -o $@ $<
69	$(POST_PROCESS_O)
70
71pics/%.o: $(COMDIR)/md5/%.c
72	$(COMPILE.c) -I$(COMDIR)/md5 $(INLINES) -o $@ $<
73	$(POST_PROCESS_O)
74
75pics/%.o: $(COMDIR)/sha1/%.c
76	$(COMPILE.c) -I$(COMDIR)/sha1 -o $@ $<
77	$(POST_PROCESS_O)
78
79pics/%.o: $(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
80	$(COMPILE.s) -P -DPIC -D_ASM -o $@ $<
81	$(POST_PROCESS_O)
82
83pics/%.o: $(COMDIR)/sha2/%.c
84	$(COMPILE.c) -I$(COMDIR)/sha2 -o $@ $<
85	$(POST_PROCESS_O)
86
87#
88# Used when building links in /platform/$(PLATFORM)/lib for libmd_psr.so.1
89#
90
91LIBMD_PSR_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib)
92LIBMD_PSR_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MODULE))
93
94LIBMD_PSR64_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64))
95LIBMD_PSR64_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64)/$(MODULE))
96
97INS.slink6 = $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@
98
99INS.slink64 = $(RM) -r $@; $(SYMLINK) ../../../$(PLATFORM)/lib/$(MACH64)/$(MODULE) $@
100
101$(LIBMD_PSR_DIRS):
102	-$(INS.dir)
103
104$(LIBMD_PSR_LINKS): $(LIBMD_PSR_DIRS)
105	-$(INS.slink6)
106
107$(LIBMD_PSR64_DIRS):
108	-$(INS.dir)
109
110$(LIBMD_PSR64_LINKS): $(LIBMD_PSR64_DIRS)
111	-$(INS.slink64)
112
113include $(SRC)/lib/Makefile.targ
114