forked from Azure/iotedge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak the build to support building on Yocto Thud (Azure#1196)
* Add Makefile with `make dist` to generate a source tarball * Add flag to skip libiothsm build * Use env::var_os * Address review comments
- Loading branch information
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright (c) Microsoft. All rights reserved. | ||
|
||
TARGET=target | ||
|
||
_version:=$(shell cat edgelet/version.txt) | ||
VERSION?=${_version} | ||
REVISION?=1 | ||
|
||
# Converts debian versioning to rpm version | ||
# deb 1.0.1~dev100 ~> rpm 1.0.1-0.1.dev100 | ||
RPM_VERSION?=$(word 1,$(subst ~, , $(VERSION))) | ||
_release=$(or $(and $(word 2,$(subst ~, ,$1)),0.${REVISION}.$(word 2,$(subst ~, ,$1))),${REVISION}) | ||
RPM_RELEASE?=$(call _release, ${VERSION}) | ||
|
||
PACKAGE_NAME=iotedge | ||
PACKAGE="$(PACKAGE_NAME)-$(RPM_VERSION)" | ||
|
||
GIT=git | ||
GZIP=gzip | ||
MKDIR_P=mkdir -p | ||
|
||
$(TARGET): | ||
$(MKDIR_P) $(TARGET) | ||
|
||
$(TARGET)/$(PACKAGE).tar.gz: $(TARGET) | ||
@echo Running git archive... | ||
@$(GIT) archive --prefix=$(PACKAGE)/ -o $(TARGET)/$(PACKAGE).tar $(VERSION) 2> /dev/null || (echo 'Warning: $(VERSION) does not exist.' && $(GIT) archive --prefix=$(PACKAGE)/ -o $(TARGET)/$(PACKAGE).tar HEAD) | ||
@echo Running git archive submodules... | ||
p=`pwd` && (echo .; git submodule foreach --recursive) | while read entering path; do \ | ||
temp="$${path%\'}"; \ | ||
temp="$${temp#\'}"; \ | ||
path=$$temp; \ | ||
[ "$$path" = "" ] && continue; \ | ||
(cd $$path && $(GIT) archive --prefix=$(PACKAGE)/$$path/ HEAD > $$p/$(TARGET)/tmp.tar && tar --concatenate --file=$$p/$(TARGET)/$(PACKAGE).tar $$p/$(TARGET)/tmp.tar && rm $$p/$(TARGET)/tmp.tar); \ | ||
done | ||
gzip -f $(TARGET)/$(PACKAGE).tar | ||
rm -f $(TARGET)/$(PACKAGE).tar | ||
|
||
# Produces a tarball of the source including all git submodules | ||
dist: $(TARGET)/$(PACKAGE).tar.gz | ||
|
||
# Removes the build directory | ||
clean: | ||
rm -rf $(TARGET) | ||
|
||
.PHONY: clean dist version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters