1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 KEYCHAIN_PASSWORD
=g0atMaster
6 # This must match the commonName in codesign.cfg.
7 KEYCHAIN_IDENTITY
=untrusted@goat.local
15 executablefat
: executable32 executable64
16 lipo
-create
-output
$@
$^
19 clang
-m32
-shared
-o
$@
$^
22 clang
-m64
-shared
-o
$@
$^
24 libfat.dylib
: lib64.dylib lib32.dylib
25 lipo
-create
-output
$@
$^
28 openssl genrsa
-out
$@
2048
30 codesign.csr
: codesign.key codesign.cfg
31 openssl req
-new
-key
$< -out
$@
-config codesign.cfg
33 codesign.crt
: codesign.csr codesign.key codesign.cfg
34 openssl x509
-req
-signkey codesign.key
-sha256 \
35 -extfile codesign.cfg
-extensions req_attrs
-in
$< -out
$@
37 codesign.keychain
: codesign.key codesign.crt
38 security create-keychain
-p
$(KEYCHAIN_PASSWORD
) $(PWD
)/$@
39 security unlock-keychain
-p
$(KEYCHAIN_PASSWORD
) $(PWD
)/$@
40 certtool i .
/codesign.crt k
=$(PWD
)/$@ r
=.
/codesign.key
42 signedexecutable32
: executable32 codesign.keychain
44 security unlock-keychain
-p
$(KEYCHAIN_PASSWORD
) \
45 $(PWD
)/codesign.keychain
46 codesign
-s
$(KEYCHAIN_IDENTITY
) --keychain
$(PWD
)/codesign.keychain
$@
48 libsigned64.dylib
: lib64.dylib codesign.keychain
50 security unlock-keychain
-p
$(KEYCHAIN_PASSWORD
) \
51 $(PWD
)/codesign.keychain
52 codesign
-s
$(KEYCHAIN_IDENTITY
) --keychain
$(PWD
)/codesign.keychain
$@
54 signedexecutablefat
: executablefat codesign.keychain
56 security unlock-keychain
-p
$(KEYCHAIN_PASSWORD
) \
57 $(PWD
)/codesign.keychain
58 codesign
-s
$(KEYCHAIN_IDENTITY
) --keychain
$(PWD
)/codesign.keychain \
59 $@
--all-architectures