Makefile 2.28 KB
Newer Older
1
.PHONY: clean all rel_mktemp_dir console controller all
2
3
4

CONTROLLER_REL_TAR:=$(CURDIR)/controller_$(shell date +%Y%m%d%H%M).tar.gz
CONSOLE_REL_TAR:=$(CURDIR)/console_$(shell date +%Y%m%d%H%M).tar.gz
Jeroen Vreeken's avatar
Jeroen Vreeken committed
5
6
7
8
9

all:
	$(MAKE) -C common/utils
	$(MAKE) -C common/trace
	$(MAKE) -C controller
Jeroen Vreeken's avatar
Jeroen Vreeken committed
10
	cd libnova-0.13.0 ; ./configure -enable-static -disable-shared --prefix=${CURDIR} ; make; make install
Jeroen Vreeken's avatar
Jeroen Vreeken committed
11
12
	$(MAKE) -C console

13
14
15
16
17
18
19
20
21
22
23
controller:
	$(MAKE) -C common/utils
	$(MAKE) -C common/trace
	$(MAKE) -C controller

console:
	$(MAKE) -C common/utils
	$(MAKE) -C common/trace
	cd libnova-0.13.0 ; ./configure -enable-static -disable-shared --prefix=${CURDIR} ; make; make install
	$(MAKE) -C console

Jeroen Vreeken's avatar
Jeroen Vreeken committed
24
25
26
27
28
29
30
clean:
	$(MAKE) -C common/utils clean
	$(MAKE) -C common/trace clean
	$(MAKE) -C controller clean
	cd libnova-0.13.0 ; make clean || true
	$(MAKE) -C console clean

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
# Rules for building a release

rel_mktemp_dir:
	$(eval REL_BUILD_DIR:=$(shell mktemp -d /tmp/dt_ctrl_XXXXXX))
	@echo "****** Building code in dir: $(REL_BUILD_DIR)"

rel_clone_dir: rel_mktemp_dir
	@echo "****** Creating clean checkout of source"; \
	git clone . $(REL_BUILD_DIR) >/dev/null; \
	echo "       Done"

rel_utils: rel_clone_dir
	@echo "****** Building common/utils"; \
	$(MAKE) -C $(REL_BUILD_DIR)/common/utils >/dev/null; \
	echo "       Done"

rel_trace: rel_utils
	@echo "****** Building common/trace"; \
	$(MAKE) -C $(REL_BUILD_DIR)/common/trace >/dev/null; \
	echo "       Done"


rel_ctrl: rel_trace
	@echo "****** Building controller"; \
	$(MAKE) -C $(REL_BUILD_DIR)/controller >/dev/null; \
	echo "       Done"


rel_libnova: rel_clone_dir
	@echo "****** Building libnova"; \
	(cd $(REL_BUILD_DIR)/libnova-0.13.0 ; ./configure -enable-static -disable-shared --prefix=$(REL_BUILD_DIR); make; make install) >/dev/null; \
	echo "       Done"


rel_cons: rel_trace rel_libnova
	@echo "****** Building console"; \
	$(MAKE) -C $(REL_BUILD_DIR)/console >/dev/null; \
	echo "       Done"


$(CONSOLE_REL_TAR): rel_cons
	@tar -C $(REL_BUILD_DIR)/release -zhcf $@ console
	@echo "****** Created console release file $@"


$(CONTROLLER_REL_TAR): rel_ctrl
	@tar -C $(REL_BUILD_DIR)/release -zhcf $@ controller
	@echo "****** Created controller release file $@"
Jeroen Vreeken's avatar
Jeroen Vreeken committed
79

80
81
82
release: $(CONSOLE_REL_TAR) $(CONTROLLER_REL_TAR)
release_console: $(CONSOLE_REL_TAR)
release_controller: $(CONTROLLER_REL_TAR)