use V=1 to make Makefile verbose
[wmiirc-lua.git] / src / Makefile
blob5001171dd0a25e746865ae0e50db0e90db563311
1 TOP = ..
2 CONFIG_MK = ${TOP}/config.mk
4 include ${CONFIG_MK}
5 include ${TOP}/Makefile.rules
7 MAN = wmii.3lua
9 # ------------------------------------------------------------------------
10 # main target
12 .PHONY: all help libs luaixp luaeventloop docs man clean distclean install install-user
13 all: libs man
15 help:
16 @echo "make [target]"
17 @echo
18 @echo " general targets"
19 @echo " all - build everything"
20 @echo " libs - build libraries"
21 @echo " docs - build documentation"
22 @echo " clean - clean up build"
23 @echo " distclean - clean even more"
24 @echo " install - install in system dir"
25 @echo " install-user - install in user home dir"
26 @echo
27 @echo " development targets"
28 @echo " tags - build ctags index"
29 @echo " cscope - build cscope index"
31 # ------------------------------------------------------------------------
32 # building
34 libs: luaeventloop luaixp
35 luaeventloop luaixp:
36 ${Q} ${MAKE} -C $@
38 docs: man
39 man: ${MAN}
40 ${MAN}: core/wmii.lua
41 ${Q} ${POD2MAN} \
42 --name=wmii \
43 --center="WMII Lua Integration" \
44 --section=3lua \
45 --release="wmii 3.6" \
46 $< $@
48 # ------------------------------------------------------------------------
49 # cleaning
51 clean:
52 -${Q} rm -f *~ */*~
53 -${Q} rm -f wmii.3lua
54 -${Q} rm -f cscope.files cscope.out tags
55 -${Q} ${MAKE} -C luaixp clean
56 -${Q} ${MAKE} -C luaeventloop clean
58 distclean: clean
60 # ------------------------------------------------------------------------
61 # installing
64 # install system wide
66 install: ${MAN} install-variable-check
67 # create directories
68 ${Q} ${INSTALL} -d ${ALL_INSTALL_DIRS}
70 # install libraries
71 ${Q} ${MAKE} -C luaixp install
72 ${Q} ${MAKE} -C luaeventloop install
74 # install core and plugin lua scripts
75 ${Q} ${INSTALL} -m 0644 -t ${CORE_LUA_DIR} core/*.lua
76 ${Q} ${INSTALL} -m 0644 -t ${PLUGIN_LUA_DIR} plugins/*.lua
78 # install new config file
79 ${Q} ${INSTALL} -m 0755 -t ${RC_DIR} wmiirc.lua
80 ${Q} ${INSTALL} -m 0644 -t ${XS_DIR} wmii-lua.desktop
82 # install man page
83 ${Q} ${INSTALL} -m 0644 -t ${MAN_DIR} ${MAN}
85 # install scripts
86 ${Q} ${INSTALL} -m 0755 -t ${BIN_DIR} install-wmiirc-lua
87 ${Q} ${INSTALL} -m 0755 -t ${BIN_DIR} wmii-lua
90 # install in user directory
92 install-user: install-user-variable-check
93 ifeq ($(shell pwd),$(wildcard ~/.wmii-3.5))
94 @echo "You're already in the ~/.wmii-3.5/ directory"
95 else
96 ${Q} ${INSTALL} -d ${ALL_HOME_DIRS}
97 ${Q} if test -f ${HOME_WMII}/wmiirc ; then \
98 echo "NOTE: you might want to look at ${HOME_WMII}/wmiirc.dist" ; \
99 ${INSTALL} -T -m 0744 -b wmiirc.lua ${HOME_WMII}/wmiirc.dist ; \
100 else \
101 echo "Installing new ${HOME_WMII}/wmiirc" ; \
102 ${INSTALL} -T -m 0744 -b wmiirc.lua ${HOME_WMII}/wmiirc ; \
104 ${Q} ${INSTALL} -m 0644 -b -t ${HOME_CORE} core/*.lua
105 ${Q} ${INSTALL} -m 0644 -b -t ${HOME_PLUGINS} plugins/*.lua
106 ${Q} ${INSTALL} -m 0644 -b -t ${HOME_WMII} ${MAN}
107 ${Q} ${INSTALL} -m 0744 -t ${HOME_BIN_DIR} wmii-lua
108 ${Q} ${MAKE} -C luaixp install-user
109 ${Q} ${MAKE} -C luaeventloop install-user
111 install-user: ${MAN}
112 endif
115 # ------------------------------------------------------------------------
116 # helpers from ${TOP} dir
118 .PHONY: install-variable-check install-user-variable-check tags cscope
120 ${CONFIG_MK}:
121 ${Q} ${MAKE} -C $(dir ${CONFIG_MK}) $(notdir ${CONFIG_MK})
123 install-variable-check install-user-variable-check tags cscope:
124 ${Q} ${MAKE} -C ${TOP} $@