forked from madler/zlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (42 loc) · 1.43 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
47
48
49
50
51
52
53
# Common options
CONFIG ?= Release
RELEASE ?= macOSJazz
SANITIZE ?= 0
# OSX build options
OSX_SDK ?= macosx.internal
OSX_ARCHS ?= i386 x86_64 x86_64h
# IOS build options
IOS_SDK ?= iphoneos.internal
IOS_ARCHS ?= arm64 arm64e
# WatchOS build options
WOS_SDK ?= watchos.internal
WOS_ARCHS ?= armv7k arm64_32
# Buildit record name
BUILDIT_RECORD_NAME ?= zlib
ifeq ($(SANITIZE),0)
SANITIZER_OPT :=
else
SANITIZER_OPT := -enableAddressSanitizer YES
endif
DOC_DSTROOT ?= /tmp/bnns_doc.dst
LOG_EXT := > ./build/log.txt 2>&1 || ( cat ./build/log.txt && exit 1 )
ARCH_DATE := $(shell date +"%Y%m%d")
ARCH_FILE := $(HOME)/BNNS-$(ARCH_DATE).tgz
define PRINT_OPT
@echo "\033[1;34m$(1)\033[0m = $(2)"
endef
all: osx
osx:
@[ -d ./build ] || mkdir -p ./build
xcodebuild -sdk $(OSX_SDK) -configuration $(CONFIG) -target all ARCHS="$(OSX_ARCHS)" $(SANITIZER_OPT) $(LOG_EXT)
ios:
@[ -d ./build ] || mkdir -p ./build
xcodebuild -sdk $(IOS_SDK) -configuration $(CONFIG) -target all ARCHS="$(IOS_ARCHS)" $(SANITIZER_OPT) $(LOG_EXT)
wos:
@[ -d ./build ] || mkdir -p ./build
xcodebuild -sdk $(WOS_SDK) -configuration $(CONFIG) -target all ARCHS="$(WOS_ARCHS)" $(SANITIZER_OPT) $(LOG_EXT)
buildit-archive: clean
xbs buildit . -noverify -project zlib -update Prevailing$(RELEASE) -buildAllAliases -buildRecordName zlib -archive
@cd /tmp/$(BUILDIT_RECORD_NAME).roots/BuildRecords && find . -type f -ls | egrep '\/(SDKContent)?Root\/'
clean:
/bin/rm -rf ./build