Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / test / data / safe_browsing / mach_o / Makefile
blobfaa2fecaeabc10674f93994289ca8f7b82741afb
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
9 executable32: src.c
10 clang -m32 -o $@ $^
12 executable64: src.c
13 clang -m64 -o $@ $^
15 executablefat: executable32 executable64
16 lipo -create -output $@ $^
18 lib32.dylib: src.c
19 clang -m32 -shared -o $@ $^
21 lib64.dylib: src.c
22 clang -m64 -shared -o $@ $^
24 libfat.dylib: lib64.dylib lib32.dylib
25 lipo -create -output $@ $^
27 codesign.key:
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
43 cp $< $@
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
49 cp $< $@
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
55 cp $< $@
56 security unlock-keychain -p $(KEYCHAIN_PASSWORD) \
57 $(PWD)/codesign.keychain
58 codesign -s $(KEYCHAIN_IDENTITY) --keychain $(PWD)/codesign.keychain \
59 $@ --all-architectures