forked from starlingx-staging/stx-packaging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (57 loc) · 1.76 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
54
55
56
57
58
59
60
61
62
63
64
65
PKG ?= "x.stx-fault/fm-common"
DISTRO ?= "ubuntu"
ISO_TEMPLATE ?= ""
BUILD_W_CONT ?= "n"
all:
@echo "Check all the options to build"
iso:
@ echo "Creating image .iso to boot and test"
cp $(ISO_TEMPLATE) linuxbuilder/
cp -rf /usr/local/mydebs/*.deb linuxbuilder/DEBS/
cd linuxbuilder/ && make iso-ubuntu IMAGE=$(ISO_TEMPLATE)
mv linuxbuilder/ubuntu.iso .
liveimg:
@ echo "Creating $(DISTRO) live image"
cp -rf /usr/local/mydebs/*.deb live_img/$(DISTRO)/stxdebs/
@ cd live_img/ && make DISTRO=$(DISTRO)
build_cont_img:
cd configs/docker-$(DISTRO)-img/ && make
build_pkg_in_cont:
cd configs/docker-$(DISTRO)-img/ && make package PKG=$(PKG)
build_pkg_native:
@echo "Compiing w/o contianers in a native $(DISTRO) system"
@echo "Building package $(PKG) for $(DISTRO)"
cd $(PKG)/$(DISTRO) && make
package:
ifeq ($(BUILD_W_CONT),y)
package:build_cont_img build_pkg_in_cont
else
package:build_pkg_native
endif
build_upstream_pkg_native:
@echo "Building package $(PKG) for $(DISTRO)"
- mkdir -p upstream_pkgs/$(PKG)
- mkdir -p upstream_pkgs/$(PKG)/results
sudo apt-get update
cd upstream_pkgs/$(PKG) && sudo apt-get source $(PKG)
cp configs/generic-Makefile upstream_pkgs/$(PKG)/Makefile
cd upstream_pkgs/$(PKG) && make
build_upstream_pkg_in_cont:
cd configs/docker-$(DISTRO)-img/ && make upstream_pkg PKG=$(PKG)
upstream_pkg:
ifeq ($(BUILD_W_CONT),y)
upstream_pkg:build_cont_img build_upstream_pkg_in_cont
else
upstream_pkg:build_upstream_pkg_native
endif
clean_upstream_pkg:
cd upstream_pkgs/$(PKG) && make clean
distclean_upstream_pkg:
sudo rm -rf upstream_pkgs/$(PKG)
testbuild: package
@ if [ $$? -eq 0 ] ; then echo "Test Build: OK !"; fi
update:
sudo pbuilder update --components "main universe" --override-config
clean:
cd $(PKG)/$(DISTRO) && make clean
rm -rf ubuntu.iso