~ctwm/ctwm/trunk

294.1.35 by Matthew Fuller
Write up a makefile (bmake/gmake compatible) that does the cmake
1
# This just shortcuts stuff through to cmake
632.1.2 by Matthew Fuller
Ensure everything's up to date before running the tests.
2
all build ctwm man man-html man-all install clean: build/Makefile
294.1.35 by Matthew Fuller
Write up a makefile (bmake/gmake compatible) that does the cmake
3
	( cd build && ${MAKE} ${@} )
4
684 by Matthew Fuller
Use a make var for the cmake to run, to make it easier to run it under
5
CMAKE?=cmake
294.1.35 by Matthew Fuller
Write up a makefile (bmake/gmake compatible) that does the cmake
6
build/Makefile cmake: CMakeLists.txt
478 by Matthew Fuller
Since some VCSen other than bzr don't store empty directories, add a
7
	( mkdir -p build && cd build && \
684 by Matthew Fuller
Use a make var for the cmake to run, to make it easier to run it under
8
		${CMAKE} -DCMAKE_C_FLAGS:STRING="${CFLAGS}" ${CMAKE_EXTRAS} .. )
294.1.35 by Matthew Fuller
Write up a makefile (bmake/gmake compatible) that does the cmake
9
294.1.52 by Matthew Fuller
Add distclean as an alias to allclean.
10
allclean distclean:
294.1.35 by Matthew Fuller
Write up a makefile (bmake/gmake compatible) that does the cmake
11
	rm -rf build/*
294.1.54 by Matthew Fuller
Add rules to make (and clean up) lex/yacc output files for releases.
12
13
566.1.6 by Matthew Fuller
Separate out the developer bits from the simple thunks up top.
14
15
#
16
# The below targets are mostly only of interest to developers
17
#
18
583.1.3 by Matthew Fuller
Add some additional thunk-through targets for dev usage so we can call
19
# Add'l thunks to cmake
617 by Matthew Fuller
Add build infra to find and give a target to run ctags, so I can stop
20
.PHONY: tags
21
man-pdf doxygen doxyclean tags: build/Makefile
583.1.3 by Matthew Fuller
Add some additional thunk-through targets for dev usage so we can call
22
	( cd build && ${MAKE} ${@} )
566.1.6 by Matthew Fuller
Separate out the developer bits from the simple thunks up top.
23
632.1.2 by Matthew Fuller
Ensure everything's up to date before running the tests.
24
# Make sure everything's build before running tests
25
.PHONY: test
659.1.1 by Matthew Fuller
Make test target depend on the built makefile, since we need it. This
26
test: build/Makefile
632.1.7 by Matthew Fuller
Fold building ctwm into the test_bins target.
27
	( cd build && ${MAKE} test_bins )
632.1.4 by Matthew Fuller
Tell ctest to be verbose on failure. Among other things, this means
28
	( cd build && ${MAKE} CTEST_OUTPUT_ON_FAILURE=1 ${@} )
632.1.2 by Matthew Fuller
Ensure everything's up to date before running the tests.
29
308.1.10 by Matthew Fuller
Actually, put these doc targets down below the reindent.
30
# Reindent files
31
indent:
659.1.2 by Matthew Fuller
Make the indent run over the test source files too.
32
	astyle -n --options=tools/ctwm.astyle *.[ch] tests/*/*.[ch]
308.1.10 by Matthew Fuller
Actually, put these doc targets down below the reindent.
33
34
308.1.2 by Matthew Fuller
Add some make targets to build the HTMLized README with multimarkdown
35
# Build documentation files
408.1.7 by Matthew Fuller
Pull STYLE out of the list of md->html builds we do. It doesn't serve
36
DOC_FILES=README.html CHANGES.html
308.1.2 by Matthew Fuller
Add some make targets to build the HTMLized README with multimarkdown
37
docs: ${DOC_FILES}
400.1.8 by Matthew Fuller
I always tpyo this, so add the consistent alias.
38
docs_clean doc_clean:
308.1.2 by Matthew Fuller
Add some make targets to build the HTMLized README with multimarkdown
39
	rm -f ${DOC_FILES}
40
712.1.4 by Matthew Fuller
No multimarkdown stuff left in tree.
41
.SUFFIXES: ${.SUFFIXES} .html .adoc
712.1.1 by Matthew Fuller
Add the ability for README/CHANGES to be in asciidoc as well as
42
.adoc.html:
43
	asciidoctor -o ${@} ${<}
308.1.2 by Matthew Fuller
Add some make targets to build the HTMLized README with multimarkdown
44
308.1.11 by Matthew Fuller
Whitespace.
45
345.1.49 by Matthew Fuller
Add the generated manpage (and HTML version of the docs, what the hey)
46
# asciidoc files
584.1.3 by Matthew Fuller
Move the manual down a level, to allow putting other docs in the
47
UMAN=doc/manual
345.1.49 by Matthew Fuller
Add the generated manpage (and HTML version of the docs, what the hey)
48
adocs:
584.1.2 by Matthew Fuller
Make a var for this doc dir for easier moving.
49
	(cd ${UMAN} && make all_set_version)
