-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathMakefile
42 lines (34 loc) · 1.26 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
# ubuntu requires packages git make rubygems libxml2-dev libxslt-dev zlib1g-dev virtualbox
# most of these targets are pseudotargets, and make will always think they are out of date.
# bash conditionals are liberally applied to avoid rebuilding things too often.
BASEBOX=ubuntu-7.10-server-amd64
all: opengenera-box opengenera2.tar.bz2
clean:
vagrant destroy
vagrant box remove opengenera
rm -f *.box snap4.tar.gz
echo "the iso directory can be removed"
# vagrant is a tool for automating virtualbox
vagrant:
if test -z "$$(which vagrant)" ; then \
echo "### need to install vagrant"; \
echo "try: sudo gem install vagrant"; \
fi
# veewee might download an OS image. don't let make auto delete it, it's big!
.PRECIOUS: %.iso
$(BASEBOX).box:
if test -z "$$(which veewee)" ; then \
echo "### need to install veewee"; \
echo "try: sudo gem install veewee"; \
else \
echo "### need to build $(BASEBOX).box"; \
veewee vbox build --force $(BASEBOX); \
veewee vbox validate $(BASEBOX); \
veewee vbox export $(BASEBOX); \
fi
# test that the opengenera box is installed. make it if not.
opengenera-box: vagrant
if test -z "$$(vagrant box list | grep -w opengenera)" ; then \
make $(BASEBOX).box; \
vagrant box add opengenera $(BASEBOX).box; \
fi