xref: /freebsd/contrib/unifdef/Makefile (revision fb3ef04d2028110f06d68b09009f1f2ca0f4128e)
1# Makefile for unifdef
2
3prefix =	${HOME}
4bindir =	${prefix}/bin
5mandir =	${prefix}/share/man
6man1dir=	${mandir}/man1
7
8bindest=	${DESTDIR}${bindir}
9man1dest=	${DESTDIR}${man1dir}
10
11all: unifdef
12
13unifdef: unifdef.c unifdef.h version.h
14	${CC} ${CFLAGS} ${LDFLAGS} -o unifdef unifdef.c
15
16version.h: version.sh
17version.sh::
18	scripts/reversion.sh
19
20test: unifdef
21	scripts/runtests.sh tests
22
23install: unifdef unifdefall.sh unifdef.1
24	: commands
25	install -m 755 -d  ${bindest}
26	install -m 755 unifdef  ${bindest}/
27	install -m 755 unifdefall.sh  ${bindest}/unifdefall
28	: manual
29	install -m 755 -d  ${man1dest}
30	install -m 644 unifdef.1  ${man1dest}/
31	ln -s unifdef.1  ${man1dest}/unifdefall.1
32
33clean:
34	rm -f unifdef version.h
35	rm -f tests/*.out tests/*.err tests/*.rc
36
37realclean: clean
38	rm -f unifdef.txt
39	[ ! -d .git ] || rm -f Changelog version.sh
40	find . -name .git -prune -o \( \
41		-name '*~' -o -name '.#*' -o \
42		-name '*.orig' -o -name '*.core' -o \
43		-name 'xterm-*' -o -name 'xterm.tar.gz' \
44		\) -delete
45
46DISTEXTRA= version.h version.sh unifdef.txt Changelog
47
48release: ${DISTEXTRA}
49	scripts/copycheck.sh
50	scripts/release.sh ${DISTEXTRA}
51
52unifdef.txt: unifdef.1
53	nroff -Tascii -mdoc unifdef.1 | col -bx >unifdef.txt
54
55Changelog: version.sh scripts/gitlog2changelog.sh
56	scripts/gitlog2changelog.sh >Changelog
57
58# eof
59