-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
73 lines (53 loc) · 1.5 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
.PHONY: default
default: build-all
# First check that our environment has the necessary stuff set
define env-msg :=
The following environment variables must be defined:
EGL_STACK (suggested: $(CURDIR))
EGL_TOOLS (suggested: $$EGL_STACK/egl-tools)
endef
ifndef EGL_TOOLS
$(error $(env-msg))
endif
ifndef EGL_STACK
$(error $(env-msg))
endif
# Sub projects to build
UPCYCLE=upcycle
LIBELECTRON=electron/libelectron
ELECTRON_TF=electron/electron-tf
ELECTRON_TEST=electron/electron-test
ELECTRON=$(LIBELECTRON) $(ELECTRON_TF) $(ELECTRON_TEST)
LIBPHOTON=photon/libphoton
PHOTON=$(LIBPHOTON)
GROUPS=$(ELECTRON) $(PHOTON)
PROJECTS=$(UPCYCLE) $(LIBELECTRON) $(ELECTRON_TEST) $(LIBPHOTON)
.PHONY: electron-all
electron-all: $(ELECTRON)
.PHONY: photon-all
photon-all: $(PHOTON)
.PHONY: build-all $(PROJECTS)
build-all: $(PROJECTS)
CLEAN_PROJECTS := $(PROJECTS:%=clean-%)
.PHONY: clean-all $(CLEAN_PROJECTS)
clean-all: $(CLEAN_PROJECTS)
# Dependency Graph
$(LIBPHOTON): $(UPCYCLE)
$(LIBELECTRON): $(UPCYCLE) $(PHOTON)
$(ELECTRON_TF): $(LIBELECTRON)
$(ELECTRON_TEST): $(LIBELECTRON)
$(PROJECTS):
$(MAKE) -C $@ install
$(PROJECTS:%=clean-%):
$(MAKE) -C $(@:clean-%=%) clean
# Nuke and (hopefully) pave...
.PHONY: full-rebuild
full-rebuild:
@echo "Wipe \$$EGL_TOOLS ($$EGL_TOOLS) and rebuild everything?"
@read -p "[Y/n]: " yn && { [ -z "$$yn" ] || [ "$$yn" = Y ] || [ "$$yn" = y ]; }
$(MAKE) full-rebuild-nocheck
.PHONY: full-rebuild-nocheck
full-rebuild-nocheck:
rm -rf "$$EGL_TOOLS"
$(MAKE) clean-all
$(MAKE) build-all