moved source files to src directory
[wmiirc-lua.git] / src / Makefile
blob7d9d149825c1ab21ceae7a1ae1b0f4dda46849b8
1 TOP = ..
2 CONFIG_MK = ${TOP}/config.mk
4 include ${CONFIG_MK}
6 MAN = wmii.3lua
8 # ------------------------------------------------------------------------
9 # main target
11 .PHONY: all help libs luaixp luaeventloop docs man clean distclean install install-user
12 all: libs man
14 help:
15 @echo "make [target]"
16 @echo
17 @echo " general targets"
18 @echo " all - build everything"
19 @echo " libs - build libraries"
20 @echo " docs - build documentation"
21 @echo " clean - clean up build"
22 @echo " distclean - clean even more"
23 @echo " install - install in system dir"
24 @echo " install-user - install in user home dir"
25 @echo
26 @echo " development targets"
27 @echo " tags - build ctags index"
28 @echo " cscope - build cscope index"
30 # ------------------------------------------------------------------------
31 # building
33 libs: luaeventloop luaixp
34 luaeventloop luaixp:
35 ${MAKE} -C $@
37 docs: man
38 man: ${MAN}
39 ${MAN}: core/wmii.lua
40 ${POD2MAN} \
41 --name=wmii \
42 --center="WMII Lua Integration" \
43 --section=3lua \
44 --release="wmii 3.6" \
45 $< $@
47 # ------------------------------------------------------------------------
48 # cleaning
50 clean:
51 -rm -f *~ */*~
52 -rm -f wmii.3lua
53 -rm -f cscope.files cscope.out tags
54 -${MAKE} -C luaixp clean
55 -${MAKE} -C luaeventloop clean
57 distclean: clean
59 # ------------------------------------------------------------------------
60 # installing
63 # install system wide
65 install: ${MAN} install-variable-check
66 # create directories
67 ${INSTALL} -d ${ALL_INSTALL_DIRS}
69 # install libraries
70 ${MAKE} -C luaixp install
71 ${MAKE} -C luaeventloop install
73 # install core and plugin lua scripts
74 ${INSTALL} -m 0644 -t ${CORE_LUA_DIR} core/*.lua
75 ${INSTALL} -m 0644 -t ${PLUGIN_LUA_DIR} plugins/*.lua
77 # install new config file
78 ${INSTALL} -m 0755 -t ${RC_DIR} wmiirc.lua
79 ${INSTALL} -m 0644 -t ${XS_DIR} wmii-lua.desktop
81 # install man page
82 ${INSTALL} -m 0644 -t ${MAN_DIR} ${MAN}
84 # install scripts
85 ${INSTALL} -m 0755 -t ${BIN_DIR} install-wmiirc-lua
86 ${INSTALL} -m 0755 -t ${BIN_DIR} wmii-lua
89 # install in user directory
91 install-user: install-user-variable-check
92 ifeq ($(shell pwd),$(wildcard ~/.wmii-3.5))
93 @echo "You're already in the ~/.wmii-3.5/ directory"
94 else
95 ${INSTALL} -d ${ALL_HOME_DIRS}
96 @if test -f ${HOME_WMII}/wmiirc ; then \
97 echo "NOTE: you might want to look at ${HOME_WMII}/wmiirc.dist" ; \
98 ${INSTALL} -T -m 0744 -b wmiirc.lua ${HOME_WMII}/wmiirc.dist ; \
99 else \
100 echo "Installing new ${HOME_WMII}/wmiirc" ; \
101 ${INSTALL} -T -m 0744 -b wmiirc.lua ${HOME_WMII}/wmiirc ; \
103 ${INSTALL} -m 0644 -b -t ${HOME_CORE} core/*.lua
104 ${INSTALL} -m 0644 -b -t ${HOME_PLUGINS} plugins/*.lua
105 ${INSTALL} -m 0644 -b -t ${HOME_WMII} ${MAN}
106 ${INSTALL} -m 0744 -t ${HOME_BIN_DIR} wmii-lua
107 ${MAKE} -C luaixp install-user
108 ${MAKE} -C luaeventloop install-user
110 install-user: ${MAN}
111 endif
114 # ------------------------------------------------------------------------
115 # helpers from ${TOP} dir
117 .PHONY: install-variable-check install-user-variable-check tags cscope
119 ${CONFIG_MK}:
120 ${MAKE} -C $(dir ${CONFIG_MK}) $(notdir ${CONFIG_MK})
122 install-variable-check install-user-variable-check tags cscope:
123 ${MAKE} -C ${TOP} $@