summaryrefslogtreecommitdiff
path: root/support/highlight/makefile
blob: 7961a076c2eed2919311fcbe4f9783e7dce2faa9 (plain)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Installation script for highlight.
# See INSTALL for details.
# IMPORTANT: Update highlight.spec file after changing paths!

# Installation directories:

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

# Root directory for final installation
PREFIX = /usr

# Location of the highlight data files:
data_dir = ${PREFIX}/share/highlight/

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

# Location of the highlight man page:
man_dir = ${PREFIX}/share/man/man1/

# Location of the highlight documentation:
doc_dir = ${PREFIX}/share/doc/highlight/

# Location of the highlight examples:
examples_dir = ${doc_dir}examples/

# Location of the highlight config files:
conf_dir = /etc/highlight/
#conf_dir = ${PREFIX}/etc/highlight/

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

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

all cli:
	${MAKE} -C ./src -f ./makefile HL_DATA_DIR=${data_dir} HL_CONFIG_DIR=${conf_dir}

lib lib-static:
	${MAKE} -C ./src -f ./makefile HL_DATA_DIR=${data_dir} HL_CONFIG_DIR=${conf_dir} lib-static

lib-shared:
	${MAKE} -C ./src -f ./makefile HL_DATA_DIR=${data_dir} HL_CONFIG_DIR=${conf_dir} PIC=1 lib-shared

gui:
	${MAKE} -C ./src -f ./makefile HL_DATA_DIR=\"${data_dir}\" HL_CONFIG_DIR=\"${conf_dir}\" HL_DOC_DIR=\"${doc_dir}\" gui-qt
	@echo
	@echo "You need to run 'make install' AND 'make install-gui' now!"

