xref: /netbsd-src/crypto/external/bsd/heimdal/dist/packages/windows/assembly/NTMakefile (revision a5847cc334d9a7029f6352b847e9e8d71a0f9e0c)
1########################################################################
2#
3# Copyright (c) 2010, Secure Endpoints Inc.
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9#
10# - Redistributions of source code must retain the above copyright
11#   notice, this list of conditions and the following disclaimer.
12#
13# - Redistributions in binary form must reproduce the above copyright
14#   notice, this list of conditions and the following disclaimer in
15#   the documentation and/or other materials provided with the
16#   distribution.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29# POSSIBILITY OF SUCH DAMAGE.
30#
31
32RELDIR=packages\windows\assembly
33
34!include ../../../windows/NTMakefile.w32
35
36# CODESIGN_PKT should be set to the public key token of the code
37# signing certificate in use.  You can use :
38#
39# pktextract <path to certificate>
40#
41# ..to derive the public key token.
42#
43!ifndef CODESIGN_PKT
44!  error CODESIGN_PKT should be set to the public key token for codesigning certificate
45!endif
46
47prep:: mk-asm-dirs
48
49# ----------------------------------------------------------------------
50# Heimdal.Kerberos Assembly
51
52ASMKRBDIR=$(ASMDIR)\Heimdal.Kerberos
53ASMKRBVER=$(VER_PRODUCT_MAJOR).$(VER_PRODUCT_MINOR).$(VER_PRODUCT_AUX).$(VER_PRODUCT_PATCH)
54ASMKRBMAN=$(ASMKRBNAME).manifest
55
56ASMKRBBINS=\
57	$(ASMKRBDIR)\heimdal.dll	\
58	$(ASMKRBDIR)\com_err.dll	\
59	$(ASMKRBDIR)\heimntlm.dll	\
60	$(ASMKRBDIR)\gssapi.dll		\
61	$(ASMKRBDIR)\heimdal.pdb	\
62	$(ASMKRBDIR)\com_err.pdb	\
63	$(ASMKRBDIR)\heimntlm.pdb	\
64	$(ASMKRBDIR)\gssapi.pdb
65
66$(ASMKRBDIR)\$(ASMKRBMAN).nohash: Heimdal.Kerberos.manifest.in
67	$(SED)  -e "s,[@]name[@],$(ASMKRBNAME),g" \
68		-e "s,[@]cpu[@],$(MCPU),g" \
69		-e "s,[@]version[@],$(ASMKRBVER),g" \
70		-e "s,[@]pkt[@],$(CODESIGN_PKT),g" < $** > $@
71
72$(ASMKRBDIR)\$(ASMKRBMAN) $(ASMKRBDIR)\$(ASMKRBMAN).cdf: \
73		$(ASMKRBDIR)\$(ASMKRBMAN).nohash $(ASMKRBBINS)
74	-$(RM) $(ASMKRBDIR)\$(ASMKRBMAN)
75	-$(RM) $(ASMKRBDIR)\$(ASMKRBMAN).cdf
76	$(MT) -manifest $(ASMKRBDIR)\$(ASMKRBMAN).nohash -out:$(ASMKRBDIR)\$(ASMKRBMAN) -hashupdate -makecdfs
77
78$(ASMKRBDIR)\$(ASMKRBNAME).cat: $(ASMKRBDIR)\$(ASMKRBMAN).cdf
79	cd $(ASMKRBDIR)
80	$(MAKECAT) $**
81	$(_CODESIGN)
82#	$(RM) $(ASMKRBMAN).cdf
83#	$(RM) $(ASMKRBMAN).nohash
84	cd $(SRCDIR)
85
86asm-krb: \
87	$(APPMANIFEST)	\
88	$(ASMKRBBINS)	\
89	$(ASMKRBDIR)\$(ASMKRBMAN)	\
90	$(ASMKRBDIR)\$(ASMKRBNAME).cat	\
91
92all:: asm-krb
93
94clean::
95	-$(RM) $(ASMKRBDIR)\*.*
96
97test::
98	$(MT) -manifest $(ASMKRBDIR)\$(ASMKRBMAN) -validate_manifest
99
100{$(BINDIR)}.dll{$(ASMKRBDIR)}.dll:
101	$(CP) $< $@
102	$(DLLPREP_MERGE)
103
104{$(BINDIR)}.pdb{$(ASMKRBDIR)}.pdb:
105	$(CP) $< $@
106
107# ----------------------------------------------------------------------
108# Application manifests
109
110all:: $(APPMANIFEST)
111
112clean::
113	-$(RM) $(APPMANIFEST)
114
115$(APPMANIFEST): Heimdal.Application.manifest.in
116	$(SED)	-e "s,[@]krbname[@],$(ASMKRBNAME),g" \
117		-e "s,[@]krbversion[@],$(ASMKRBVER),g" \
118		-e "s,[@]cpu[@],$(MCPU),g" \
119		-e "s,[@]pkt[@],$(CODESIGN_PKT),g" < $** > $@
120
121test::
122	$(MT) -manifest $(APPMANIFEST) -validate_manifest
123
124# ----------------------------------------------------------------------
125# Publisher configuration files
126
127POLKRB=policy.$(VER_PRODUCT_MAJOR).$(VER_PRODUCT_MINOR).Heimdal.Kerberos
128POLKRBDIR=$(ASMDIR)\$(POLKRB)
129POLKRBFILE=$(POLKRBDIR)\$(ASMKRBVER).pol
130POLKRBCAT=$(POLKRBDIR)\$(ASMKRBVER).cat
131
132$(POLKRBFILE): policy.Heimdal.Kerberos.in
133	$(SED)  -e "s,[@]krbname[@],$(ASMKRBNAME),g"	\
134		-e "s,[@]krbversion[@],$(ASMKRBVER),g"	\
135		-e "s,[@]krbverfrom[@],$(VER_PRODUCT_MAJOR).$(VER_PRODUCT_MINOR),g"	\
136		-e "s,[@]krbpolname[@],$(POLKRB),g"	\
137		-e "s,[@]cpu[@],$(MCPU),g"	\
138		-e "s,[@]pkt[@],$(CODESIGN_PKT),g" < $** > $@
139
140$(POLKRBFILE).cdf: $(POLKRBFILE)
141	$(MT) -manifest $(POLKRBFILE) -makecdfs
142
143$(POLKRBCAT): $(POLKRBFILE).cdf
144	cd $(POLKRBDIR)
145	$(MAKECAT) $**
146	$(_CODESIGN)
147	cd $(SRCDIR)
148
149all:: $(POLKRBFILE) $(POLKRBCAT)
150
151clean::
152	-$(RM) $(POLKRBDIR)\*.*
153
154# ----------------------------------------------------------------------
155
156.SUFFIXES: .dll .pdb
157
158mk-asm-dirs:
159!  if !exist($(ASMKRBDIR))
160	$(MKDIR) $(ASMKRBDIR)
161!  endif
162!  if !exist($(POLKRBDIR))
163	$(MKDIR) $(POLKRBDIR)
164!  endif
165