-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
152 lines (129 loc) · 4.84 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
##############################################################################
##
## Copyright (C) 2023-2024 Frank Eskesen.
##
## This file is free content, distributed under the MIT license.
## (See accompanying file LICENSE.MIT or the original contained
## within https://opensource.org/licenses/MIT)
##
##############################################################################
##
## Title-
## (~/)Makefile
##
## Purpose-
## Build control makefile.
##
## Last change date-
## 2024/02/01
##
##############################################################################
##############################################################################
## Default action
.PHONY: list-options
list-options: ;
@echo "Available options:"
@echo " make install: Build all installation prerequisites and libraries."
@echo " Use this to initialize or update your installation."
@echo " make uninstall: Remove prerequisites and build libraries."
@echo " make reinstall: (make uninstall; make install)"
@echo " Use this after installing a new Linux version."
@echo " make update: Update an installation."
@echo
@echo " make check: Compile and run all test suites."
@echo " make compile: Compile all source files."
@echo
@echo " make clean: Remove all 'make check' and 'make compile' files."
@echo " make pristine: Performs 'make clean' and 'make uninstall' "
@echo
##############################################################################
## Target directories
CPP_ := $(SDL_ROOT)/obj/cpp
JAVA_ := $(SDL_ROOT)/obj/java
MCS_ := $(SDL_ROOT)/obj/mcs
PY_ := $(SDL_ROOT)/obj/py
##############################################################################
## TARGETS: check, compile, clean, install, pristine, reinstall,
## TARGETS: uninstall, update
.PHONY: check compile clean install pristine reinstall
.PHONY: uninstall update
##----------------------------------------------------------------------------
install: environment
(cd $(CPP_); $(MAKE) install)
(cd $(PY_); $(MAKE) install)
##----------------------------------------------------------------------------
reinstall: environment
(cd $(CPP_); $(MAKE) reinstall)
(cd $(PY_); $(MAKE) reinstall)
##----------------------------------------------------------------------------
uninstall: environment
(cd $(CPP_); $(MAKE) uninstall)
(cd $(PY_); $(MAKE) uninstall)
##----------------------------------------------------------------------------
update: environment
(cd $(CPP_); $(MAKE) update)
(cd $(PY_); $(MAKE) update)
##----------------------------------------------------------------------------
check: environment
(cd $(CPP_); $(MAKE) check)
(cd $(PY_); $(MAKE) check)
##----------------------------------------------------------------------------
compile: environment
(cd $(CPP_); $(MAKE) compile)
(cd $(PY_); $(MAKE) compile)
##----------------------------------------------------------------------------
clean: defined-root
(cd $(CPP_); $(MAKE) clean)
(cd $(PY_); $(MAKE) clean)
##----------------------------------------------------------------------------
pristine: defined-root
(cd $(CPP_); $(MAKE) pristine)
(cd $(PY_); $(MAKE) pristine)
##############################################################################
## TARGET: environment: Insure $SDL_ROOT is defined and valid
.PHONY: environment defined-root valid-path
##----------------------------------------------------------------------------
## Insure required subdirectories exist
environment: $(SDL_ROOT)/src $(SDL_ROOT)/obj $(SDL_ROOT)/bin
environment: $(CPP_) $(JAVA_) $(MCS_) $(PY_)
$(SDL_ROOT)/bin: ;
@echo "Missing file: '$(SDL_ROOT)/bin', SDL_ROOT improperly defined"
@false
$(SDL_ROOT)/obj: ;
@echo "Missing file: '$(SDL_ROOT)/obj', SDL_ROOT improperly defined"
@false
$(SDL_ROOT)/src: ;
@echo "Missing file: '$(SDL_ROOT)/src', SDL_ROOT improperly defined"
@false
$(CPP_): ;
@echo "Missing file: '$(CPP_)', SDL_ROOT improperly defined"
@false
$(JAVA_): ;
@echo "Missing file: '$(JAVA_)', SDL_ROOT improperly defined"
@false
$(MCS_): ;
@echo "Missing file: '$(MCS_)', SDL_ROOT improperly defined"
@false
$(PY_): ;
@echo "Missing file: '$(PY_)', SDL_ROOT improperly defined"
@false
##----------------------------------------------------------------------------
## Insure *ONLY* that SDL_ROOT is defined
environment: defined-root
ifeq "" "$(SDL_ROOT)"
defined-root: ;
@echo "Environment variable SDL_ROOT is undefined."
@echo "Use 'source setupSDL' to initialize the environment variables."
@false
else
defined-root: ;
@true
endif
##----------------------------------------------------------------------------
## Insure $(SDL_ROOT)/bin is in $PATH
environment: valid-path
valid-path: $(SDL_ROOT)/bat/sys/is-valid-path
@$(SDL_ROOT)/bat/sys/is-valid-path
$(SDL_ROOT)/bat/sys/is-valid-path: ;
@echo "Missing file: '$(SDL_ROOT)/bat/sys/is-valid-path', SDL_ROOT improperly defined"
@false