-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
98 lines (76 loc) · 2.51 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/make
## Top level Makefile for Vyatta System Build
export MAKEFLAGS
export NETSNMP_DONT_CHECK_VERSION=1
PACKAGE_DEBS := $(subst /debian,,$(wildcard pkgs/*/debian))
CLEAN_DEBS := $(subst pkgs/,clean-pkgs/,$(PACKAGE_DEBS))
BUILD_PKGS := $(subst pkgs/,,$(PACKAGE_DEBS))
CLEAN_PKGS := $(subst pkgs/,clean-,$(PACKAGE_DEBS))
RELEASE_PKGS := $(subst pkgs/,release-,$(PACKAGE_DEBS))
UID := $(shell id -u)
ifneq ($(UID),0)
FAKEROOT = fakeroot
FAKEPERMISSIONS = -i .permissions -s .permissions
FAKECHROOT = fakechroot
endif
define mk_iso
@v=$$(mksquashfs -version | awk '/^mksquashfs/ { print $$3 }' ) ; \
if dpkg --compare-versions $$v '<' "4.1" ; \
then echo "Need squashfs tools 4.1 (or later)"; exit 1; fi
@rm -rf livecd/.lock livecd/.permissions
cd livecd && $(FAKEROOT) $(FAKECHROOT) ./mk.livecd
endef
all : package_debuilds
$(mk_iso)
.PHONY : iso
iso :
$(mk_iso)
.PHONY : mostlyclean
mostlyclean :
@for m in proc-live sysfs-live devpts-live ; do \
if grep -q $$m /proc/mounts ; then umount $$m ; fi \
done
@rm -rf livecd/{.permissions,.stage,binary,*.iso,chroot,config,.lock}
@ipcs -q | awk '{print $$2}' | egrep [0-9] \
| xargs -L 1 ipcrm -q >/dev/null 2>&1 || /bin/true
.PHONY : clean
clean :
@$(MAKE) mostlyclean
@tools/submod-clean
@rm -rf livecd/cache/stage*
.PHONY : distclean
distclean :
@$(MAKE) clean
@rm -rf livecd/{cache,version}
# building kernel modules depends on kernel
pkgs/open-vm-tools: pkgs/linux-image/debian/stamps/build-base
# mysterious dependency
pkgs/net-snmp: pkgs/linux-image/debian/stamps/build-base
pkgs/linux-image/debian/stamps/build-base: pkgs/linux-image
.PHONY: package_debuilds
package_debuilds: $(PACKAGE_DEBS)
@echo DONE
.PHONY: clean_debuilds
clean_debuilds: $(CLEAN_DEBS)
@echo DONE
.PHONY: $(PACKAGE_DEBS)
$(PACKAGE_DEBS):
@case "$@" in pkgs/installer*|pkgs/linux-kernel-di*|"" ) true;; *) echo !!!!!$@!!!!!!!; cd $@; debuild -i -b -uc -us -nc;; esac
.PHONY: $(CLEAN_DEBS)
$(CLEAN_DEBS):
@d=$$(echo $@ | sed 's/^clean-//'); case "$$d" in pkgs/installer*|pkgs/linux-kernel-di*|"" ) echo !!!!!$$d!!!!!!!;; *) cd $$d; debuild clean;; esac
.PHONY: $(BUILD_PKGS)
$(BUILD_PKGS):
@cd pkgs/$@; debuild -i -b -uc -us -nc
.PHONY: $(CLEAN_PKGS)
$(CLEAN_PKGS):
@d=$$(echo $@ | sed 's/^clean-//'); cd pkgs/$$d; debuild clean
.PHONY: $(RELEASE_PKGS)
$(RELEASE_PKGS):
@d=$$(echo $@ | sed 's/^release-//'); cd pkgs/$$d; ../../tools/pkg-release -p
.PHONY: show_unreleased
show_unreleased:
@./tools/show-unreleased
.PHONY: show_unreleased_all
show_unreleased_all:
@./tools/show-unreleased -a