Skip to content

Commit b01929c

Browse files
committed
Provide a Makefile for the Xcode-averse/sane
1 parent 161c83c commit b01929c

File tree

6 files changed

+43
-11
lines changed

6 files changed

+43
-11
lines changed

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CC=gcc
2+
CFLAGS=-std=c99 -framework Security -framework CoreFoundation
3+
4+
PROGRAM = splitring
5+
VPATH = splitring/
6+
7+
splitring: src/main.c
8+
$(CC) $(CFLAGS) -o $(PROGRAM) src/main.c
9+
10+
clean:
11+
rm $(PROGRAM)
12+
13+
all: splitring

README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ heart's desire.
2323

2424
# Usage
2525

26-
usage: splitring [--verbose] [--dry-run]
26+
usage: splitring [-v | --verbose] [-d | --dry-run]
2727
[--to-keychain=<path>] keychain-file ...
2828

2929
--verbose Explain what's happening.
@@ -45,3 +45,24 @@ heart's desire.
4545
Copying item named 'Safari Forms AutoFill' (2 of 4)... copied
4646
Copying item named 'skype' (3 of 4)... copied
4747
Copying item named 'photosmart' (4 of 4)... copied
48+
49+
# Building
50+
51+
To build `splitring`, you can use Xcode (open splitring.xcodeproj),
52+
the `xcodebuild` tool, or `make`:
53+
54+
$ make
55+
$ ./splitring
56+
57+
If you don't `codesign` the binary, you'll see an extra-scary message from OS X:
58+
59+
> "The authenticity of "splitring" cannot be verified. Do you want to
60+
> allow access to this item?"
61+
62+
This doesn't affect operation negatively.
63+
64+
To codesign, obtain or generate a certificate by following
65+
[these instructions](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-SW1)
66+
and then run:
67+
68+
$ codesign -s 'Name of Your Identity' splitring

splitring.xcodeproj/project.pbxproj

+5-9
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
isa = PBXGroup;
5353
children = (
5454
539116E917F9033000E535BC /* Security.framework */,
55-
539116DF17F8FF1B00E535BC /* splitring */,
55+
539116DF17F8FF1B00E535BC /* src */,
5656
539116DC17F8FF1B00E535BC /* Frameworks */,
5757
539116DB17F8FF1A00E535BC /* Products */,
5858
);
@@ -74,14 +74,14 @@
7474
name = Frameworks;
7575
sourceTree = "<group>";
7676
};
77-
539116DF17F8FF1B00E535BC /* splitring */ = {
77+
539116DF17F8FF1B00E535BC /* src */ = {
7878
isa = PBXGroup;
7979
children = (
8080
539116E017F8FF1B00E535BC /* main.c */,
8181
4AD459EC17FCD55100934B17 /* Info.plist */,
8282
539116E217F8FF1B00E535BC /* splitring.1 */,
8383
);
84-
path = splitring;
84+
path = src;
8585
sourceTree = "<group>";
8686
};
8787
/* End PBXGroup section */
@@ -204,30 +204,26 @@
204204
539116E717F8FF1B00E535BC /* Debug */ = {
205205
isa = XCBuildConfiguration;
206206
buildSettings = {
207-
CODE_SIGN_IDENTITY = "Phillip Calvin Fake Code Signing";
208207
OTHER_LDFLAGS = (
209208
"-sectcreate",
210209
__TEXT,
211210
__info_plist,
212-
splitring/Info.plist,
211+
src/Info.plist,
213212
);
214213
PRODUCT_NAME = "$(TARGET_NAME)";
215-
PROVISIONING_PROFILE = "";
216214
};
217215
name = Debug;
218216
};
219217
539116E817F8FF1B00E535BC /* Release */ = {
220218
isa = XCBuildConfiguration;
221219
buildSettings = {
222-
CODE_SIGN_IDENTITY = "Phillip Calvin Fake Code Signing";
223220
OTHER_LDFLAGS = (
224221
"-sectcreate",
225222
__TEXT,
226223
__info_plist,
227-
splitring/Info.plist,
224+
src/Info.plist,
228225
);
229226
PRODUCT_NAME = "$(TARGET_NAME)";
230-
PROVISIONING_PROFILE = "";
231227
};
232228
name = Release;
233229
};
File renamed without changes.

splitring/main.c renamed to src/main.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int main(int argc, char * const argv[]) {
123123
}
124124

125125
void SRPrintUsage() {
126-
fprintf(stderr, "usage: splitring [--verbose] [--dry-run] [--to-keychain=<path>] keychain-file ...");
126+
fprintf(stderr, "usage: splitring [-v | --verbose] [-d | --dry-run] [--to-keychain=<path>] keychain-file ...\n");
127127
}
128128

129129
SecKeychainRef SROpenKeychain(char* path) {
@@ -217,6 +217,8 @@ void SRCopyItemsToKeychain(CFArrayRef items, SecKeychainRef keychain, int verbos
217217
SecKeychainItemRef item = (SecKeychainItemRef)CFDictionaryGetValue(info, kSecValueRef);
218218
if (!dryRun) {
219219
SRCopyKeychainItemToKeychain(item, keychain);
220+
} else {
221+
fprintf(stderr, "\n");
220222
}
221223
}
222224
}
File renamed without changes.

0 commit comments

Comments
 (0)