2016-10-25 05:46:08 +00:00
|
|
|
# Makefile.in for Serval DNA Swift API
|
|
|
|
# vim: noet ts=8 sts=0 sw=8
|
|
|
|
prefix=@prefix@
|
|
|
|
exec_prefix=@exec_prefix@
|
|
|
|
bindir=@bindir@
|
|
|
|
sbindir=@sbindir@
|
|
|
|
sysconfdir=@sysconfdir@
|
|
|
|
localstatedir=@localstatedir@
|
|
|
|
srcdir=@srcdir@
|
|
|
|
abs_builddir=@abs_builddir@
|
|
|
|
|
|
|
|
SWIFT_MODULE_NAME= ServalClient
|
|
|
|
SWIFT_PACKAGE_DIR= $(srcdir)/package
|
|
|
|
SWIFT_BUILD_DIR= $(abs_builddir)/build
|
|
|
|
|
|
|
|
SWIFTC= @SWIFTC@
|
|
|
|
SWIFTCFLAGS= @SWIFTCFLAGS@
|
|
|
|
SWIFTCFLAGS+= -I $(srcdir)
|
|
|
|
|
|
|
|
SWIFT_BUILD= @SWIFT_BUILD@
|
|
|
|
SWIFT_BUILD_FLAGS= $(addprefix -Xswiftc , $(SWIFTCFLAGS))
|
|
|
|
|
|
|
|
DEFS= @DEFS@
|
|
|
|
SWIFTDEFS= $(addprefix -Xcc , $(DEFS))
|
|
|
|
|
2017-12-15 06:40:56 +00:00
|
|
|
.PHONY: all
|
|
|
|
all: check package swift-client-util
|
2016-10-25 05:46:08 +00:00
|
|
|
|
2017-12-15 06:40:56 +00:00
|
|
|
.PHONY: check
|
|
|
|
check: check_swiftc check_swift_build
|
2016-10-25 05:46:08 +00:00
|
|
|
|
2017-12-15 06:40:56 +00:00
|
|
|
.PHONY: check_swiftc
|
2016-10-25 05:46:08 +00:00
|
|
|
check_swiftc:
|
|
|
|
@if [ -z "$(SWIFTC)" ]; then echo "No swift compiler configured" >&2; exit 1; fi
|
|
|
|
@if ! $(SWIFTC) -version >/dev/null; then echo "Swift compiler not executable" >&2; exit 1; fi
|
|
|
|
|
2017-12-15 06:40:56 +00:00
|
|
|
.PHONY: check_swift_build
|
2016-10-25 05:46:08 +00:00
|
|
|
check_swift_build:
|
|
|
|
@if [ -z "$(SWIFT_BUILD)" ]; then echo "No swift package manager configured" >&2; exit 1; fi
|
|
|
|
@if ! $(SWIFT_BUILD) -h >/dev/null; then echo "Swift package manager not executable" >&2; exit 1; fi
|
|
|
|
|
|
|
|
# The Swift 3 package manager --chdir option was replaced with --package-path
|
|
|
|
# in Swift 4, so to support both, avoid the options altogether and use "cd
|
|
|
|
# package-dir && swift build" instead.
|
2017-12-15 06:40:56 +00:00
|
|
|
.PHONY: package
|
|
|
|
package:
|
2016-10-25 05:46:08 +00:00
|
|
|
mkdir -p $(SWIFT_BUILD_DIR) && \
|
|
|
|
cd $(SWIFT_PACKAGE_DIR) && \
|
|
|
|
$(SWIFT_BUILD) --build-path $(SWIFT_BUILD_DIR) $(SWIFT_BUILD_FLAGS) $(SWIFTDEFS)
|
|
|
|
|
2017-12-15 06:40:56 +00:00
|
|
|
$(SWIFT_BUILD_DIR)/debug/libServalClient.a: package
|
2016-10-25 05:46:08 +00:00
|
|
|
|
|
|
|
swift-client-util: $(srcdir)/client_util.swift $(SWIFT_BUILD_DIR)/debug/libServalClient.a
|
|
|
|
@echo SWIFT $@
|
|
|
|
@$(SWIFTC) -emit-executable $(SWIFTCFLAGS) $(SWIFTDEFS) -I $(SWIFT_BUILD_DIR)/debug -o $@ $^
|
|
|
|
|
2017-12-15 06:40:56 +00:00
|
|
|
.PHONY: clean
|
2016-10-25 05:46:08 +00:00
|
|
|
clean:
|
|
|
|
$(RM) -r $(SWIFT_BUILD_DIR)
|
|
|
|
$(RM) swift-client-util
|