fix new battery plugin to work better with multiple batteries present
[wmiirc-lua.git] / Makefile
blob45ee6ff4d91ace125c764559b252946e1eeae454
1 # ------------------------------------------------------------------------
2 # default target
4 .PHONY: default
5 default: all
7 # ------------------------------------------------------------------------
8 # includes and defines
10 ifneq ($(MAKECMDGOALS),gitclean)
11 $(if $(wildcard config.mk),,$(shell cp config.mk.in config.mk))
12 include config.mk
13 endif
14 include Makefile.ext
15 include Makefile.check
16 include Makefile.rules
18 # ------------------------------------------------------------------------
19 # main targets
21 .PHONY: all help docs clean distclean gitclean tags
23 all clean distclean docs install install-user:
24 @echo Running '$@' in src...
25 ${Q} ${MAKE} -C src $@
27 gitclean:
28 @echo GITCLEAN
29 $(if $(wildcard .git/config),,$(error this is not a git repository))
30 ${Q} git clean -d -x -f
32 # ------------------------------------------------------------------------
33 # help
35 help:
36 @echo "make [target]"
37 @echo
38 @echo " general targets"
39 @echo " all - build everything"
40 @echo " docs - build documentation"
41 @echo " clean - clean up build"
42 @echo " distclean - clean even more"
43 @echo " gitclean - clean everything not tracked by git"
44 @echo " install - install in system dir"
45 @echo " install-user - install in user home dir"
46 @echo
47 @echo " development targets"
48 @echo " tags - build ctags/cscope index"
49 @echo
50 @${MAKE} -s ext-help
52 # ------------------------------------------------------------------------
53 # local dependencies for main rules
55 .PHONY: lcl-clean lcl-distclean
57 clean: lcl-clean
58 lcl-clean:
59 -${Q} rm -f *~
60 -${Q} rm -f cscope.files cscope.out tags
62 distclean: lcl-distclean
63 lcl-distclean: clean
64 -${Q} rm -f config.mk
66 .PHONY:
68 install: install-variable-check
70 install-user: install-user-variable-check
72 # ------------------------------------------------------------------------
73 # tags and cscope
75 .PHONY: cscope tags
77 cscope.files::
78 ${Q} find . -name '*.[ch]' -o -name '*.lua' | grep -v -e CVS -e SCCS > cscope.files
80 cscope: cscope.out
81 cscope.out: cscope.files
82 -${Q} cscope -P`pwd` -b
84 tags: cscope.out
85 ${Q} rm -f tags
86 ${Q} xargs -n 50 ctags -a < cscope.files