Makefile revision 0bbfda8a
1# This just shortcuts stuff through to cmake
2all build ctwm man man-html man-all install clean: build/Makefile
3	( cd build && ${MAKE} ${@} )
4
5build/Makefile cmake: CMakeLists.txt
6	( mkdir -p build && cd build && \
7		cmake -DCMAKE_C_FLAGS:STRING="${CFLAGS}" ${CMAKE_EXTRAS} .. )
8
9allclean distclean:
10	rm -rf build/*
11
12
13
14#
15# The below targets are mostly only of interest to developers
16#
17
18# Add'l thunks to cmake
19.PHONY: tags
20man-pdf doxygen doxyclean tags: build/Makefile
21	( cd build && ${MAKE} ${@} )
22
23# Make sure everything's build before running tests
24.PHONY: test
25test:
26	( cd build && ${MAKE} test_bins )
27	( cd build && ${MAKE} CTEST_OUTPUT_ON_FAILURE=1 ${@} )
28
29# Reindent files
30indent:
31	astyle -n --options=tools/ctwm.astyle *.h *.c
32
33
34# Build documentation files
35DOC_FILES=README.html CHANGES.html
36docs: ${DOC_FILES}
37docs_clean doc_clean:
38	rm -f ${DOC_FILES}
39
40.SUFFIXES: ${.SUFFIXES} .html .md
41.md.html:
42	multimarkdown -afo ${@} ${<}
43
44
45# asciidoc files
46UMAN=doc/manual
47adocs:
48	(cd ${UMAN} && make all_set_version)
49adocs_pregen:
50	(cd ${UMAN} && make all)
51adoc_clean:
52	(cd ${UMAN} && make clean)
53
54
55#
56# Pre-build some files for tarballs
57#
58GEN=gen
59${GEN}:
60	mkdir -p ${GEN}
61
62# All the generated source files
63_RELEASE_FILES=gram.tab.c gram.tab.h lex.c version.c.in ctwm.1 ctwm.1.html
64RELEASE_FILES=${_RELEASE_FILES:%=${GEN}/%}
65
66# Build those, the .html versions of the above docs, and the HTML/man
67# versions of the manual
68release_files: ${GEN} build/MKTAR_GENFILES ${RELEASE_FILES} ${DOC_FILES}
69release_clean: doc_clean adoc_clean
70	rm -rf ${GEN}
71
72# Stuff for thunking to cmake
73build/MKTAR_GENFILES: build/Makefile
74	(cd build ; make mktar_genfiles)
75
76# The config grammar
77${GEN}/gram.tab.c: ${GEN}/gram.tab.h
78${GEN}/gram.tab.h: ${GEN} gram.y build/MKTAR_GENFILES
79	cp build/gram.tab.[ch] ${GEN}/
80
81${GEN}/lex.c: ${GEN} lex.l build/MKTAR_GENFILES
82	cp build/lex.c ${GEN}/
83
84# Setup version file
85${GEN}/version.c.in: ${GEN} version.c.in .bzr/checkout/dirstate
86	tools/rewrite_version_bzr.sh < version.c.in > ${GEN}/version.c.in
87
88# Generate pregen'd manuals
89${GEN}/ctwm.1: ${UMAN}/ctwm.1
90${GEN}/ctwm.1.html: ${UMAN}/ctwm.1.html
91${GEN}/ctwm.1 ${GEN}/ctwm.1.html:
92	cp ${UMAN}/ctwm.1 ${UMAN}/ctwm.1.html ${GEN}/
93${UMAN}/ctwm.1 ${UMAN}/ctwm.1.html:
94	(cd ${UMAN} && make clean all)
95
96
97# Thunk through to gen'ing tarball
98tar:
99	tools/mk_tar.sh
100