install:
	@echo "This script will install highlight in the following directories:"
	@echo "Data directory:	        ${DESTDIR}${data_dir}"
	@echo "Documentation directory: ${DESTDIR}${doc_dir}"
	@echo "Examples directory:      ${DESTDIR}${examples_dir}"
	@echo "Manual directory:        ${DESTDIR}${man_dir}"
	@echo "Binary directory:        ${DESTDIR}${bin_dir}"
	@echo "Configuration directory: ${DESTDIR}${conf_dir}"
	@echo

	${MKDIR} ${DESTDIR}${doc_dir}
	${MKDIR} ${DESTDIR}${conf_dir}
	${MKDIR} ${DESTDIR}${examples_dir} \
		${DESTDIR}${examples_dir}plugins \
		${DESTDIR}${examples_dir}plugins/dokuwiki \
		${DESTDIR}${examples_dir}plugins/movabletype \
		${DESTDIR}${examples_dir}plugins/wordpress \
		${DESTDIR}${examples_dir}swig
	${MKDIR} ${DESTDIR}${data_dir} \
		${DESTDIR}${data_dir}themes \
		${DESTDIR}${data_dir}langDefs
	${MKDIR} ${DESTDIR}${man_dir}
	${MKDIR} ${DESTDIR}${bin_dir}

	${INSTALL_DATA} ./langDefs/*.lang ${DESTDIR}${data_dir}langDefs/
	${INSTALL_DATA} ./*.conf ${DESTDIR}${conf_dir}
	${INSTALL_DATA} ./themes/*.style ${DESTDIR}${data_dir}themes/
	${INSTALL_DATA} ./man/highlight.1.gz ${DESTDIR}${man_dir}
	${INSTALL_DATA} ./AUTHORS ${DESTDIR}${doc_dir}
	${INSTALL_DATA} ./README ${DESTDIR}${doc_dir}
	${INSTALL_DATA} ./README_DE ${DESTDIR}${doc_dir}
	${INSTALL_DATA} ./README_REGEX ${DESTDIR}${doc_dir}
	${INSTALL_DATA} ./README_LANGLIST ${DESTDIR}${doc_dir}
	${INSTALL_DATA} ./ChangeLog ${DESTDIR}${doc_dir}
	${INSTALL_DATA} ./COPYING ${DESTDIR}${doc_dir}
	${INSTALL_DATA} ./INSTALL ${DESTDIR}${doc_dir}
	${INSTALL_DATA} ./examples/plugins/dokuwiki/* ${DESTDIR}${examples_dir}plugins/dokuwiki/
	${INSTALL_DATA} ./examples/plugins/movabletype/* ${DESTDIR}${examples_dir}plugins/movabletype/
	${INSTALL_DATA} ./examples/plugins/wordpress/* ${DESTDIR}${examples_dir}plugins/wordpress/
	${INSTALL_DATA} ./examples/swig/*.py ./examples/swig/*.pl ${DESTDIR}${examples_dir}swig
	${INSTALL_DATA} ./examples/swig/*.i ./examples/swig/makefile ${DESTDIR}${examples_dir}swig
	${INSTALL_DATA} ./examples/swig/README_SWIG ${DESTDIR}${doc_dir}
	${INSTALL_DATA} ./examples/highlight_pipe.* ${DESTDIR}${examples_dir}
	${INSTALL_PROGRAM} ./src/highlight ${DESTDIR}${bin_dir}

	@echo
	@echo "Done."
	@echo "Type highlight --help or man highlight for instructions."
	@echo "Take a look at ${DESTDIR}${examples_dir} for plugins and SWIG language bindings."
	@echo "Execute 'make install-gui' to install the highlight GUI ('make gui')."
	@echo "Do not hesitate to report problems. Unknown bugs are hard to fix."

install-gui:
	@echo "Installing files for the GUI..."
	${MKDIR} ${DESTDIR}${data_dir} \
		${DESTDIR}${data_dir}gui_files \
		${DESTDIR}${data_dir}gui_files/ext \
		${DESTDIR}${data_dir}gui_files/l10n \
		${DESTDIR}${desktop_apps} \
		${DESTDIR}${desktop_pixmaps}

	${INSTALL_DATA} ./gui_files/l10n/* ${DESTDIR}${data_dir}gui_files/l10n/
	${INSTALL_DATA} ./gui_files/ext/* ${DESTDIR}${data_dir}gui_files/ext/
	${INSTALL_DATA} ./highlight.desktop ${DESTDIR}${desktop_apps}
	${INSTALL_DATA} ./src/gui-qt/highlight.xpm ${DESTDIR}${desktop_pixmaps}
	${INSTALL_PROGRAM} ./src/highlight-gui ${DESTDIR}${bin_dir}

uninstall:
	@echo "Removing highlight files from system..."
	${RMDIR} ${DESTDIR}${data_dir}
	${RMDIR} ${DESTDIR}${doc_dir}
	${RMDIR} ${DESTDIR}${conf_dir}
	${RMDIR} ${DESTDIR}${examples_dir}
	rm -rf ${DESTDIR}${man_dir}highlight.1.gz
	rm -rf ${DESTDIR}${bin_dir}highlight
	rm -rf ${DESTDIR}${bin_dir}highlight-gui
	rm -rf ${DESTDIR}${desktop_apps}highlight.desktop
	rm -rf ${DESTDIR}${desktop_pixmaps}highlight.xpm
	@echo "Done."

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

apidocs:
	doxygen Doxyfile

help:
	@echo "This makefile offers the following options:"
	@echo
	@echo "(all)            Compile the command line interface."
	@echo "lib-static       Compile only the static library."
	@echo "lib-shared       Compile only the shared library."
	@echo "gui              Compile the Qt (4.x) GUI."
	@echo "install*         Copy all data files to ${data_dir}."
	@echo "install-gui*     Copy GUI data files to ${data_dir}."
	@echo "clean            Remove object files and binaries."
	@echo "apidocs          Generate HTML API documentation using doxygen."
	@echo "uninstall*       Remove highlight 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