-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·46 lines (40 loc) · 1.31 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
45
46
SHELL = /bin/bash
REPODIR = $(shell pwd)
BUILDDIR = $(REPODIR)/.build
RELEASEBUILDDIR = $(BUILDDIR)/release
TEMPPRODUCTDIR = $(BUILDDIR)/_PRODUCT
PRODUCTDIR = $(RELEASEBUILDDIR)/_PRODUCT
.DEFAULT_GOAL = all
.PHONY: all
all: build
.PHONY: build
build:
@swift build \
-c release \
--disable-sandbox \
--build-path "$(BUILDDIR)"
@rm -rf "$(PRODUCTDIR)"
@rm -rf "$(TEMPPRODUCTDIR)"
@mkdir -p "$(TEMPPRODUCTDIR)"
@mkdir -p "$(TEMPPRODUCTDIR)/include/fastfood"
@cp -a "$(RELEASEBUILDDIR)/." "$(TEMPPRODUCTDIR)/include/fastfood"
@cp -a "$(TEMPPRODUCTDIR)/." "$(PRODUCTDIR)"
@rm -rf "$(TEMPPRODUCTDIR)"
@mkdir -p "$(PRODUCTDIR)/bin"
@rm -rf $(PRODUCTDIR)/include/fastfood/*.build
@rm -rf $(PRODUCTDIR)/include/fastfood/*.product
@rm -rf $(PRODUCTDIR)/include/fastfood/ModuleCache
@rm -f "$(PRODUCTDIR)/include/fastfood/fastfood.swiftdoc"
@rm -f "$(PRODUCTDIR)/include/fastfood/fastfood.swiftmodule"
@mv "$(PRODUCTDIR)/include/fastfood/fastfood" "$(PRODUCTDIR)/bin"
@rm -f "$(RELEASEBUILDDIR)/fastfood"
@ln -s "$(PRODUCTDIR)/bin/fastfood" "$(RELEASEBUILDDIR)/fastfood"
@cp "$(REPODIR)/LICENSE" "$(PRODUCTDIR)/LICENSE"
.PHONY: package
package:
rm -f "$(PRODUCTDIR)/fastfood.zip"
cd $(PRODUCTDIR) && zip -r ./fastfood.zip ./
echo "ZIP created at: $(PRODUCTDIR)/fastfood.zip"
.PHONY: clean
clean:
@rm -rf "$(BUILDDIR)"