Add appveyor.yml for Windows CI via Appveyor
[heimdal.git] / packages / windows / assembly / NTMakefile
blobc6b20b84017d92b248b17793cab8b5ca087c2b45
1 ########################################################################
3 # Copyright (c) 2010, Secure Endpoints Inc.
4 # All rights reserved.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
10 # - Redistributions of source code must retain the above copyright
11 #   notice, this list of conditions and the following disclaimer.
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.
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.
32 RELDIR=packages\windows\assembly
34 !include ../../../windows/NTMakefile.w32
36 # CODESIGN_PKT should be set to the public key token of the code
37 # signing certificate in use.  You can use :
39 # pktextract <path to certificate>
41 # ..to derive the public key token.
43 !ifndef CODESIGN_PKT
44 !  error CODESIGN_PKT should be set to the public key token for codesigning certificate.  (See Windows\README).
45 !endif
47 prep:: mk-asm-dirs
49 # ----------------------------------------------------------------------
50 # Heimdal.Kerberos Assembly
52 ASMKRBDIR=$(ASMDIR)\$(ASMKRBNAME)
53 ASMKRBVER=$(VER_PRODUCT_MAJOR).$(VER_PRODUCT_MINOR).$(VER_PRODUCT_AUX).$(VER_PRODUCT_PATCH)
54 ASMKRBVER_OLD_BEGIN=$(VER_OLD_BEGIN_MAJOR).$(VER_OLD_BEGIN_MINOR).$(VER_OLD_BEGIN_AUX).$(VER_OLD_BEGIN_PATCH)
55 ASMKRBVER_OLD_END=$(VER_OLD_END_MAJOR).$(VER_OLD_END_MINOR).$(VER_OLD_END_AUX).$(VER_OLD_END_PATCH)
56 ASMKRBMAN=$(ASMKRBNAME).manifest
58 ASMKRBBINS=\
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
72 !if ("$(CPU)" == "i386")
73 ARCH=32
74 !elseif ("$(CPU)" == "x86")
75 ARCH=32
76 !else
77 ARCH=64
78 !endif
80 $(ASMKRBDIR)\$(ASMKRBMAN).nohash: Heimdal.Kerberos.manifest.in
81         $(SED)  -e "s,[@]name[@],$(ASMKRBNAME),g" \
82                 -e "s,[@]cpu[@],$(MCPU),g" \
83                 -e "s,[@]version[@],$(ASMKRBVER),g" \
84                 -e "s,[@]pkt[@],$(CODESIGN_PKT),g" \
85                 -e "s,[@]arch[@],$(ARCH),g" \
86                 < $** > $@
88 $(ASMKRBDIR)\$(ASMKRBMAN) $(ASMKRBDIR)\$(ASMKRBMAN).cdf: \
89                 $(ASMKRBDIR)\$(ASMKRBMAN).nohash $(ASMKRBBINS)
90         -$(RM) $(ASMKRBDIR)\$(ASMKRBMAN)
91         -$(RM) $(ASMKRBDIR)\$(ASMKRBMAN).cdf
92         $(MT) -manifest $(ASMKRBDIR)\$(ASMKRBMAN).nohash -out:$(ASMKRBDIR)\$(ASMKRBMAN) -hashupdate -makecdfs
94 $(ASMKRBDIR)\$(ASMKRBNAME).cat: $(ASMKRBDIR)\$(ASMKRBMAN).cdf
95         cd $(ASMKRBDIR)
96         $(MAKECAT) $**
97         $(_CODESIGN)
98         cd $(SRCDIR)
100 asm-krb: \
101         $(APPMANIFEST)  \
102         $(ASMKRBBINS)   \
103         $(ASMKRBDIR)\$(ASMKRBMAN)       \
104         $(ASMKRBDIR)\$(ASMKRBNAME).cat  \
106 all:: asm-krb
108 clean::
109         -$(RM) $(ASMKRBDIR)\*.*
111 !ifdef APPVEYOR
112 test::
113 !else
114 test::
115         $(MT) -manifest $(ASMKRBDIR)\$(ASMKRBMAN) -validate_manifest
116 !endif
118 {$(BINDIR)}.dll{$(ASMKRBDIR)}.dll:
119         $(CP) $< $@
120         $(DLLPREP_MERGE)
122 {$(BINDIR)}.pdb{$(ASMKRBDIR)}.pdb:
123         $(CP) $< $@
125 # ----------------------------------------------------------------------
126 # Application manifests
128 all:: $(APPMANIFEST)
130 clean::
131         -$(RM) $(APPMANIFEST)
133 $(APPMANIFEST): Heimdal.Application.manifest.in
134         $(SED)  -e "s,[@]krbname[@],$(ASMKRBNAME),g" \
135                 -e "s,[@]krbversion[@],$(ASMKRBVER),g" \
136                 -e "s,[@]cpu[@],$(MCPU),g" \
137                 -e "s,[@]pkt[@],$(CODESIGN_PKT),g" < $** > $@
139 !ifdef APPVEYOR
140 test::
141 !else
142 test::
143         $(MT) -manifest $(APPMANIFEST) -validate_manifest
144 !endif
146 # ----------------------------------------------------------------------
147 # Publisher configuration files
149 POLKRB=policy.$(VER_PRODUCT_MAJOR).$(VER_PRODUCT_MINOR).$(ASMKRBNAME)
150 POLKRBDIR=$(ASMDIR)\$(POLKRB)
151 POLKRBFILE=$(POLKRBDIR)\$(ASMKRBVER).pol
152 POLKRBCAT=$(POLKRBDIR)\$(ASMKRBVER).cat
154 $(POLKRBFILE): policy.Heimdal.Kerberos.in
155         $(SED)  -e "s,[@]krbname[@],$(ASMKRBNAME),g"    \
156                 -e "s,[@]krbversion[@],$(ASMKRBVER),g"  \
157                 -e "s,[@]krbverfrom_begin[@],$(ASMKRBVER_OLD_BEGIN),g"  \
158                 -e "s,[@]krbverfrom_end[@],$(ASMKRBVER_OLD_END),g"      \
159                 -e "s,[@]krbpolname[@],$(POLKRB),g"     \
160                 -e "s,[@]cpu[@],$(MCPU),g"      \
161                 -e "s,[@]pkt[@],$(CODESIGN_PKT),g" < $** > $@
163 $(POLKRBFILE).cdf: $(POLKRBFILE)
164         $(MT) -manifest $(POLKRBFILE) -makecdfs
166 $(POLKRBCAT): $(POLKRBFILE).cdf
167         cd $(POLKRBDIR)
168         $(MAKECAT) $**
169         $(_CODESIGN)
170         cd $(SRCDIR)
172 all:: $(POLKRBFILE) $(POLKRBCAT)
174 clean::
175         -$(RM) $(POLKRBDIR)\*.*
177 # ----------------------------------------------------------------------
179 .SUFFIXES: .dll .pdb
181 mk-asm-dirs:
182 !  if !exist($(ASMKRBDIR))
183         $(MKDIR) $(ASMKRBDIR)
184 !  endif
185 !  if !exist($(POLKRBDIR))
186         $(MKDIR) $(POLKRBDIR)
187 !  endif