xref: /illumos-gate/usr/src/lib/gss_mechs/mech_dh/backend/Makefile (revision 749f21d359d8fbd020c974a1a5227316221bfc9c)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23#pragma ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# lib/gss_mechs/mech_dh/backend/Makefile
29#
30PROTOCOL_DIR = mech
31SUBDIRS = $(MACH) $(BUILD64) $(MACH64)
32
33PROTO_FILE = dhmech_prot.x
34DERIVED_FILES = mech/dhmech_prot.h mech/xdr_token.c
35CLEANFILES += $(DERIVED_FILES)
36
37# include library definitions
38include ../../../Makefile.lib
39
40TEXT_DOMAIN =	SUNW_OST_NETRPC
41POFILES =	generic.po
42POFILE = mech_dh.po
43
44SED=    sed
45CP=     cp
46GREP=   grep
47
48all :=          TARGET= all
49clean :=        TARGET= clean
50clobber :=      TARGET= clobber
51delete :=       TARGET= delete
52install :=      TARGET= install
53lint :=         TARGET= lint
54catalog :=      TARGET= catalog
55package :=      TARGET= package
56_msg :=		TARGET= _msg
57
58.KEEP_STATE:
59all:            $(DERIVED_FILES) .WAIT $(SUBDIRS)
60
61install:        $(DERIVED_FILES) .WAIT $(SUBDIRS)
62
63clean clobber delete lint catalog package:      $(SUBDIRS)
64
65#
66# Rules for building the derived files
67#
68mech/xdr_token.c: $(PROTOCOL_DIR)/dhmech_prot.x
69	$(RPCGEN) -c $(PROTOCOL_DIR)/dhmech_prot.x |\
70	$(SED) -e 's!$(PROTOCOL_DIR)/dhmech_prot.h!dhmech_prot.h!' > $@
71
72mech/dhmech_prot.h: mech/dhmech_prot.x
73	$(RPCGEN) -h $(PROTOCOL_DIR)/dhmech_prot.x > $@
74
75# include library targets
76include ../../../Makefile.targ
77
78# EXPORT DELETE START
79# Special target to clean up the source tree for export distribution
80# Warning: This target changes the source tree
81EXPORT_SRC:
82	$(RM) Makefile+ Makefile.com+ mech/crypto.c+ mech/dhmech.c+
83	$(SED) -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d"	\
84			< Makefile > Makefile+
85	$(MV) Makefile+ Makefile
86	$(SED) -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d"	\
87			< Makefile.com > Makefile.com+
88	$(MV) Makefile.com+ Makefile.com
89	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
90		< mech/crypto.c > mech/crypto.c+
91	$(MV) mech/crypto.c+ mech/crypto.c
92	$(SED) -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
93		< mech/dhmech.c > mech/dhmech.c+
94	$(MV) mech/dhmech.c+ mech/dhmech.c
95	$(CHMOD) 444 Makefile Makefile.com mech/crypto.c mech/dhmech.c
96
97# CRYPT DELETE START
98CRYPT_SRC:
99	$(RM) Makefile+ Makefile.com+ mech/dhmech.c+
100	$(SED) -e "/^# CRYPT DELETE START/,/^# CRYPT DELETE END/d"	\
101			< Makefile				\
102	   | $(SED) -e "/EXPORT DELETE/d"				\
103			> Makefile+
104	$(MV) Makefile+ Makefile
105	$(SED) -e "/^# CRYPT DELETE START/,/^# CRYPT DELETE END/d"	\
106			< Makefile.com				\
107	   | $(SED) -e "/EXPORT DELETE/d"				\
108			> Makefile.com+
109	$(MV) Makefile.com+ Makefile.com
110	$(SED) -e "/CRYPT DELETE START/,/CRYPT DELETE END/d" \
111			< mech/dhmech.c > mech/dhmech.c+
112	$(MV) mech/dhmech.c+ mech/dhmech.c
113	$(CHMOD) 444 Makefile Makefile.com mech/dhmech.c
114
115# CRYPT DELETE END
116# EXPORT DELETE END
117
118_msg: $(MSGDOMAIN) $(POFILE)
119	$(RM) $(MSGDOMAIN)/$(POFILE)
120	$(CP) $(POFILE) $(MSGDOMAIN)
121
122$(POFILE): $(DERIVED_FILES) .WAIT $(POFILES)
123	$(RM) $@
124	$(CAT) $(POFILES) > $@
125
126generic.po:
127	$(RM) messages.po
128	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext mech/*.[ch]`
129	$(SED) "/^domain/d" messages.po > $@
130	$(RM) messages.po
131
132$(MSGDOMAIN):
133	$(INS.dir)
134
135$(MACH) $(MACH64):      FRC
136	@cd $@; pwd; $(MAKE) $(TARGET)
137
138FRC:
139