-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (44 loc) · 1.27 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
# This is the top-level Makefile for all source packages.
# It makes all the code in the "src" directory, then installs it
# in the "install" directory, then makes the images in
# the images directory (if present).
ROOT_DIR := $(notdir $(CURDIR))
ifndef QCONFIG
QCONFIG=qconfig.mk
endif
include $(QCONFIG)
unexport ROOT_DIR
.PHONY: all install clean links make_links dummy images prebuilt binaries run
# Expands to a single newline character
define NEWLINE
endef
SUFFIXES := .mk
all: install links $(if $(wildcard images/*),images)
@echo done
subdirs:=$(subst /Makefile,,$(wildcard */[Mm]akefile))
clean:
$(foreach dir,$(subdirs), $(MAKE) -C$(dir) clean $(NEWLINE))
-$(RM_HOST) -r install/*
install: $(if $(wildcard prebuilt/*),prebuilt)
$(MAKE) -Csrc hinstall
$(MAKE) -Csrc
$(MAKE) -Csrc install
#
# Have to invoke "make_links" target because the first make expands
# the $(wildcard ...) too soon - we might not have copied things into
# the "install" tree yet.
#
links:
$(MAKE) make_links
make_links:
$(foreach file,$(wildcard install/*/boot/build/*),cd images;$(LN_HOST) ../$(file) $(notdir $(file));cd ..; )
images:
$(MAKE) -Cimages
prebuilt:
cp -rf prebuilt/* install
run:
@$(MAKE) -Cimages run
run-sudo:
@$(MAKE) -Cimages run-sudo
run-tap:
@$(MAKE) -Cimages run-tap