File tree 1 file changed +27
-28
lines changed
1 file changed +27
-28
lines changed Original file line number Diff line number Diff line change 1
- #
2
- # Makefile
3
- # swift-create-xcframework
4
- #
5
- # Created by Rob Amos on 7/5/20.
6
- #
1
+ SHELL = /bin/bash
7
2
8
- PRODUCT := swift-create-xcframework
9
- INSTALL_DIR := /usr/local/bin
3
+ prefix ?= /usr/local
4
+ bindir ?= $(prefix ) /bin
5
+ libdir ?= $(prefix ) /lib
6
+ srcdir = Sources
10
7
11
- # Override this on the command line if you need to
12
- BUILD_FLAGS :=
8
+ REPODIR = $(shell pwd)
9
+ BUILDDIR = $(REPODIR ) /.build
10
+ SOURCES = $(wildcard $(srcdir ) /** /* .swift)
13
11
14
- .PHONY : build build-release install install-debug
12
+ .DEFAULT_GOAL = all
15
13
16
- default : build
17
- build : build-debug
14
+ swift-create-xcframework : $(SOURCES )
15
+ @swift build \
16
+ -c release \
17
+ --disable-sandbox \
18
+ --build-path " $( BUILDDIR) "
18
19
19
- # Release Builds
20
+ .PHONY : install
21
+ install : swift-create-xcframework
22
+ @install -d " $( bindir) "
23
+ @install " $( wildcard $( BUILDDIR) /** /release/swift-create-xcframework) " " $( bindir) "
20
24
21
- build-release : $(wildcard Sources/* /* .swift)
22
- swift build $(BUILD_FLAGS ) --configuration release
25
+ .PHONY : uninstall
26
+ uninstall :
27
+ @rm -rf " $( bindir) /swift-create-xcframework"
23
28
24
- install : build-release
25
- cp .build/release/swift-create-xcframework $(INSTALL_DIR ) /$(PRODUCT )
26
- touch -c $(INSTALL_DIR ) /$(PRODUCT )
27
-
28
- # Debug builds
29
-
30
- build-debug : $(wildcard Sources/* /* .swift)
31
- swift build $(BUILD_FLAGS ) --configuration debug
32
-
33
- install-debug : build-debug
34
- cp .build/debug/swift-create-xcframework $(INSTALL_DIR ) /$(PRODUCT )
35
- touch -c $(INSTALL_DIR ) /$(PRODUCT )
29
+ .PHONY : clean
30
+ distclean :
31
+ @rm -f $(BUILDDIR ) /release
36
32
33
+ .PHONY : clean
34
+ clean : distclean
35
+ @rm -rf $(BUILDDIR )
You can’t perform that action at this time.
0 commit comments