1 # ------------------------------------------------------------------------
2 # local variable overrides
10 # ------------------------------------------------------------------------
15 @echo " extra packages"
16 @echo " ext - build all extra packages"
17 @echo " ext-install - install extra packages in system dir"
18 @echo " ext-install-user - install extra packages in user home dir"
19 @echo " ext-check - check if sources are uptodate"
20 @echo " ext-update - update everything from git submodules"
22 # ------------------------------------------------------------------------
25 EXT_SM_NAMES = libixp wmii
26 EXT_SM_DIRS = ${EXT_SM_NAMES:%=${EXT_DIR}/%}
27 EXT_SM_REGEXP = submodule\.($(shell echo ${EXT_SM_DIRS} | tr ' ' '|'))\.url
28 EXT_SM_COUNT = $(shell echo ${EXT_SM_NAMES} | wc -w)
30 .PHONY: ext-check ext-update
33 @echo "Checking git submodules..."
34 ${Q} if ! test ${EXT_SM_COUNT} = $$(git config --get-regexp "${EXT_SM_REGEXP}" | wc -l) ; then \
35 echo "ERROR: submodules not initialized, run:" >&2 ; \
36 echo " make update" >&2 ; \
37 $(if ${NOCHECK},true,false) ; \
39 ${Q} if (git submodule status | grep '^[+-]' 2>/dev/null) ; then \
40 echo "ERROR: submodules out of date, run:" >&2 ; \
41 echo " make update" >&2 ; \
42 $(if ${NOCHECK},true,false) ; \
48 @echo "Updating git submodules..."
49 ${Q} if ! test ${EXT_SM_COUNT} = $$(git config --get-regexp "${EXT_SM_REGEXP}" | wc -l) ; then \
50 git submodule init ; \
52 ${Q} if (git submodule status | grep '^[+-]' 2>/dev/null) ; then \
53 git submodule update ; \
57 # ------------------------------------------------------------------------
60 .PHONY: ext-libixp-check
62 # NOTE: by default we assume that libixp is available in ext directory
63 EXT_IXP_PREFIX = ${PWD}/${EXT_DIR}/libixp
64 EXT_IXP_LIB_DIR = ${EXT_IXP_PREFIX}/lib
65 EXT_IXP_INC_DIR = ${EXT_IXP_PREFIX}/include
67 EXT_IXP_A = ${EXT_IXP_LIB_DIR}/libixp.a
68 EXT_IXP_H = ${EXT_IXP_INC_DIR}/ixp.h
71 @echo "Checking for libixp..."
72 $(if $(wildcard ${EXT_IXP_A}),,$(error could not find libixp.a in ${EXT_IXP_PREFIX}; set EXT_IXP_PREFIX appropriately))
73 $(if $(wildcard ${EXT_IXP_H}),,$(error could not find ixp.h in ${EXT_IXP_PREFIX}; set EXT_IXP_PREFIX appropriately))
76 # ------------------------------------------------------------------------
77 # building & installing
82 .PHONY: ext-all ext-clean ext-install ext-install-user ext-user
84 ext-all ext-user: BUILD_STR="BUILD"
85 ext-install ext-install-user: BUILD_STR="INSTALL"
87 ext-all ext-user: BUILD_BASE_RULE=all
88 ext-all ext-user: BUILD_WMIIRCLUA_RULE=all
90 ext-install ext-install-user: BUILD_BASE_RULE=install
91 ext-install: BUILD_WMIIRCLUA_RULE=install
92 ext-install-user: BUILD_WMIIRCLUA_RULE=install-user
94 ext-all ext-install: BUILD_RULE=all
95 ext-all ext-install: BUILD_PREFIX=${PREFIX}
96 ext-all: ext-build-helper
97 ext-install: ext-build-helper
98 ext-install: install-variable-check
100 ext-user ext-install-user: BUILD_RULE=all
101 ext-user ext-install-user: BUILD_PREFIX=${HOME_PREFIX}
102 ext-user: ext-build-helper
103 ext-install-user: ext-build-helper
104 ext-install-user: install-user-variable-check
106 ext-clean: BUILD_RULE=clean
107 ext-clean: BUILD_PREFIX=
108 ext-clean: ext-build-helper
110 .PHONY: ext-build-helper
111 ext-build-helper: ext-check
112 $(if ${BUILD_RULE},,$(error $@ is an internal rule))
114 @echo ${BUILD_STR} libixp
115 ${Q} ${MAKE} -C ${EXT_DIR}/libixp ${BUILD_RULE} \
117 "PREFIX=${BUILD_PREFIX}" \
120 ifeq (${BUILD_RULE},clean)
121 ${MAKE} ext-libixp-check
124 @echo ${BUILD_STR} wmii
125 ${Q} ${MAKE} -C ${EXT_DIR}/wmii ${BUILD_RULE} \
126 "INCLUDE=${EXT_IXP_INC_DIR}:${INCLUDE}" \
127 "LIBIXP=${EXT_IXP_A}" "CC=${CCPIC}" \
128 "PREFIX=${BUILD_PREFIX}" \
132 @echo ${BUILD_STR} OK
135 # ------------------------------------------------------------------------
139 gitclean: lcl-gitclean
141 @echo GITCLEAN libixp
142 -${Q} cd ${EXT_DIR}/libixp && git clean -d -x -f
145 -${Q} cd ${EXT_DIR}/wmii && git clean -d -x -f