-
Notifications
You must be signed in to change notification settings - Fork 256
/
Makefile
44 lines (30 loc) · 1.49 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
default: clean init build
EXTENSIONS = \
CustomScript \
DSC \
OSPatching \
VMBackup
clean:
rm -rf build
init:
@mkdir -p build
build: init $(EXTENSIONS) buildVMAccess
define make-extension-zip
$(eval NAME = $(shell grep -Pom1 "(?<=<Type>)[^<]+" $@/manifest.xml))
$(eval VERSION = $(shell grep -Pom1 "(?<=<Version>)[^<]+" $@/manifest.xml))
@echo "Building '$(NAME)-$(VERSION).zip' ..."
@cd $@ && find . -type f | grep -v "/test/" | grep -v "./references" | zip -9 -@ ../build/$(NAME)-$(VERSION).zip > /dev/null
@find ./Utils -type f | grep -v "/test/" | zip -9 -@ build/$(NAME)-$(VERSION).zip > /dev/null
endef
$(EXTENSIONS):
$(make-extension-zip)
@cd Common/ && echo ./waagentloader.py | zip -9 -@ ../build/$(NAME)-$(VERSION).zip > /dev/null
@cd Common/WALinuxAgent-2.0.16 && echo ./waagent | zip -9 -@ ../../build/$(NAME)-$(VERSION).zip > /dev/null
buildVMAccess:
$(eval NAME = $(shell grep -Pom1 "(?<=<Type>)[^<]+" VMAccess/manifest.xml))
$(eval VERSION = $(shell grep -Pom1 "(?<=<Version>)[^<]+" VMAccess/manifest.xml))
@echo "Building '$(NAME)-$(VERSION).zip' ..."
@cd VMAccess && find . -type f | grep -v "/test/" | grep -v "./references" | zip -9 -@ ../build/$(NAME)-$(VERSION).zip > /dev/null
@zip -9 build/$(NAME)-$(VERSION).zip ./Utils/__init__.py ./Utils/constants.py ./Utils/distroutils.py\
./Utils/extensionutils.py ./Utils/handlerutil2.py ./Utils/logger.py ./Utils/ovfutils.py > /dev/null
.PHONY: clean build $(EXTENSIONS) buildVMAccess