-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 1.34 KB
/
Makefile
File metadata and controls
41 lines (31 loc) · 1.34 KB
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
# Top level makefile for all sub makefiles in the local directory structure.
#
# Support all, clean and install for all subdirs.
#
BUILD_DIR := $(shell pwd)/build
include dirs.mk
SUBDIRS = general linux net sandbox templates emacs git
SUBDIRS_ALL = $(SUBDIRS:%=all-%)
SUBDIRS_CLEAN = $(SUBDIRS:%=clean-%)
SUBDIRS_INSTALL = $(SUBDIRS:%=install-%)
.PHONY: all clean install $(SUBDIRS_ALL) $(SUBDIRS_CLEAN) $(SUBDIRS_INSTALL)
all: $(SUBDIRS_ALL)
clean: $(SUBDIRS_CLEAN)
install: $(SUBDIRS_INSTALL)
$(SUBDIRS_ALL):
@if [ ! -d $(BUILD_DIR) ]; then mkdir -p $(BUILD_DIR); fi
@if [ ! -d $(BUILD_BIN) ]; then mkdir -p $(BUILD_BIN); fi
@if [ ! -d $(BUILD_LIB) ]; then mkdir -p $(BUILD_LIB); fi
@if [ ! -d $(BUILD_FUNC) ]; then mkdir -p $(BUILD_FUNC); fi
@if [ ! -d $(BUILD_EMACS) ]; then mkdir -p $(BUILD_EMACS); fi
@if [ ! -d $(BUILD_DOT) ]; then mkdir -p $(BUILD_DOT); fi
$(MAKE) $(MAKE_FLAGS) -C $(@:all-%=%)
$(SUBDIRS_CLEAN):
$(MAKE) $(MAKE_FLAGS) -C $(@:clean-%=%) clean
$(SUBDIRS_INSTALL):
@if [ ! -d $(INSTALL_DIR) ]; then mkdir -p $(INSTALL_DIR); fi
@if [ ! -d $(INSTALL_BIN) ]; then mkdir -p $(INSTALL_BIN); fi
@if [ ! -d $(INSTALL_LIB) ]; then mkdir -p $(INSTALL_LIB); fi
@if [ ! -d $(INSTALL_FUNC) ]; then mkdir -p $(INSTALL_FUNC); fi
@if [ ! -d $(INSTALL_EMACS) ]; then mkdir -p $(INSTALL_EMACS); fi
$(MAKE) $(MAKE_FLAGS) -C $(@:install-%=%) install