建立純 swift module

純的歐!

swiftmodule and swiftdoc use the LLVM bitstream container format
LLVM bitstream

Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Creation of pure Swift module
# http://railsware.com/blog/2014/06/26/creation-of-pure-swift-module/
# Didn't set `-target` and `-sdk` so defualt target is for macosx

.PHONY = static dynamic clean

static:
swiftc \
Logger.swift \
-emit-library \
-emit-object \
-module-name Logger
mv Logger.o module/Logger.static
ar rcs module/libLogger.a module/Logger.static

dynamic:
swiftc \
Logger.swift \
-emit-library \
-emit-module \
-module-name Logger \
-emit-module-path module/Logger.swiftmodule \
-o module/Logger.dynamic

clean:
rm -rf module/*