forked from Illumina/DRAGMAP
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
95 lines (81 loc) · 3.12 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
############################################################
##
## DRAGEN Open Source Software
## Copyright (c) 2019-2020 Illumina, Inc.
## All rights reserved.
##
## This software is provided under the terms and conditions of the
## GNU GENERAL PUBLIC LICENSE Version 3
##
## You should have received a copy of the GNU GENERAL PUBLIC LICENSE Version 3
## along with this program. If not, see
## <https://github.com/illumina/licenses/>.
##
############################################################
##
## To configure the build, see config.mk
##
############################################################
include config.mk
all: $(programs:%=$(DRAGEN_OS_BUILD)/%)
.PHONY: clean
clean:
$(RMDIR) $(DRAGEN_OS_BUILD_DIR_BASE)
.PHONY: help
help: $(DRAGEN_OS_ROOT_DIR)/README.md
cat $<
.PHONY: help-targets
help-targets:
@$(ECHO) 'Default: all'
@$(ECHO) 'Help: help help-targets'
@$(ECHO) 'Cleanup: clean'
@$(ECHO) 'Install: install'
@$(ECHO) 'Libraries: $(library_targets)'
############################################################
##
## Rules and includes for the actual build as needed.
## empty MAKECMDGOALS defaults to "all". Inclusion must happen if any goal is not in "clean help"
##
############################################################
ifneq ($(filter-out clean help, $(or $(MAKECMDGOALS), all)),)
# Dependencies are initially generated with ".Td" extension to avoid issues if compiling fails afterwards
# and a POSTCOMPILE operation is needed to rename the file with the final ".d" extension
.PRECIOUS: %.d
DEPFLAGS = -MT $@ -MMD -MP -MF $(@:%.o=%.Td)
POSTCOMPILE ?= mv -f $(@:%.o=%.Td) $(@:%.o=%.d)
%.d: ;
# use a .sentinel file as a proxy to directories to avoid time stamp galore
.PRECIOUS: %/.sentinel
%/.sentinel:
@mkdir -p $* && touch $@
include $(wildcard $(DRAGEN_OS_BUILD)/testRunner.d)
# side effects:
# - builds 'libraries' variable required for linking programs, integration and system tests
# - builds and executes unit and integration tests for each librarry
ssw_lib_dirs_aux:=$(SSW_LIBS)
include $(foreach lib_dir, $(SSW_LIBS), $(DRAGEN_OS_MAKE_DIR)/ssw_lib.mk)
dragen_stub_lib_dirs_aux:=$(DRAGEN_STUB_LIBS)
include $(foreach lib_dir, $(DRAGEN_STUB_LIBS), $(DRAGEN_OS_MAKE_DIR)/dragen_stub_lib.mk)
dragen_lib_dirs_aux:=$(DRAGEN_LIBS)
include $(foreach lib_dir, $(DRAGEN_LIBS), $(DRAGEN_OS_MAKE_DIR)/dragen_lib.mk)
lib_dirs_aux:=$(DRAGEN_OS_LIBS)
include $(foreach lib_dir, $(DRAGEN_OS_LIBS), $(DRAGEN_OS_MAKE_DIR)/lib.mk)
programs_aux:=$(programs)
include $(foreach program, $(programs), $(DRAGEN_OS_MAKE_DIR)/program.mk)
# programs for system tests
ifeq (1,${HAS_GTEST})
include $(DRAGEN_OS_MAKE_DIR)/tests.mk
endif
include $(DRAGEN_OS_MAKE_DIR)/install.mk
endif
############################################################
##
## Tracing make variables
## Only add these targets if the goal is to print as it adds
## spurious targets for all non-print goals specified on the command line
##
############################################################
ifneq (,$(filter print-%, $(MAKECMDGOALS)))
print-%: ; @$(error $* is $($*) (from $(origin $*)))
$(filter-out print-%, $(MAKECMDGOALS)): $(filter print-%, $(MAKECMDGOALS))
endif