fix INCLUDE path for libixp when building wmii
[wmiirc-lua.git] / Makefile
blob730bb879402d36ae6f6704105377b7841cf73dd1
1 # ------------------------------------------------------------------------
2 # default target
4 .PHONY: default
5 default: all
7 # ------------------------------------------------------------------------
8 # includes and defines
10 ifneq ($(MAKECMDGOALS),gitclean)
11 include config.mk
12 include Makefile.ext
13 include Makefile.check
14 endif
16 # ------------------------------------------------------------------------
17 # main targets
19 .PHONY: all help docs clean distclean gitclean tags
21 all clean distclean docs install install-user:
22 ${MAKE} -C src $@
24 gitclean:
25 $(if $(wildcard .git/config),,$(error this is not a git repository))
26 git clean -d -x -f
28 # ------------------------------------------------------------------------
29 # help
31 help:
32 @echo "make [target]"
33 @echo
34 @echo " general targets"
35 @echo " all - build everything"
36 @echo " docs - build documentation"
37 @echo " clean - clean up build"
38 @echo " distclean - clean even more"
39 @echo " gitclean - clean everything not tracked by git"
40 @echo " install - install in system dir"
41 @echo " install-user - install in user home dir"
42 @echo
43 @echo " development targets"
44 @echo " tags - build ctags/cscope index"
45 @echo
46 @${MAKE} -s ext-help
48 # ------------------------------------------------------------------------
49 # config
51 config.mk: config.mk.dist
52 if test -f $@ ; then \
53 touch $@ ; \
54 else \
55 cp $< $@ ; \
58 # ------------------------------------------------------------------------
59 # local dependencies for main rules
61 .PHONY: lcl-clean lcl-distclean
63 clean: lcl-clean
64 lcl-clean:
65 -rm -f *~ */*~
66 -rm -f cscope.files cscope.out tags
68 distclean: lcl-distclean
69 lcl-distclean: clean
70 -rm -f config.mk
72 .PHONY:
74 install: install-variable-check
76 install-user: install-user-variable-check
78 # ------------------------------------------------------------------------
79 # tags and cscope
81 .PHONY: cscope tags
83 cscope.files::
84 find . -name '*.[ch]' -o -name '*.lua' | grep -v -e CVS -e SCCS > cscope.files
86 cscope: cscope.out
87 cscope.out: cscope.files
88 -cscope -P`pwd` -b
90 tags: cscope.out
91 rm -f tags
92 xargs -n 50 ctags -a < cscope.files