-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
579 lines (483 loc) · 18.7 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
#
# MIT License
#
# Copyright (c) 2020-24 PyKOB - MorseKOB in Python
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# ############################################################################
#
# Makefile to create:
# * A binary package of PyKOB (MKOB, MRT, Telegram, Configure, ...) using Nuitka.
# * The manuals (pdf from the adoc)
#
# For the binaries, file copying is done to arrange source to produce
# smaller executables than would be the case if they were just generated
# from the runnable Python source. The reason for this is that the runnable
# Python source has the 'pykob' package/modules as a subdirectory to make it
# convenient for 'includes' within the applications. However, when
# generating the binaries, if done from the original source, the pykob
# package/modules is pulled in and included with each of the executables.
# What is actually wanted is for the pykob package to be generated as a
# separate binary that is then used by each of the applications. To
# accomplish this, the original Python source is copied into 'build/src'
# directories such that each exists in its own separate subdirectory.
#
# This copy is made, if needed when make is run. The build/src directory
# (in fact, all of the bin and build directories) are excluded from Git.
# But they will be kept up to date from changes in the original Python Source.
#
# The Makefile is for GNU Make. On Windows, it is expected that Cygwin is used.
# On Mac and Linux, it is expected that Bash shell is available. The path to
# the shell is set using the *SHELL* variable.
#
# Cygwin path conversions for use when programs need a full path.
ifdef COMSPEC
cygpath-mixed = $(shell cygpath -m "$1")
cygpath-unix = $(shell cygpath -u "$1")
drive-letter-to-slash = /$(subst :,,$1)
PYTHON ?= .venv/Scripts/python.exe
EXEC_EXT := .exe
else
cygpath-mixed = $1
cygpath-unix = $1
drive-letter-to-slash = $1
PYTHON ?= .venv/bin/python3
EXEC_EXT := .bin
endif
NUITKA_FACTORY_BIN ?= /c/Users/aesil/code/Nuitka-factory/Nuitka/bin/nuitka
NUITKA_MODULE ?= -m nuitka
AWK ?= awk
CP ?= cp
CP_RECURSE ?= $(CP) -rup
CP_TOFILE ?= $(CP) -Tup
CP_UPDATE ?= $(CP) -up
GREP ?= grep
KILL ?= kill
KILL_FLAGS ?= -f
MKDIR ?= mkdir -p
MV ?= mv
MV_FORCE ?= mv --force --backup=none
PDFGEN ?= asciidoctor-pdf
PR ?= pr
PS ?= ps
PS_FLAGS ?= -W
PS_FIELDS ?= "9 47 100"
PY2BIN_FAC ?= $(PYTHON) $(NUITKA_FACTORY_BIN)
PY2BIN_REL ?= $(PYTHON) $(NUITKA_MODULE)
PY2BIN ?= $(PY2BIN_REL)
SHELL := /bin/bash
SORT ?= sort
WIN_INST_COMPILE ?= "/c/Program Files (x86)/NSIS/makensis.exe"
# ### Documentation Section ###
DOC_DIR ?= Documentation/
#
MANUAL_SETTINGS := $(DOC_DIR)man_settings.adoc
PyKOB_THEME := $(DOC_DIR)PyKOB-theme.yml
MKOB_MANUAL := $(DOC_DIR)MKOB/User-Manual-MKOB4.pdf
MRT_MANUAL := $(DOC_DIR)MRT/User-Manual-MRT.pdf
TGRM_MANUAL := $(DOC_DIR)Telegram/User-Manual-Telegram.pdf
# ### Example Files Section
MRT_EXAMPLES_DIR := $(DOC_DIR)MRT/
MRT_EXAMPLES := $(MRT_EXAMPLES_DIR)mrt_schfd_example.mrtsfs\
$(MRT_EXAMPLES_DIR)mrt_sel_spec_example.mrtsel
TGRM_EXAMPLES_DIR := $(DOC_DIR)Telegram/
TGRM_EXAMPLES := $(TGRM_EXAMPLES_DIR)tg_config.tgc\
$(TGRM_EXAMPLES_DIR)WesternOnion-Masthead.svg
# ### Binary Executable Section ###
#NUITKA_FLAGS_ALL ?= --warn-implicit-exceptions --warn-unusual-code --msvc=latest
NUITKA_FLAGS_ALL ?= --deployment --msvc=latest
BIN_DIR ?= bin/
#
BUILD_SRC_DIR ?= build/src/
BUILD_SRC_APPS_DIR ?= build/src/apps/
BUILD_SRC_PYKOB_DIR ?= build/src/pykob/
BUILD_SRC_UTILS_DIR ?= build/src/utils/
# Dist directory (extension)
DIST_DIR_EXT ?= .dist/
APP_BUILD_SRC_DIRS := \
$(BUILD_SRC_DIR) \
$(BUILD_SRC_APPS_DIR) \
$(BUILD_SRC_PYKOB_DIR) \
$(BUILD_SRC_UTILS_DIR)
REQUIRED_BIN_DIRS := $(BIN_DIR) $(APP_BUILD_SRC_DIRS)
PYKOB_DIR := pykob/
PYKOB_DATA_DIR := $(PYKOB_DIR)data/
PYKOB_RESOURCES_DIR := $(PYKOB_DIR)resources/
SRC_PY_DIR ?= src.py/
SRC_PY_RES_DIR := $(SRC_PY_DIR)resources/
SRC_PKAPPARGS := $(SRC_PY_DIR)pkappargs.py
SRC_PYKOB_DIR ?= $(SRC_PY_DIR)$(PYKOB_DIR)
SRC_PYKOB_DATA_DIR := $(SRC_PYKOB_DIR)data/
SRC_PYKOB_RES_DIR := $(SRC_PYKOB_DIR)resources/
SRC_PYKOB_SHELL := $(SRC_PYKOB_DIR)*.py
SRC_PYKOB_DATA_SHELL := $(SRC_PYKOB_DATA_DIR)*
SRC_PYKOB_RESOURCES_SHELL := $(SRC_PYKOB_RES_DIR)*
ORIGINAL_SRC_CONFIGURE := $(SRC_PY_DIR)Configure.py # Have this as its own app.
ORIGINAL_SRC_MKOB := $(SRC_PY_DIR)MKOB.py $(SRC_PY_DIR)mkob%.py
ORIGINAL_SRC_MKOB_SHELL := $(SRC_PY_DIR)MKOB.py $(SRC_PY_DIR)mkob*.py
ORIGINAL_SRC_MRT := $(SRC_PY_DIR)MRT.py
ORIGINAL_SRC_TGRM := $(SRC_PY_DIR)Telegram.py
ORIGINAL_SRC_UTILS_SHELL := $(SRC_PY_DIR)[A-Z][a-np-z]*.py
PY_BIN_MODULE_EXT := .pyd
PY_BIN_MODULE_INC_EXT := .pyi
APP_BIN_DEBUG_FLAGS ?= \
--force-stdout-spec=exe.out.txt\
--force-stderr-spec=exe.err.txt\
--debug\
--python-flag=-v
# --trace
PYKOB_BIN_DEBUG_FLAGS ?= \
--debug\
--python-flag=-v
# --trace
COMMON_BIN_FLAGS := --python-flag=no_annotations --python-flag=no_docstrings
APP_BIN_FLAGS := $(NUITKA_FLAGS_ALL) $(COMMON_BIN_FLAGS)\
--standalone\
--enable-plugin=tk-inter\
--output-dir=$(BIN_DIR)
# $(APP_BIN_DEBUG_FLAGS)
PKAPPARGS_PACKAGE_FLAGS ?= --module $(NUITKA_FLAGS_ALL) $(COMMON_BIN_FLAGS)\
--follow-import-to=argparse\
--output-dir=$(BIN_DIR)\
$(SRC_PKAPPARGS)
### pkappargs binary package file
PKAPPARGS_PKG_BIN_FILE ?= $(BIN_DIR)pkappargs.cp311-win_amd64.pyd
PYKOB_PACKAGE_FLAGS ?= --module $(NUITKA_FLAGS_ALL) $(COMMON_BIN_FLAGS)\
--include-package=pykob\
--include-module=socket\
--include-module=ctypes\
--output-dir=$(BIN_DIR)\
$(SRC_PYKOB_DIR)
# $(PYKOB_BIN_DEBUG_FLAGS)
### pykob binary package file
PYKOB_PKG_BIN_FILE ?= $(BIN_DIR)pykob.cp311-win_amd64.pyd
## Applications and Utilities Bin-Build flags
### Configure
CONFIGURE_DIST := $(BIN_DIR)Configure$(DIST_DIR_EXT)
ifdef COMSPEC
CONFIGURE_EXEC := $(CONFIGURE_DIST)Configure.exe
CONFIGURE_ICON := --windows-icon-from-ico=$(SRC_PY_RES_DIR)Configure.ico
else
CONFIGURE_EXEC := $(CONFIGURE_DIST)Configure.bin
CONFIGURE_ICON :=
endif
CONFIGURE_BIN_FLAGS ?= $(APP_BIN_FLAGS)\
$(CONFIGURE_ICON)\
--include-module=tkinter.ttk\
--windows-console-mode=attach
### MKOB
MKOB_DIST := $(BIN_DIR)MKOB$(DIST_DIR_EXT)
MKOB_LOGO := --include-data-files=$(SRC_PY_RES_DIR)MKOB-Logo.png=resources/
ifdef COMSPEC
MKOB_EXEC := $(MKOB_DIST)MKOB.exe
MKOB_ICON := --windows-icon-from-ico=$(SRC_PY_RES_DIR)mkob-icon.ico
else
MKOB_EXEC := $(MKOB_DIST)MKOB.bin
MKOB_ICON :=
endif
MKOB_BIN_FLAGS ?= $(APP_BIN_FLAGS)\
$(MKOB_ICON)\
$(MKOB_LOGO)\
--include-module=tkinter.ttk\
--windows-console-mode=attach
### MRT
MRT_DIST := $(BIN_DIR)MRT$(DIST_DIR_EXT)
ifdef COMSPEC
MRT_EXEC := $(MRT_DIST)MRT.exe
MRT_ICON := --windows-icon-from-ico=$(SRC_PY_RES_DIR)mrt-icon.ico
else
MRT_EXEC := $(MRT_DIST)MRT.bin
MRT_ICON :=
endif
MRT_BIN_FLAGS ?= $(APP_BIN_FLAGS)\
$(MRT_ICON)\
--windows-console-mode=force
### Telegram
TGRM_DIST := $(BIN_DIR)Telegram$(DIST_DIR_EXT)
TGRM_LOGO := --include-data-files=$(SRC_PY_RES_DIR)Telegram-Logo.png=resources/
ifdef COMSPEC
TGRM_EXEC := $(TGRM_DIST)Telegram.exe
TGRM_ICON := --windows-icon-from-ico=$(SRC_PY_RES_DIR)telegram-icon.ico
else
TGRM_EXEC := $(TGRM_DIST)Telegram.bin
TGRM_ICON :=
endif
TGRM_BIN_FLAGS ?= $(APP_BIN_FLAGS)\
$(TGRM_ICON)\
$(TGRM_LOGO)\
--include-module=ctypes\
--windows-console-mode=attach
### Utilities
UTILITIES_BIN_FLAGS ?= $(APP_BIN_FLAGS) --windows-console-mode=attach
SYSCHECK_DIST := $(BIN_DIR)Syscheck$(DIST_DIR_EXT)
ifdef COMSPEC
SYSCHECK_EXEC := $(SYSCHECK_DIST)Syscheck.exe
SYSCHECK_ICON := --windows-icon-from-ico=$(SRC_PY_RES_DIR)SysCheck.ico
else
SYSCHECK_EXEC := $(SYSCHECK_DIST)Syscheck.bin
SYSCHECK_ICON :=
endif
SYSCHECK_BIN_FLAGS ?= $(APP_BIN_FLAGS) $(SYSCHECK_ICON) --windows-console-mode=attach
# ### Windows Installer Section ###
INSTALLER_SRC_DIR ?= src.install/
INSTALLER_WIN_DIR ?= $(INSTALLER_SRC_DIR)win/
PACKAGE_DIR ?= $(BIN_DIR)pkg/
PACKAGE_CORE_DIR ?= $(PACKAGE_DIR)core/
PACKAGE_DOCS_DIR ?= $(PACKAGE_DIR)docs/
PACKAGE_EXAMPLES_DIR ?= $(PACKAGE_DIR)examples/
PACKAGE_UTILS_DIR ?= $(PACKAGE_DIR)utils/
WIN_INST_CP_OPTS ?= /V2
REQUIRED_PACKAGE_DIRS := \
$(PACKAGE_DIR) \
$(PACKAGE_CORE_DIR) \
$(PACKAGE_DOCS_DIR) \
$(PACKAGE_EXAMPLES_DIR) \
$(PACKAGE_UTILS_DIR)
#
vpath pykob/%.py $(SRC_PYKOB_DIR)
vpath Configure.py $(BUILD_SRC_APPS_DIR)
vpath MKOB.py $(BUILD_SRC_APPS_DIR)
vpath mkob%.py $(BUILD_SRC_APPS_DIR)
vpath MRT.py $(BUILD_SRC_APPS_DIR)
vpath Telegram.py $(BUILD_SRC_APPS_DIR)
vpath %.py $(BUILD_SRC_UTILS_DIR)
vpath %.pyd $(BIN_DIR)
vpath %$(EXEC_EXT) $(BIN_DIR)%$(DIST_DIR_EXT)
# Executable rules
#
## Utilities original source to build source
$(BUILD_SRC_UTILS_DIR)%.py: $(SRC_PY_DIR)%.py
$(call utils-build-src $(notdir $<))
## Utilities Executable rules
%$(EXEC_EXT): $(BUILD_SRC_UTILS_DIR)%.py $(BUILD_SRC_UTILS_DIR)pykob.pyd
$(PY2BIN) $(UTILITIES_BIN_FLAGS) $(BUILD_SRC_UTILS_DIR)$(notdir $<)
$(call pykob-to-dist,$@)
# Executable build macros
#
## Copy pkappargs module to a build source dir.
## $(call pkappargs-to-build-src,build_src_dir)
define pkappargs-to-build-src
@echo !!! Copy the pkappargs binary into source dir: \'$1\'
$(CP_UPDATE) $(BIN_DIR)/pkappargs.pyi $1
$(CP_TOFILE) $(PKAPPARGS_PKG_BIN_FILE) $1/pkappargs.pyd
endef
## Copy the pkappargs module and the data and resources to a 'dist' dir.
## $(call pkappargs-to-dist,dist_dir)
define pkappargs-to-dist
$(eval DD = $(BIN_DIR)$(basename $(notdir $1))$(DIST_DIR_EXT))
@echo !!! Copy the pkappargs binary into dist dir: \'$(DD)\'
$(CP_UPDATE) $(BIN_DIR)/pkappargs.pyi $(DD)
$(CP_TOFILE) $(PKAPPARGS_PKG_BIN_FILE) $(DD)/pkappargs.pyd
endef
## Copy pykob module to a build source dir.
## $(call pykob-to-build-src,build_src_dir)
define pykob-to-build-src
@echo !!! Copy the pykob binary into: \'$1\' \(pykob-to-build-src\)
$(CP_UPDATE) $(BIN_DIR)pykob.pyi $1
$(CP_TOFILE) $(PYKOB_PKG_BIN_FILE) $1pykob.pyd
endef
## Copy the pykob module and the data and resources to a 'dist' dir.
## $(call pykob-to-dist,dist_dir)
define pykob-to-dist
$(eval DD = $(BIN_DIR)$(basename $(notdir $1))$(DIST_DIR_EXT))
@echo !!! Copy the pykob binary, data, and resources into: \'$(DD)\' \(pykob-to-dist\)
$(CP_UPDATE) $(BIN_DIR)pykob.pyi $(DD)
$(CP_TOFILE) $(PYKOB_PKG_BIN_FILE) $(DD)pykob.pyd
$(MKDIR) $(DD)/$(PYKOB_DATA_DIR)
$(CP_RECURSE) $(SRC_PYKOB_DATA_SHELL) $(DD)$(PYKOB_DATA_DIR)
$(MKDIR) $(DD)/$(PYKOB_RESOURCES_DIR)
$(CP_RECURSE) $(SRC_PYKOB_RESOURCES_SHELL) $(DD)$(PYKOB_RESOURCES_DIR)
endef
## Create the build utility build source directory and copy the
## original source into is.
## $(call utility-build-source pyfile.py)
define utils-build-src
@echo !!! Copy the utilities source into: \'$1\' \(utils-build-src\)
$(shell [[ -d $(BUILD_SRC_UTILS_DIR) ]] || mkdir -p $(BUILD_SRC_UTILS_DIR);) \
$(CP_UPDATE) $(SRC_PY_DIR)$1: $(BUILD_SRC_UTILS_DIR)
endef
# General purpose macros
#
# $(call kill-program,awk-pattern)
define kill-program
@ $(PS) $(PS_FLAGS) | \
$(AWK) 'BEGIN { FIELDWIDTHS = $(PS_FIELDS) } \
/$1/ { \
print "Killing " $$3; \
system( "$(KILL) $(KILL_FLAGS) " $$1 ) \
}'
endef
# Documentation rules
%.pdf: %.adoc
$(PDFGEN) $<
# help (the default target) - Print a list of all targets in this makefile
.PHONY: help
help:
@$(MAKE_COMMAND) --print-data-base --question no-such-target | \
$(GREP) -v -e '^no-such-target' -e '^makefile' | \
$(AWK) '/^[^.%][-A-Za-z0-9_]*:/ { print substr($$1, 1, length($$1)-1) }' | \
$(SORT) | \
$(PR) --omit-pagination --width=132 --columns=4
# Currently 'all' is just the documentation. It will become everything (binaries, docs, installers)
# once the kinks are ironed out of the binaries.
#
.PHONY: all
all: docs package_for_installer
.PHONY: clean_all_bin
clean_all_bin: clean_bld_dirs clean_bld_src_dirs clean_dist_dirs clean_pkg_dir
rm -f $(BIN_DIR)*
.PHONY: clean_bld_dirs
clean_bld_dirs:
rm -rf $(BIN_DIR)*.build
.PHONY: clean_bld_src_dirs
clean_bld_src_dirs:
rm -rf $(BUILD_SRC_DIR)
.PHONY: clean_dist_dirs
clean_dist_dirs:
rm -rf $(BIN_DIR)*$(DIST_DIR_EXT)
.PHONY: clean_pkg_dir
clean_pkg_dir:
rm -rf $(PACKAGE_DIR)
.PHONY: docs
docs: $(MKOB_MANUAL) $(MRT_MANUAL) $(TGRM_MANUAL)
.PHONY: bins
bins: pykob Configure MKOB MRT TGRM
.PHONY: installer_win
#installer_win: INSTALLER_NAME := $(shell date +'mkobsuite-install-%Y%m%d.exe')
installer_win: MKOB_SUITE_VERSION := $(shell sed 's/\./_/g' msuiteversion.txt)
installer_win:
$(WIN_INST_COMPILE) $(WIN_INST_CP_OPTS) $(INSTALLER_WIN_DIR)mkobsuite_win.nsi
$(MV_FORCE) $(INSTALLER_WIN_DIR)mkobsuite-install.exe $(BIN_DIR)mkobsuite-$(MKOB_SUITE_VERSION)-install.exe
.PHONY: package_for_installer
package_for_installer: PKG_DIRS := $(shell for d in $(REQUIRED_PACKAGE_DIRS); \
do \
[[ -d $$d ]] || mkdir -p $$d; \
done;)
package_for_installer: pykob Configure MKOB MRT TGRM Syscheck docs
@echo !!! Copy all Dist dirs into PKG for the installer.
$(CP_RECURSE) $(CONFIGURE_DIST)* $(PACKAGE_CORE_DIR)
$(CP_RECURSE) $(MKOB_DIST)* $(PACKAGE_CORE_DIR)
$(CP_RECURSE) $(SRC_PY_DIR)mkob_learn $(PACKAGE_CORE_DIR)
$(CP_RECURSE) $(MRT_DIST)* $(PACKAGE_CORE_DIR)
$(CP_RECURSE) $(TGRM_DIST)* $(PACKAGE_CORE_DIR)
@echo !!! Copy Telegram 'extra' files into PKG for the installer.
$(CP_RECURSE) $(TGRM_EXAMPLES) $(PACKAGE_CORE_DIR)
@echo !!! Copy docs into PKG for the installer.
$(CP_RECURSE) $(MKOB_MANUAL) $(PACKAGE_DOCS_DIR)
$(CP_RECURSE) $(MRT_MANUAL) $(PACKAGE_DOCS_DIR)
$(CP_RECURSE) $(TGRM_MANUAL) $(PACKAGE_DOCS_DIR)
@echo !!! Copy examples into PKG for the installer.
$(CP_RECURSE) $(MRT_EXAMPLES) $(PACKAGE_EXAMPLES_DIR)
$(CP_RECURSE) $(TGRM_EXAMPLES) $(PACKAGE_EXAMPLES_DIR)
@echo !!! Copy utilities into PKG for the installer.
$(CP_RECURSE) bin/Syscheck.dist/* $(PACKAGE_UTILS_DIR)
@echo !!! Copy Windows DLLs into the PKG for the installer.
$(CP) $(INSTALLER_WIN_DIR)api-ms-win-core-path-l1-1-0.dll $(PACKAGE_CORE_DIR)
# The following PHONY targets will be replaced by true targets given time
# to build out the proper names and dependencies.
#
# For now, they are PHONY, such that they will always build.
.PHONY: pykob
pykob: pykob.pyd ;
.PHONY: Configure
Configure: $(CONFIGURE_EXEC) ;
.PHONY: MKOB
MKOB: $(MKOB_EXEC) ;
.PHONY: MRT
MRT: $(MRT_EXEC) ;
.PHONY: TGRM
TGRM: $(TGRM_EXEC)
.PHONY: Syscheck
Syscheck: $(SYSCHECK_EXEC) ;
# #############################################################################
#
# True targets
#
# #############################################################################
$(MKOB_MANUAL): $(DOC_DIR)MKOB/User-Manual-MKOB4.adoc mkobversion.txt $(MANUAL_SETTINGS) $(PyKOB_THEME)
$(PDFGEN) $<
$(MRT_MANUAL): $(DOC_DIR)MRT/User-Manual-MRT.adoc mrtversion.txt $(MANUAL_SETTINGS) $(PyKOB_THEME) ;
$(PDFGEN) $<
$(TGRM_MANUAL): $(DOC_DIR)Telegram/User-Manual-Telegram.adoc telegramversion.txt $(MANUAL_SETTINGS) $(PyKOB_THEME) ;
$(PDFGEN) $<
$(CONFIGURE_EXEC): CONFIG_SOURCES := $(shell for d in $(REQUIRED_BIN_DIRS); \
do \
[[ -d $$d ]] || mkdir -p $$d; \
done; \
$(CP) -rup $(ORIGINAL_SRC_CONFIGURE) $(BUILD_SRC_APPS_DIR))
$(CONFIGURE_EXEC): $(BUILD_SRC_APPS_DIR)Configure.py $(BUILD_SRC_APPS_DIR)pykob.pyd
$(call pykob-to-build-src,$(BUILD_SRC_APPS_DIR))
$(PY2BIN) $(CONFIGURE_BIN_FLAGS) $<
$(call pykob-to-dist,$@)
$(MKOB_EXEC): MKOB_SOURCES := $(shell for d in $(REQUIRED_BIN_DIRS); \
do \
[[ -d $$d ]] || mkdir -p $$d; \
done; \
$(CP) -rup $(ORIGINAL_SRC_MKOB_SHELL) $(BUILD_SRC_APPS_DIR))
$(MKOB_EXEC): MKOB_DIST_DIR := $(BIN_DIR)MKOB$(DIST_DIR_EXT)
$(MKOB_EXEC): MKOB.py $(BUILD_SRC_APPS_DIR)pkappargs.pyd $(BUILD_SRC_APPS_DIR)pykob.pyd
$(PY2BIN) $(MKOB_BIN_FLAGS) $<
$(MKDIR) $(MKOB_DIST_DIR)resources
$(CP) $(SRC_PY_RES_DIR)MKOB-Logo.png $(MKOB_DIST_DIR)resources
$(call pykob-to-dist,$@)
$(call pkappargs-to-dist,$@)
$(MRT_EXEC): MRT_SOURCES := $(shell for d in $(REQUIRED_BIN_DIRS); \
do \
[[ -d $$d ]] || mkdir -p $$d; \
done; \
$(CP) -rup $(ORIGINAL_SRC_MRT) $(BUILD_SRC_APPS_DIR))
$(MRT_EXEC): MRT.py $(BUILD_SRC_APPS_DIR)pkappargs.pyd $(BUILD_SRC_APPS_DIR)pykob.pyd
$(PY2BIN) $(MRT_BIN_FLAGS) $<
$(call pykob-to-dist,$@)
$(call pkappargs-to-dist,$@)
$(TGRM_EXEC): TGRM_SOURCES := $(shell for d in $(REQUIRED_BIN_DIRS); \
do \
[[ -d $$d ]] || mkdir -p $$d; \
done; \
$(CP) -rup $(ORIGINAL_SRC_TGRM) $(BUILD_SRC_APPS_DIR))
$(TGRM_EXEC): TGRM_DIST_DIR := $(BIN_DIR)Telegram$(DIST_DIR_EXT)
$(TGRM_EXEC): Telegram.py $(BUILD_SRC_APPS_DIR)pykob.pyd
$(PY2BIN) $(TGRM_BIN_FLAGS) $<
$(MKDIR) $(TGRM_DIST_DIR)resources
$(CP) $(SRC_PY_RES_DIR)Telegram-Logo.png $(TGRM_DIST_DIR)resources
$(call pykob-to-dist,$@)
$(SYSCHECK_EXEC): UTILS_SOURCES := $(shell for d in $(REQUIRED_BIN_DIRS); \
do \
[[ -d $$d ]] || mkdir -p $$d; \
done; \
$(CP) -rup $(ORIGINAL_SRC_UTILS_SHELL) $(BUILD_SRC_UTILS_DIR))
$(SYSCHECK_EXEC): $(BUILD_SRC_UTILS_DIR)Syscheck.py $(BUILD_SRC_UTILS_DIR)pykob.pyd
$(PY2BIN) $(SYSCHECK_BIN_FLAGS) $<
$(call pykob-to-dist,$@)
$(call pkappargs-to-dist,$@)
pkappargs.pyd: $(PKAPPARGS_PKG_BIN_FILE)
$(CP) $< $(dir $<)$@
$(PKAPPARGS_PKG_BIN_FILE): $(SRC_PY_PKAPPARGS)
$(PY2BIN) $(PKAPPARGS_PACKAGE_FLAGS)
$(BUILD_SRC_APPS_DIR)pkappargs.pyd: pkappargs.pyd
$(call pkappargs-to-build-src,$(BUILD_SRC_APPS_DIR))
pykob.pyd: $(PYKOB_PKG_BIN_FILE)
$(CP) $< $(dir $<)$@
$(BUILD_SRC_APPS_DIR)pykob.pyd: pykob.pyd
$(call pykob-to-build-src,$(BUILD_SRC_APPS_DIR))
$(BUILD_SRC_UTILS_DIR)pykob.pyd: pykob.pyd
$(call pykob-to-build-src,$(BUILD_SRC_UTILS_DIR))
$(PYKOB_PKG_BIN_FILE): $(SRC_PY_PYKOB) $(SRC_PYKOB_DATA_SHELL) $(SRC_PYKOB_RESOURCES_SHELL)
$(PY2BIN) $(PYKOB_PACKAGE_FLAGS)