xref: /illumos-gate/usr/src/lib/libsasl/Makefile (revision 2871f9cf)
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# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
26#
27
28include	../Makefile.lib
29
30HDRS=		sasl.h		saslplug.h	saslutil.h	prop.h
31HDRDIR=		include
32ROOTHDRDIR=	$(ROOT)/usr/include/sasl
33
34SUBDIRS =	$(MACH)
35$(BUILD64)SUBDIRS += $(MACH64)
36
37all :=		TARGET= all
38clean :=	TARGET= clean
39clobber :=	TARGET= clobber
40install :=	TARGET= install
41lint :=		TARGET= lint
42
43LIBRARY=        libsasl.a
44POFILE=         $(LIBRARY:.a=.po)
45MSGFILES=	lib/canonusr.c lib/checkpw.c lib/client.c lib/common.c \
46			lib/external.c lib/server.c lib/seterror.c \
47			plugin/plugin_common.c \
48			$(SRC)/lib/sasl_plugins/cram/cram.c \
49			$(SRC)/lib/sasl_plugins/digestmd5/digestmd5.c \
50			$(SRC)/lib/sasl_plugins/gssapi/gssapi.c \
51			$(SRC)/lib/sasl_plugins/login/login.c \
52			$(SRC)/lib/sasl_plugins/plain/plain.c
53
54.KEEP_STATE:
55
56all clean clobber install lint: $(SUBDIRS)
57
58all install: THIRDPARTYLICENSE
59
60install_h:	$(ROOTHDRS)
61
62check:	$(CHECKHDRS)
63
64$(POFILE): $(MSGFILES)
65	$(BUILDPO.msgfiles)
66
67_msg: $(MSGDOMAINPOFILE)
68
69include $(SRC)/Makefile.msg.targ
70
71$(SUBDIRS): FRC
72	@cd $@; pwd; $(MAKE) $(TARGET)
73
74FRC:
75
76THIRDPARTYLICENSE: LICENSE.txt
77	$(SED) -n '/Carnegie Mellon/,$$p' LICENSE.txt > $@
78
79CLOBBERFILES += THIRDPARTYLICENSE
80
81# EXPORT DELETE START
82# CRYPT DELETE START
83# Special target to clean up the source tree for export distribution
84# Warning: This target changes the source tree
85EXPORT_SRC:
86	$(RM) Makefile+ \
87		lib/client.c+ \
88		lib/server.c+ \
89		lib/common.c+ \
90		lib/saslint.h+ \
91		include/plugin_common.h+
92
93	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
94		< lib/client.c > lib/client.c+
95	$(MV) lib/client.c+ lib/client.c
96
97	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
98		< lib/server.c > lib/server.c+
99	$(MV) lib/server.c+ lib/server.c
100
101	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
102		< lib/common.c > lib/common.c+
103	$(MV) lib/common.c+ lib/common.c
104
105	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
106		< lib/saslint.h > lib/saslint.h+
107	$(MV) lib/saslint.h+ lib/saslint.h
108
109	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
110		< include/plugin_common.h > include/plugin_common.h+
111	$(MV) include/plugin_common.h+ include/plugin_common.h
112
113	$(SED) -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
114		< Makefile > Makefile+
115	$(MV) Makefile+ Makefile
116
117	$(CHMOD) 444 Makefile \
118		lib/client.c \
119		lib/server.c \
120		lib/common.c \
121		lib/saslint.h \
122		include/plugin_common.h
123
124CRYPT_SRC:
125	$(RM) Makefile+ lib/common.c+
126
127	$(SED) -e "/CRYPT DELETE START/,/CRYPT DELETE END/d" \
128		< lib/common.c | $(SED) -e "/EXPORT DELETE/d" \
129		> lib/common.c+
130	$(MV) lib/common.c+ lib/common.c
131
132	$(SED) -e "/CRYPT DELETE START/,/CRYPT DELETE END/d" \
133		< lib/client.c | $(SED) -e "/EXPORT DELETE/d" \
134		> lib/client.c+
135	$(MV) lib/client.c+ lib/client.c
136
137	$(SED) -e "/CRYPT DELETE START/,/CRYPT DELETE END/d" \
138		< lib/server.c | $(SED) -e "/EXPORT DELETE/d" \
139		> lib/server.c+
140	$(MV) lib/server.c+ lib/server.c
141
142	$(SED) -e "/CRYPT DELETE START/,/CRYPT DELETE END/d" \
143		< lib/saslint.h | $(SED) -e "/EXPORT DELETE/d" \
144		> lib/saslint.h+
145	$(MV) lib/saslint.h+ lib/saslint.h
146
147	$(SED) -e "/CRYPT DELETE START/,/CRYPT DELETE END/d" \
148		< include/plugin_common.h | $(SED) -e "/EXPORT DELETE/d" \
149		> include/plugin_common.h+
150	$(MV) include/plugin_common.h+ include/plugin_common.h
151
152	$(SED) -e "/^# CRYPT DELETE START/,/^# CRYPT DELETE END/d" \
153		< Makefile | $(SED) -e "/^# EXPORT DELETE/d" > Makefile+
154	$(MV) Makefile+ Makefile
155
156	$(CHMOD) 444 Makefile \
157		lib/client.c \
158		lib/server.c \
159		lib/common.c \
160		lib/saslint.h \
161		include/plugin_common.h
162
163# CRYPT DELETE END
164# EXPORT DELETE END
165
166include ../Makefile.targ
167
168.PARALLEL: $(SUBDIRS)
169