xref: /illumos-gate/usr/src/lib/libmd/Makefile.com (revision 49bfb42b00abac0958a1308f4233e366fd083366)
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
59# The md5 and sha1 code is very careful about data alignment
60# but lint doesn't know that, so just shut lint up.
61LINTFLAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
62LINTFLAGS64 += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
63
64
65ROOTLINT= $(LINTSRC:%=$(ROOTLIBDIR)/%)
66
67.KEEP_STATE:
68
69all: $(LIBS)
70
71lint: lintcheck
72
73pics/%.o: $(COMDIR)/md4/%.c
74	$(COMPILE.c) -I$(COMDIR)/md4 -o $@ $<
75	$(POST_PROCESS_O)
76
77pics/%.o: $(COMDIR)/md5/%.c
78	$(COMPILE.c) -I$(COMDIR)/md5 $(INLINES) -o $@ $<
79	$(POST_PROCESS_O)
80
81pics/%.o: $(COMDIR)/sha1/%.c
82	$(COMPILE.c) -I$(COMDIR)/sha1 -o $@ $<
83	$(POST_PROCESS_O)
84
85pics/%.o: $(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
86	$(COMPILE.s) -P -DPIC -D_ASM -o $@ $<
87	$(POST_PROCESS_O)
88
89pics/%.o: $(COMDIR)/sha2/%.c
90	$(COMPILE.c) -I$(COMDIR)/sha2 -o $@ $<
91	$(POST_PROCESS_O)
92
93#
94# Used when building links in /platform/$(PLATFORM)/lib for libmd_psr.so.1
95#
96
97LIBMD_PSR_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib)
98LIBMD_PSR_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MODULE))
99
100LIBMD_PSR64_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64))
101LIBMD_PSR64_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64)/$(MODULE))
102
103INS.slink6 = $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@
104
105INS.slink64 = $(RM) -r $@; $(SYMLINK) ../../../$(PLATFORM)/lib/$(MACH64)/$(MODULE) $@
106
107$(LIBMD_PSR_DIRS):
108	-$(INS.dir.root.bin)
109
110$(LIBMD_PSR_LINKS): $(LIBMD_PSR_DIRS)
111	-$(INS.slink6)
112
113$(LIBMD_PSR64_DIRS):
114	-$(INS.dir.root.bin)
115
116$(LIBMD_PSR64_LINKS): $(LIBMD_PSR64_DIRS)
117	-$(INS.slink64)
118
119include $(SRC)/lib/Makefile.targ
120