forked from dduan/Swift-Framework-Without-Xcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (30 loc) · 684 Bytes
/
Copy pathMakefile
File metadata and controls
33 lines (30 loc) · 684 Bytes
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
27
28
29
30
31
32
33
PWD=$(shell pwd)
APP_NAME=printanswer
LIB_PATH=Frameworks
BUILD_PATH=$(PWD)/bulid
LIB_BUILD_PATH=$(BUILD_PATH)/$(LIB_PATH)
LIBS = Answer
SOURCES = main.swift
bulid: clean $(LIBS)
swiftc $(SOURCES) \
-o $(BUILD_PATH)/$(APP_NAME) \
-I $(LIB_BUILD_PATH) \
-L $(LIB_BUILD_PATH) \
-Xlinker -rpath \
-Xlinker @executable_path/ \
-v
$(LIBS):
mkdir -p $(LIB_BUILD_PATH)
swiftc \
-emit-library \
-o $(LIB_BUILD_PATH)/lib$@.dylib \
-Xlinker -install_name \
-Xlinker @rpath/$(LIB_PATH)/lib$@.dylib \
-emit-module \
-emit-module-path $(LIB_BUILD_PATH)/$@.swiftmodule \
-module-name $@ \
-module-link-name $@ \
-v \
Frameworks/$@/*.swift
clean:
rm -rf build