~ctwm/ctwm/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This just shortcuts stuff through to cmake
all build ctwm man install clean: build/Makefile
	( cd build && ${MAKE} ${@} )

build/Makefile cmake: CMakeLists.txt
	( cd build && \
		cmake -DCMAKE_C_FLAGS:STRING="${CFLAGS}" ${CMAKE_EXTRAS} .. )

allclean distclean:
	rm -rf build/*


# Reindent files
indent:
	astyle -n --options=tools/ctwm.astyle *.h *.c


# Build documentation files
# STYLE is also HTMLable, but there's no reason to do it by default
DOC_FILES=README.html CHANGES.html
docs: ${DOC_FILES}
docs_clean doc_clean:
	rm -f ${DOC_FILES}

.SUFFIXES: ${.SUFFIXES} .html .md
.md.html:
	multimarkdown -ao ${@} ${<}


# asciidoc files
adocs:
	(cd doc && make all)
adoc_clean:
	(cd doc && make clean)


#
# Pre-build some files for tarballs
#
GEN=gen
${GEN}:
	mkdir -p ${GEN}

# All the generated source files
_RELEASE_FILES=gram.tab.c gram.tab.h lex.c version.c
RELEASE_FILES=${_RELEASE_FILES:%=${GEN}/%}

# Build those, the .html versions of the above docs, and the HTML/man
# versions of the manual
release_files: ${RELEASE_FILES} ${DOC_FILES} adocs
release_clean: doc_clean adoc_clean
	rm -rf ${GEN}

# The config grammar
YACC?=/usr/bin/yacc
YFLAGS=-d -b ${GEN}/gram
${GEN}/gram.tab.c: ${GEN}/gram.tab.h
${GEN}/gram.tab.h: ${GEN} gram.y
	${YACC} ${YFLAGS} gram.y

LEX?=/usr/bin/flex
LFLAGS=-o ${GEN}/lex.c
${GEN}/lex.c: ${GEN} lex.l
	${LEX} ${LFLAGS} lex.l

# Setup version file
${GEN}/version.c: ${GEN} version.c.in .bzr/checkout/dirstate
	tools/rewrite_version_bzr.sh < version.c.in > ${GEN}/version.c