This repository has been archived by the owner on Feb 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (75 loc) · 3.62 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
SOURCE_SUBDIRS = cli_common cli_command_parser cli_service cli_service_test_commands cli_terminal
TEST_SUBDIRS = cli_common_tests cli_command_parser_tests cli_service_tests cli_terminal_tests
COMMON_EBIN = cli_common/ebin
COMMAND_PARSER_EBIN = cli_command_parser/ebin
SERVICE_EBIN = cli_service/ebin
SERVICE_DATA = cli_service/data
SERVICE_TEST_COMMANDS_EBIN = cli_service_test_commands/ebin
TERMINAL_BIN = cli_terminal/bin
TERMINAL_DATA = cli_terminal/data
INTEGRATION_TESTS = cli_integration_tests
INTEGRATION_TESTS_SERVICE_EBIN = $(INTEGRATION_TESTS)/service_ebin
INTEGRATION_TESTS_TERMINAL_BIN = $(INTEGRATION_TESTS)/cli_terminal_bin
DEPLOY = deploy
DEPLOY_SERVICE_EBIN = cli_service_ebin
DEPLOY_SERVICE_DATA = cli_service_data
DEPLOY_TERMINAL_BIN = cli_terminal_bin
DEPLOY_TERMINAL_DATA = cli_terminal_data
DEPLOY_PREREQ = deploy_prerequisites
DEPLOY_SERVICE_PREREQ = $(DEPLOY_PREREQ)/cli_service
DEPLOY_DOCS = docs
# documentation for deploy
DOCS=docs/CLI_Architecture.docx \
docs/CLI_Autocomplete.docx \
docs/CLI_Dependencies.docx \
docs/CLI_Future.docx \
docs/CLI_service_command_parser.docx \
docs/CLI_service_description.docx \
docs/CLI_terminal_comm_protocol.docx \
docs/CLI_terminal_description
all: build
build:
for directory in $(SOURCE_SUBDIRS); do $(MAKE) -C $$directory; done
test: all
for directory in $(TEST_SUBDIRS); do $(MAKE) -C $$directory test; done
integration_test: all
$(shell rm -rf $(INTEGRATION_TESTS_SERVICE_EBIN))
$(shell mkdir $(INTEGRATION_TESTS_SERVICE_EBIN))
$(shell rm -rf $(INTEGRATION_TESTS_TERMINAL_BIN))
$(shell mkdir $(INTEGRATION_TESTS_TERMINAL_BIN))
$(shell cp -f -t $(INTEGRATION_TESTS_SERVICE_EBIN) $(SERVICE_EBIN)/*)
$(shell cp -f -t $(INTEGRATION_TESTS_TERMINAL_BIN) $(TERMINAL_BIN)/*)
$(MAKE) -C $(INTEGRATION_TESTS) test
clean:
for directory in $(SOURCE_SUBDIRS); do $(MAKE) -C $$directory clean; done
for directory in $(TEST_SUBDIRS); do $(MAKE) -C $$directory clean; done
$(MAKE) -C cli_command_parser_prototype clean
$(MAKE) -C cli_integration_tests clean
$(MAKE) -C cli_terminal_prototype clean
$(shell rm -rf $(DEPLOY))
deploy: all
$(shell rm -rf $(DEPLOY))
$(shell mkdir -p $(DEPLOY)/$(DEPLOY_SERVICE_EBIN))
$(shell mkdir -p $(DEPLOY)/$(DEPLOY_SERVICE_DATA))
$(shell mkdir -p $(DEPLOY)/$(DEPLOY_TERMINAL_BIN))
$(shell mkdir -p $(DEPLOY)/$(DEPLOY_TERMINAL_DATA))
$(shell mkdir -p $(DEPLOY)/$(DEPLOY_DOCS))
$(shell cp -f -t $(DEPLOY)/$(DEPLOY_SERVICE_EBIN) $(COMMON_EBIN)/*)
$(shell cp -f -t $(DEPLOY)/$(DEPLOY_SERVICE_EBIN) $(COMMAND_PARSER_EBIN)/*)
$(shell cp -f -t $(DEPLOY)/$(DEPLOY_SERVICE_EBIN) $(SERVICE_EBIN)/*)
$(shell cp -f -t $(DEPLOY)/$(DEPLOY_SERVICE_EBIN) $(SERVICE_TEST_COMMANDS_EBIN)/*)
$(shell cp -f -t $(DEPLOY)/$(DEPLOY_SERVICE_EBIN) $(DEPLOY_SERVICE_PREREQ)/*)
$(shell cp -f -t $(DEPLOY)/$(DEPLOY_SERVICE_DATA) $(SERVICE_DATA)/*)
$(shell cp -f -t $(DEPLOY)/$(DEPLOY_TERMINAL_BIN) $(TERMINAL_BIN)/*)
$(shell cp -f -t $(DEPLOY)/$(DEPLOY_TERMINAL_DATA) $(TERMINAL_DATA)/*)
$(shell cp -f -t $(DEPLOY)/ $(DEPLOY_PREREQ)/install.sh)
# documentation
for document in $(DOCS); do libreoffice --headless --convert-to pdf $$document --outdir $(DEPLOY)/$(DEPLOY_DOCS); done
$(shell cp -f -t $(DEPLOY)/$(DEPLOY_DOCS) docs/*.pdf)
# create tar
tar -c -f $(DEPLOY)/deploy.tar -C $(DEPLOY) $(DEPLOY_SERVICE_EBIN)/ \
$(DEPLOY_SERVICE_DATA)/ \
$(DEPLOY_TERMINAL_BIN)/ \
$(DEPLOY_TERMINAL_DATA)/ \
$(DEPLOY_DOCS)/ \
./install.sh