546.1.4 by Matthew Fuller
Switch pregen'ing the docs to not rewrite the version, since the build
50
adocs_pregen:
584.1.2 by Matthew Fuller
Make a var for this doc dir for easier moving.
51
	(cd ${UMAN} && make all)
345.1.49 by Matthew Fuller
Add the generated manpage (and HTML version of the docs, what the hey)
52
adoc_clean:
584.1.2 by Matthew Fuller
Make a var for this doc dir for easier moving.
53
	(cd ${UMAN} && make clean)
345.1.49 by Matthew Fuller
Add the generated manpage (and HTML version of the docs, what the hey)
54
55
406.1.1 by Matthew Fuller
Alter how we put together prebuilt source files for release by putting
56
#
57
# Pre-build some files for tarballs
58
#
59
GEN=gen
60
${GEN}:
61
	mkdir -p ${GEN}
62
63
# All the generated source files
546.1.5 by Matthew Fuller
Generate so that the prebuild manual gets put in gen/ with the rest of
64
_RELEASE_FILES=gram.tab.c gram.tab.h lex.c version.c.in ctwm.1 ctwm.1.html
406.1.1 by Matthew Fuller
Alter how we put together prebuilt source files for release by putting
65
RELEASE_FILES=${_RELEASE_FILES:%=${GEN}/%}
66
406.1.4 by Matthew Fuller
Slight reorganize and comment tweak.
67
# Build those, the .html versions of the above docs, and the HTML/man
68
# versions of the manual
546.1.5 by Matthew Fuller
Generate so that the prebuild manual gets put in gen/ with the rest of
69
release_files: ${GEN} build/MKTAR_GENFILES ${RELEASE_FILES} ${DOC_FILES}
406.1.4 by Matthew Fuller
Slight reorganize and comment tweak.
70
release_clean: doc_clean adoc_clean
71
	rm -rf ${GEN}
72
472.1.3 by Matthew Fuller
Convert the lex/yacc output building to hop through cmake's handling.
73
# Stuff for thunking to cmake
74
build/MKTAR_GENFILES: build/Makefile
75
	(cd build ; make mktar_genfiles)
76
406.1.1 by Matthew Fuller
Alter how we put together prebuilt source files for release by putting
77
# The config grammar
78
${GEN}/gram.tab.c: ${GEN}/gram.tab.h
472.1.3 by Matthew Fuller
Convert the lex/yacc output building to hop through cmake's handling.
79
${GEN}/gram.tab.h: ${GEN} gram.y build/MKTAR_GENFILES
80
	cp build/gram.tab.[ch] ${GEN}/
294.1.54 by Matthew Fuller
Add rules to make (and clean up) lex/yacc output files for releases.
81
472.1.3 by Matthew Fuller
Convert the lex/yacc output building to hop through cmake's handling.
82
${GEN}/lex.c: ${GEN} lex.l build/MKTAR_GENFILES
83
	cp build/lex.c ${GEN}/
411.1.7 by Matthew Fuller
Add a generated version.c to our release files.
84
85
# Setup version file
516.1.7 by Matthew Fuller
Make version.c.in rather than version.c for the pregen'd, for somewhat
86
${GEN}/version.c.in: ${GEN} version.c.in .bzr/checkout/dirstate
706 by Matthew Fuller
Hardcode brz for the version rewrite in tarball generation; that's a
87
	env BZR_CMD=brz tools/rewrite_version_bzr.sh < version.c.in \
88
			> ${GEN}/version.c.in
546.1.5 by Matthew Fuller
Generate so that the prebuild manual gets put in gen/ with the rest of
89
90
# Generate pregen'd manuals
584.1.2 by Matthew Fuller
Make a var for this doc dir for easier moving.
91
${GEN}/ctwm.1: ${UMAN}/ctwm.1
92
${GEN}/ctwm.1.html: ${UMAN}/ctwm.1.html
546.1.5 by Matthew Fuller
Generate so that the prebuild manual gets put in gen/ with the rest of
93
${GEN}/ctwm.1 ${GEN}/ctwm.1.html:
584.1.2 by Matthew Fuller
Make a var for this doc dir for easier moving.
94
	cp ${UMAN}/ctwm.1 ${UMAN}/ctwm.1.html ${GEN}/
95
${UMAN}/ctwm.1 ${UMAN}/ctwm.1.html:
96
	(cd ${UMAN} && make clean all)
566.1.7 by Matthew Fuller
Add a trivial tar target to just call mk_tar, for convenience and
97
98
99
# Thunk through to gen'ing tarball
100
tar:
101
	tools/mk_tar.sh