-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
44 lines (35 loc) · 1.11 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
EXTRA_SWIFTLINK=
TARGET = .build/debug/libSwiftTcl.so
endif
ifeq ($(UNAME_S),Darwin)
TCLVERSION=8.6.6_2
BREWROOT=/usr/local/Cellar
TCLLIBPATH=$(BREWROOT)/tcl-tk/$(TCLVERSION)/lib
TCLINCPATH=$(BREWROOT)/tcl-tk/$(TCLVERSION)/include
EXTRA_SWIFTLINK=-Xlinker -L/usr/local/lib \
-Xlinker -L$(TCLLIBPATH) \
-Xcc -I$(TCLINCPATH)
TARGET = .build/debug/libSwiftTcl.dylib
PROJECT = SwiftTcl.xcodeproj
endif
default: $(TARGET)
$(TARGET): Package.swift Makefile
swift build $(EXTRA_SWIFTLINK)
project: $(PROJECT)
$(PROJECT): Package.swift Makefile $(TARGET)
swift package $(EXTRA_SWIFTLINK) generate-xcodeproj
@echo "NOTE: You will need to manually set the working directory for the SwiftTclDemo scheme to the root directory of this tree."
@echo "Thanks Apple"
ifeq ($(UNAME_S),Linux)
install: $(TARGET)
cp $(TARGET) /usr/lib/x86_64-linux-gnu
ldconfig /usr/lib/x86_64-linux-gnu/libSwiftTcl.so
endif
ifeq ($(UNAME_S),Darwin)
install: $(TARGET)
cp $(TARGET) /usr/local/lib
endif
clean:
rm -rf $(TARGET) .build Package.pins