File: makefile

package info (click to toggle)
ansifilter 2.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,076 kB
  • sloc: cpp: 5,280; makefile: 140; sh: 111; python: 73; ansic: 65; tcl: 1
file content (130 lines) | stat: -rw-r--r-- 4,077 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Installation script for ansifilter.
# See INSTALL for details.

# Installation directories:

# Destination directory for installation (intended for packagers)
DESTDIR ?=

# Root directory for final installation
PREFIX ?= /usr

# Location of the binary:
bin_dir = ${PREFIX}/bin/

# Data file directory
data_dir = ${PREFIX}/share/

# Location of the man page:
man_dir = ${data_dir}man/man1/

# Location of the documentation:
doc_dir = ${data_dir}doc/ansifilter/

# Location of additional gui files
desktop_apps = ${data_dir}applications/
desktop_pixmaps = ${data_dir}pixmaps/

# Location of bash completions:
bash_comp_dir = ${data_dir}bash-completion/completions/

# Location of fish completions:
fish_comp_dir = ${data_dir}fish/vendor_completions.d/

# Location of zsh completions:
zsh_comp_dir = ${data_dir}zsh/site-functions/

# Commands:
GZIP=gzip -9f
QMAKE=qmake

INSTALL_DATA=install -m644
INSTALL_PROGRAM=install -m755
MKDIR=mkdir -p -m 755
RMDIR=rm -r -f

all:
	${MAKE} -C ./src -f ./makefile

all-gui gui:
	${QMAKE} -makefile -o src/qt-gui/Makefile src/qt-gui/ansifilter-gui.pro
	${MAKE} -C ./src/qt-gui -f ./Makefile

all-tcl tcl:
	${MAKE} -C ./src/tcl -f ./makefile

install:
	@echo "This script will install ansifilter in the following directories:"
	@echo "Documentation directory: ${DESTDIR}${doc_dir}"
	@echo "Manual directory:        ${DESTDIR}${man_dir}"
	@echo "Binary directory:        ${DESTDIR}${bin_dir}"
	@echo "Bash completions:        ${DESTDIR}${bash_comp_dir}"
	@echo "Fish completions:        ${DESTDIR}${fish_comp_dir}"
	@echo "Zsh completions:         ${DESTDIR}${zsh_comp_dir}"
	@echo

	${MKDIR} ${DESTDIR}${doc_dir}
	${MKDIR} ${DESTDIR}${man_dir}
	${MKDIR} ${DESTDIR}${bin_dir}
	${MKDIR} ${DESTDIR}${bash_comp_dir}
	${MKDIR} ${DESTDIR}${fish_comp_dir}
	${MKDIR} ${DESTDIR}${zsh_comp_dir}

	${INSTALL_DATA} ./man/ansifilter.1 ${DESTDIR}${man_dir}
	-${GZIP} ${DESTDIR}${man_dir}ansifilter.1
	${INSTALL_DATA} ./README.adoc ${DESTDIR}${doc_dir}
	${INSTALL_DATA} ./ChangeLog.adoc ${DESTDIR}${doc_dir}
	mv ${DESTDIR}${doc_dir}/ChangeLog.adoc ${DESTDIR}${doc_dir}/changelog
	${INSTALL_DATA} ./sh-completion/ansifilter.bash ${DESTDIR}${bash_comp_dir}ansifilter
	${INSTALL_DATA} ./sh-completion/ansifilter.fish ${DESTDIR}${fish_comp_dir}
	${INSTALL_DATA} ./sh-completion/ansifilter.zsh ${DESTDIR}${zsh_comp_dir}_ansifilter
	${INSTALL_PROGRAM} ./src/ansifilter ${DESTDIR}${bin_dir}

	@echo
	@echo "Done."
	@echo "Type ansifilter --help or man ansifilter for instructions."
	@echo "Do not hesitate to report problems. Unknown bugs are hard to fix."

install-gui:
	${MKDIR} ${DESTDIR}${bin_dir}
	${INSTALL_PROGRAM} ./src/qt-gui/ansifilter-gui ${DESTDIR}${bin_dir}
	${MKDIR} ${DESTDIR}${desktop_apps} \
		${DESTDIR}${desktop_pixmaps}
	${INSTALL_DATA} ./ansifilter.desktop ${DESTDIR}${desktop_apps}
	${INSTALL_DATA} ./src/qt-gui/ansifilter.xpm ${DESTDIR}${desktop_pixmaps}

uninstall:
	@echo "Removing ansifilter files from system..."
	${RMDIR} ${DESTDIR}${doc_dir}
	rm -f ${DESTDIR}${man_dir}ansifilter.1.gz
	rm -f ${DESTDIR}${bin_dir}ansifilter
	rm -f ${DESTDIR}${bin_dir}ansifilter-gui
	@echo "Done. Have a nice day!"

clean:
	$(MAKE) -C ./src -f ./makefile clean
	$(MAKE) -C ./src/tcl -f ./makefile clean


completions:
	sh-completion/gen-completions bash >sh-completion/ansifilter.bash
	sh-completion/gen-completions fish >sh-completion/ansifilter.fish
	sh-completion/gen-completions zsh >sh-completion/ansifilter.zsh

help:
	@echo "This makefile offers the following options:"
	@echo
	@echo "(all)            Compile."
	@echo "all-gui          Compile Qt GUI (requires Qt 5.x)"
	@echo "install*         Copy all data files to ${data_dir}."
	@echo "completions      Generate shell completion files."
	@echo "clean            Remove object files and binary."
	@echo "uninstall*       Remove ansifilter files from system."
	@echo
	@echo "* Command needs root privileges."
	@echo "See src/makefile for compilation and linking options."

# Target needed for redhat 9.0 rpmbuild
install-strip:

.PHONY: clean all install apidocs help uninstall install-strip