xref: /netbsd-src/crypto/external/bsd/heimdal/dist/packages/windows/assembly/NTMakefile (revision b9d004c6cc8d38329417ae29768c81e5f2a296cf)
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.  (See Windows\README).
45!endif
46
47prep:: mk-asm-dirs
48
49# ----------------------------------------------------------------------
50# Heimdal.Kerberos Assembly
51
52ASMKRBDIR=$(ASMDIR)\$(ASMKRBNAME)
53ASMKRBVER=$(VER_PRODUCT_MAJOR).$(VER_PRODUCT_MINOR).$(VER_PRODUCT_AUX).$(VER_PRODUCT_PATCH)
54ASMKRBVER_OLD_BEGIN=$(VER_OLD_BEGIN_MAJOR).$(VER_OLD_BEGIN_MINOR).$(VER_OLD_BEGIN_AUX).$(VER_OLD_BEGIN_PATCH)
55ASMKRBVER_OLD_END=$(VER_OLD_END_MAJOR).$(VER_OLD_END_MINOR).$(VER_OLD_END_AUX).$(VER_OLD_END_PATCH)
56ASMKRBMAN=$(ASMKRBNAME).manifest
57
58ASMKRBBINS=\
59	$(ASMKRBDIR)\heimdal.dll	\
60	$(ASMKRBDIR)\com_err.dll	\
61	$(ASMKRBDIR)\heimntlm.dll	\
62	$(ASMKRBDIR)\gssapi.dll		\
63	$(ASMKRBDIR)\libhdb.dll		\
64	$(ASMKRBDIR)\libkadm5srv.dll	\
65	$(ASMKRBDIR)\heimdal.pdb	\
66	$(ASMKRBDIR)\com_err.pdb	\
67	$(ASMKRBDIR)\heimntlm.pdb	\
68	$(ASMKRBDIR)\gssapi.pdb		\
69	$(ASMKRBDIR)\libhdb.pdb		\
70	$(ASMKRBDIR)\libkadm5srv.pdb
71
72!if ("$(CPU)" == "i386")
73ARCH=32
74!elseif ("$(CPU)" == "x86")
75ARCH=32
76!else
77ARCH=64
78!endif
79
80$(ASMKRBDIR)\$(ASMKRBMAN).nohash: Heimdal.Kerberos.manifest.in
81	$(SED)  -e "s,[@]name[@],$(ASMKRBNAME),g" \
82		-e "s,[@]krbname[@],$(ASMKRBNAME),g" \
83		-e "s,[@]cpu[@],$(MCPU),g" \
84		-e "s,[@]version[@],$(ASMKRBVER),g" \
85		-e "s,[@]pkt[@],$(CODESIGN_PKT),g" \
86		-e "s,[@]arch[@],$(ARCH),g" \
87		< $** > $@
88
89$(ASMKRBDIR)\$(ASMKRBMAN) $(ASMKRBDIR)\$(ASMKRBMAN).cdf: \
90		$(ASMKRBDIR)\$(ASMKRBMAN).nohash $(ASMKRBBINS)
91	-$(RM) $(ASMKRBDIR)\$(ASMKRBMAN)
92	-$(RM) $(ASMKRBDIR)\$(ASMKRBMAN).cdf
93	$(MT) -manifest $(ASMKRBDIR)\$(ASMKRBMAN).nohash -out:$(ASMKRBDIR)\$(ASMKRBMAN) -hashupdate -makecdfs
94
95$(ASMKRBDIR)\$(ASMKRBNAME).cat: $(ASMKRBDIR)\$(ASMKRBMAN).cdf
96	cd $(ASMKRBDIR)
97	$(MAKECAT) $**
98	$(_CODESIGN)
99	$(_CODESIGN_SHA256)
100	cd $(SRCDIR)
101
102asm-krb: \
103	$(APPMANIFEST)	\
104	$(ASMKRBBINS)	\
105	$(ASMKRBDIR)\$(ASMKRBMAN)	\
106	$(ASMKRBDIR)\$(ASMKRBNAME).cat	\
107
108all:: asm-krb
109
110clean::
111	-$(RM) $(ASMKRBDIR)\*.*
112
113!ifdef APPVEYOR
114test::
115	true
116!else
117test::
118	$(MT) -manifest $(ASMKRBDIR)\$(ASMKRBMAN) -validate_manifest
119!endif
120
121{$(BINDIR)}.dll{$(ASMKRBDIR)}.dll:
122	$(CP) $< $@
123	$(DLLPREP_MERGE)
124
125{$(BINDIR)}.pdb{$(ASMKRBDIR)}.pdb:
126	$(CP) $< $@
127
128# ----------------------------------------------------------------------
129# Application manifests
130
131all:: $(APPMANIFEST)
132
133clean::
134	-$(RM) $(APPMANIFEST)
135
136$(APPMANIFEST): Heimdal.Application.manifest.in
137	$(SED)	-e "s,[@]krbname[@],$(ASMKRBNAME),g" \
138		-e "s,[@]krbversion[@],$(ASMKRBVER),g" \
139		-e "s,[@]cpu[@],$(MCPU),g" \
140		-e "s,[@]pkt[@],$(CODESIGN_PKT),g" < $** > $@
141
142!ifdef APPVEYOR
143test::
144	true
145!else
146test::
147	$(MT) -manifest $(APPMANIFEST) -validate_manifest
148!endif
149
150# ----------------------------------------------------------------------
151# Publisher configuration files
152
153POLKRB=policy.$(VER_PRODUCT_MAJOR).$(VER_PRODUCT_MINOR).$(ASMKRBNAME)
154POLKRBDIR=$(ASMDIR)\$(POLKRB)
155POLKRBFILE=$(POLKRBDIR)\$(ASMKRBVER).pol
156POLKRBCAT=$(POLKRBDIR)\$(ASMKRBVER).cat
157
158$(POLKRBFILE): policy.Heimdal.Kerberos.in
159	$(SED)  -e "s,[@]krbname[@],$(ASMKRBNAME),g"	\
160		-e "s,[@]krbversion[@],$(ASMKRBVER),g"	\
161		-e "s,[@]krbverfrom_begin[@],$(ASMKRBVER_OLD_BEGIN),g"	\
162		-e "s,[@]krbverfrom_end[@],$(ASMKRBVER_OLD_END),g"	\
163		-e "s,[@]krbpolname[@],$(POLKRB),g"	\
164		-e "s,[@]cpu[@],$(MCPU),g"	\
165		-e "s,[@]pkt[@],$(CODESIGN_PKT),g" < $** > $@
166
167$(POLKRBFILE).cdf: $(POLKRBFILE)
168	$(MT) -manifest $(POLKRBFILE) -makecdfs
169
170$(POLKRBCAT): $(POLKRBFILE).cdf
171	cd $(POLKRBDIR)
172	$(MAKECAT) $**
173	$(_CODESIGN)
174	$(_CODESIGN_SHA256)
175	cd $(SRCDIR)
176
177all:: $(POLKRBFILE) $(POLKRBCAT)
178
179clean::
180	-$(RM) $(POLKRBDIR)\*.*
181
182# ----------------------------------------------------------------------
183
184.SUFFIXES: .dll .pdb
185
186mk-asm-dirs:
187!  if !exist($(ASMKRBDIR))
188	$(MKDIR) $(ASMKRBDIR)
189!  endif
190!  if !exist($(POLKRBDIR))
191	$(MKDIR) $(POLKRBDIR)
192!  endif
193