-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
98 lines (78 loc) · 3.22 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
98
include Makefile.config
.SILENT: default
.PHONY: default client server data all
#===============================================================================
# Major targets
#===============================================================================
default:
echo 'Use "make all" if you really want to rebuild everything from scratch'
client:
$(MAKE) -C client
server:
$(MAKE) -C server
data:
$(MAKE) -C data
ifeq ($(FLAVOUR), enterprise)
all: build-package data build-root rsync build-server rsync-server
else
ifeq ($(FLAVOUR), live)
all: build-package data build-root build-boot build-live
else
ifeq ($(FLAVOUR), standalone)
all: build-package
else
ifeq ($(FLAVOUR), inventory)
all: build-package
else
ifeq ($(FLAVOUR), tennex)
all: build-package
else
all:
echo 'Edit Makefile.config to set up FLAVOUR to one of the valid values'
endif
endif
endif
endif
endif
#===============================================================================
# Misc targets
#===============================================================================
clean: repo-clean
rm -Rf $(WORKDIR)
CONFIG=$(CONFIG) $(MAKE) -C client clean
# Files with metadata, gathered from client modules
metadata:
cd server/web/lib/planner && ./configure
cd ../web && ./generate-from-metadata
# Generate API documentation for the website
doc:
cd ../web && ./generate-api-doc
#===============================================================================
# Client image deployment
#===============================================================================
rsync:
ssh $(DEPLOY_HOST) "mkdir -p $(DEPLOY_PATH); sudo chown root:inquisitor $(DEPLOY_PATH)"
sudo rsync -rlptv --delete-after --exclude=usr/lib/inquisitor/images --exclude=etc/inquisitor/users $(WORKDIR)/$(ROOTDIR)/* root@$(DEPLOY_HOST):$(DEPLOY_PATH)
ssh $(DEPLOY_HOST) "sudo rm -f $(DEPLOY_PATH)/dev/console $(DEPLOY_PATH)/dev/null; sudo mknod $(DEPLOY_PATH)/dev/console c 5 1; sudo mknod $(DEPLOY_PATH)/dev/null c 1 3"
rsync-list:
rsync -rlptvn --delete-after --exclude=usr/lib/inquisitor/images --exclude=etc/inquisitor/users $(WORKDIR)/$(ROOTDIR)/* $(DEPLOY_HOST):$(DEPLOY_PATH)
#rsync-images:
# ssh $(DEPLOY_HOST) mkdir -p $(DEPLOY_PATH)/usr/lib/inquisitor/images
# rsync -rlptv --delete image-huge/images/* $(DEPLOY_HOST):$(DEPLOY_PATH)/usr/lib/inquisitor/images
#rsync-repository:
# ssh $(DEPLOY_HOST) "mkdir -p $(DEPLOY_PATH)$(COMPACT_PATH); sudo chown -R greycat.inquisitor $(DEPLOY_PATH)$(COMPACT_PATH)"
# rsync -vrpl --exclude=files/SRPMS /raid/Sisyphus-branch-3.0 $(DEPLOY_HOST):$(DEPLOY_PATH)$(COMPACT_PATH)
#===============================================================================
# Server deployment
#===============================================================================
rsync-server:
rsync -rlptv --delete server $(DEPLOY_HOST):
rsync -rlptv --delete configs $(DEPLOY_HOST):
ssh $(DEPLOY_HOST) "cd server; CONFIG=$(CONFIG) sudo make install"
#===============================================================================
# Some sanity checks
ifndef CLIENT_BASE
$(error CLIENT_BASE not defined. Please edit Makefile.config to specify your build system Linux distribution in CLIENT_BASE.)
endif
# Include client platform-dependent build instructions
include build/$(CLIENT_BASE)/Makefile