-
Notifications
You must be signed in to change notification settings - Fork 1
/
make.modsw
112 lines (83 loc) · 3.67 KB
/
make.modsw
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#***********************************************************************
#
#
#***********************************************************************/
#
# The modsw directories install a SUBDIR_HINT_FILE in the
# base build tree to tell the base build tree where the modsw dir is.
# Basically, the hint file is the modsw's location with all directory
# separators '/' replaced with '=' and prefixed with "hintfile"
#
modsw_location := $(patsubst /%,hintfile=%,$(shell pwd))
MODSW_SUBDIR_HINT_FILE := $(subst /,=,$(modsw_location))
#
# these are just a bunch of rules used by various modsw subdirs
# to install and clean hint files in the base build tree
#
generic_private_app_modsw_install:
mkdir -p $(BUILD_DIR)/userspace/private/apps/.modswdirs
touch $(BUILD_DIR)/userspace/private/apps/.modswdirs/$(MODSW_SUBDIR_HINT_FILE)
generic_private_app_modsw_clean:
rm -f $(BUILD_DIR)/userspace/private/apps/.modswdirs/$(MODSW_SUBDIR_HINT_FILE)
generic_hostTools_modsw_install:
mkdir -p $(BUILD_DIR)/hostTools/.modswdirs
touch $(BUILD_DIR)/hostTools/.modswdirs/$(MODSW_SUBDIR_HINT_FILE)
generic_hostTools_modsw_clean:
rm -f $(BUILD_DIR)/hostTools/.modswdirs/$(MODSW_SUBDIR_HINT_FILE)
generic_cmsutil_contrib_lib_modsw_install:
mkdir -p $(BUILD_DIR)/userspace/public/libs/cms_util/.modswdirs
touch $(BUILD_DIR)/userspace/public/libs/cms_util/.modswdirs/$(MODSW_SUBDIR_HINT_FILE)
generic_cmsutil_contrib_lib_modsw_clean:
rm -f $(BUILD_DIR)/userspace/public/libs/cms_util/.modswdirs/$(MODSW_SUBDIR_HINT_FILE)
generic_public_include_modsw_install:
mkdir -p $(BUILD_DIR)/userspace/public/include/.modswdirs
touch $(BUILD_DIR)/userspace/public/include/.modswdirs/$(MODSW_SUBDIR_HINT_FILE)
generic_public_include_modsw_clean:
rm -f $(BUILD_DIR)/userspace/public/include/.modswdirs/$(MODSW_SUBDIR_HINT_FILE)
generic_subdir_modsw_install:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir modsw_install; \
done
generic_subdir_modsw_clean:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir modsw_clean; \
done
# find auto-detect subdirs in the directory.
# Auto-detect subdirs are subdirs which are still in the base build tree,
# but not listed in the upper level makefile.
# strip out the /.autodetect part, leaving only the directory name.
tmp_subdir_list := $(shell ls */.autodetect 2> /dev/null)
AUTODETECT_SUBDIRS := $(subst /.autodetect,,$(tmp_subdir_list))
# find modular sw directories.
# These are directories which live outside the base build tree but a hint
# file has been installed in the base build tree to let it know where to
# to to build the modsw dir
tmp_subdir_list := $(shell ls .modswdirs 2> /dev/null)
modsw_subdir_list := $(subst =,/,$(subst hintfile=,/,$(tmp_subdir_list)))
MODSW_SUBDIRS := $(modsw_subdir_list)
# find any libraries contributed by modsw to this library
MODSW_CONTRIB_LIBS_DIRS := $(modsw_subdir_list)
generic_modsw_contrib_libs_make:
for dir in $(MODSW_CONTRIB_LIBS_DIRS); do \
$(MAKE) -C $$dir; \
done
# must use delayed evaluation here so that the .a is made before
# we try to find it.
ifneq ($(strip $(MODSW_CONTRIB_LIBS_DIRS)),)
MODSW_CONTRIB_LIBS = $(shell find $(MODSW_CONTRIB_LIBS_DIRS) -name '*.a')
endif
# This rule is used by libraries to do a clean of any sub-libraries
# contributed by modsw
#
generic_modsw_contrib_libs_clean:
for dir in $(MODSW_CONTRIB_LIBS_DIRS); do \
$(MAKE) -C $$dir clean; \
done
# Remove any installation effects of modsw in the base dir
generic_modsw_base_clean:
rm -rf .modswdirs
# create a list of include paths to modular sw include dirs
incdir_list := $(shell ls $(BUILD_DIR)/userspace/public/include/.modswdirs 2> /dev/null)
ifneq ($(strip $(incdir_list)),)
MODSW_PUBLIC_INCLUDE := $(subst =,/,$(subst hintfile=,-I/,$(incdir_list)))
endif