fix for the no-posix detection patch (thanks to Ian Ward)
[wmiirc-lua.git] / Makefile
blob100c89cd40370cb162d7753ed86722a7cd634a2d
1 include config.mk
3 MAN = wmii.3lua
6 # ------------------------------------------------------------------------
7 # main target
9 .PHONY: all help deb debi libs luaixp luaeventloop docs man clean tags install install-user
10 all: libs man
12 help:
13 @echo "make [target]"
14 @echo
15 @echo " general targets"
16 @echo " all - build everything"
17 @echo " libs - build libraries"
18 @echo " docs - build documentation"
19 @echo " clean - clean up build"
20 @echo " install - install in system dir"
21 @echo " install-user - install in user home dir"
22 @echo
23 @echo " development targets"
24 @echo " tags - build ctags index"
25 @echo " cscope - build cscope index"
26 @echo
27 @echo " Debian targets"
28 @echo " deb - build the .deb"
29 @echo " debi - install the deb"
31 deb:
32 debuild
34 debi: deb
35 sudo debi
37 config.mk: config.mk.dist
38 if test -f $@ ; then \
39 touch $@ ; \
40 else \
41 cp $< $@ ; \
44 # ------------------------------------------------------------------------
45 # building
47 libs: luaeventloop luaixp
48 luaeventloop luaixp:
49 ${MAKE} -C $@
51 docs: man
52 man: ${MAN}
53 ${MAN}: core/wmii.lua
54 ${POD2MAN} \
55 --name=wmii \
56 --center="WMII Lua Integration" \
57 --section=3lua \
58 --release="wmii 3.6" \
59 $< $@
61 # ------------------------------------------------------------------------
62 # cleaning
64 clean:
65 -rm -f *~ */*~
66 -rm -f wmii.3lua
67 -rm -f cscope.files cscope.out tags
68 -${MAKE} -C luaixp clean
69 -${MAKE} -C luaeventloop clean
71 # ------------------------------------------------------------------------
72 # installing
75 # install system wide
77 install: ${MAN}
78 # create directories
79 ${INSTALL} -d ${ALL_INSTALL_DIRS}
81 # install libraries
82 ${MAKE} -C luaixp install
83 ${MAKE} -C luaeventloop install
85 # install core and plugin lua scripts
86 ${INSTALL} -m 0644 -t ${CORE_LUA_DIR} core/*.lua
87 ${INSTALL} -m 0644 -t ${PLUGIN_LUA_DIR} plugins/*.lua
89 # install new config file
90 ${INSTALL} -m 0755 -t ${RC_DIR} wmiirc.lua
91 ${INSTALL} -m 0644 -t ${XS_DIR} wmii-lua.desktop
93 # install man page
94 ${INSTALL} -m 0644 -t ${MAN_DIR} ${MAN}
96 # install scripts
97 ${INSTALL} -m 0755 -t ${BIN_DIR} install-wmiirc-lua
98 ${INSTALL} -m 0755 -t ${BIN_DIR} wmii-lua
101 # install in user directory
103 install-user:
104 ifeq ($(shell pwd),$(wildcard ~/.wmii-3.5))
105 @echo "You're already in the ~/.wmii-3.5/ directory"
106 else
107 ${INSTALL} -d ${ALL_HOME_DIRS}
108 @if test -f ${HOME_WMII}/wmiirc ; then \
109 echo "NOTE: you might want to look at ${HOME_WMII}/wmiirc.dist" ; \
110 ${INSTALL} -T -m 0744 -b wmiirc.lua ${HOME_WMII}/wmiirc.dist ; \
111 else \
112 echo "Installing new ${HOME_WMII}/wmiirc" ; \
113 ${INSTALL} -T -m 0744 -b wmiirc.lua ${HOME_WMII}/wmiirc ; \
115 ${INSTALL} -m 0644 -b -t ${HOME_CORE} core/*.lua
116 ${INSTALL} -m 0644 -b -t ${HOME_PLUGINS} plugins/*.lua
117 ${INSTALL} -m 0644 -b -t ${HOME_WMII} ${MAN}
118 ${INSTALL} -m 0744 -t ${HOME_BIN_DIR} wmii-lua
119 ${MAKE} -C luaixp install-user
120 ${MAKE} -C luaeventloop install-user
122 install-user: ${MAN}
123 endif
125 .PHONY: xxx
126 xxx:
127 ${MAKE} all
128 sudo ${MAKE} install PREFIX=/usr
131 # ------------------------------------------------------------------------
132 # tags and cscope
134 cscope.files::
135 find . -name '*.[ch]' -o -name '*.lua' | grep -v -e CVS -e SCCS > cscope.files
137 cscope.out: cscope.files
138 -cscope -P`pwd` -b
140 tags: cscope.out
141 rm -f tags
142 xargs -n 50 ctags -a < cscope.files