-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile
98 lines (76 loc) · 2 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
# Updates content of SD directory.
#
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Supported environments:
# * GNU on Linux, FreeBSD etc.
# * GNU on Windows NT (using MinGW/MSYS/Cygwin/WSL)
#
# Build the project:
# make [all]
# Compile only:
# make build | build-<TARGET>
# Install:
# make install | install-<TARGET>
# Uninstall:
# make uninstall | uninstall-<TARGET>
# Clean:
# make clean | clean-<TARGET>
# make distclean | distclean-<TARGET>
#
# where:
# <TARGET> is one of the values for `TARGETS' variable.
include sdk/common.mk
# Use uppercase for FAT filesystem
prefix ?= SD
TARGETS=\
utils\
software
.PHONY: all
all: install
@echo 'Done.'
# utils
.PHONY: build-utils
build-utils: | utils
$(MAKE) -w -C $|
.PHONY: install-utils
install-utils: | utils
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) install
.PHONY: uninstall-utils
uninstall-utils: | utils
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) uninstall
.PHONY: clean-utils
clean-utils: | utils
$(MAKE) -w -C $| clean
.PHONY: distclean-utils
distclean-utils: | utils
$(MAKE) -w -C $| distclean
# software
.PHONY: build-software
build-software: | software
$(MAKE) -w -C $|
.PHONY: install-software
install-software: | software
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) install
.PHONY: uninstall-software
uninstall-software: | software
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) uninstall
.PHONY: clean-software
clean-software: | software
$(MAKE) -w -C $| clean
.PHONY: distclean-software
distclean-software: | software
$(MAKE) -w -C $| distclean
# all
.PHONY: build
build: $(foreach t,$(TARGETS),build-$(t))
.PHONY: install
install: $(foreach t,$(TARGETS),install-$(t))
.PHONY: uninstall
uninstall: $(foreach t,$(TARGETS),uninstall-$(t))
.PHONY: clean
clean: $(foreach t,$(TARGETS),clean-$(t))
.PHONY: distclean
distclean: $(foreach t,$(TARGETS),distclean-$(t))