aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: c243a48e399571653bea81bbd0e0eca3992c7f84 (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
# svte: simple virtual terminal emulator: minimal, tabbed, VTE-based terminal
# Copyright 2010 svte contributors.
#
# This file is part of svte.
#
# svte is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


include config.mk

SRC = svte.c
OBJ = ${SRC:.c=.o}

all: options svte

options:
	@echo svte build options:
	@echo "CFLAGS   = ${CFLAGS}"
	@echo "LDFLAGS  = ${LDFLAGS}"
	@echo "CC       = ${CC}"

.c.o:
	@echo CC $<
	@${CC} -c ${CFLAGS} $<

${OBJ}: config.mk


svte: ${OBJ}
	@echo CC -o $@
	@${CC} -o $@ svte.o ${LDFLAGS}

clean:
	@echo cleaning
	@rm -f svte ${OBJ} mt-${VERSION}.tar.gz

dist: clean
	@echo creating dist tarball
	@mkdir -p svte-${VERSION}
	@cp -R Makefile config.mk ${SRC} svte-${VERSION}
	@tar -cf svte-${VERSION}.tar mt-${VERSION}
	@gzip svte-${VERSION}.tar
	@rm -rf svte-${VERSION}

install: all
	@echo installing manpage to ${DESTDIR}${MANPREFIX}/man1
	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
	@cp -f svte.1 ${DESTDIR}${MANPREFIX}/man1/svte.1
	@echo installing executable file to ${DESTDIR}${PREFIX}/bin
	@mkdir -p ${DESTDIR}${PREFIX}/bin
	@cp -f svte ${DESTDIR}${PREFIX}/bin
	@chmod 755 ${DESTDIR}${PREFIX}/bin/svte

uninstall:
	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
	@rm -f ${DESTDIR}${PREFIX}/bin/svte
	@echo removing manpage from ${DESTDIR}${MANPREFIX}/man1/
	@rm -f ${DESTDIR}${MANPREFIX}/man1/svte.1


.PHONY: all options clean dist install uninstall