forked from martanne/vis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (52 loc) · 1.62 KB
/
Makefile
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
include config.mk
SRC = editor.c window.c text.c text-motions.c text-objects.c register.c buffer.c ring-buffer.c
HDR := ${SRC:.c=.h} macro.h syntax.h util.h config.def.h
SRC += vis.c
OBJ = ${SRC:.c=.o}
ALL = ${SRC} ${HDR} config.mk Makefile LICENSE README vis.1
all: clean options vis
options:
@echo vis build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
config.h:
#TODO cp config.def.h config.h
ln -fs config.def.h config.h
.c.o:
@echo CC $<
@${CC} -c ${CFLAGS} $<
${OBJ}: config.h config.mk
vis: ${OBJ}
@echo CC -o $@
@${CC} -o $@ ${OBJ} ${LDFLAGS}
@ln -sf $@ nano
debug: clean
@make CFLAGS='${DEBUG_CFLAGS}'
clean:
@echo cleaning
@rm -f vis nano ${OBJ} vis-${VERSION}.tar.gz
dist: clean
@echo creating dist tarball
@mkdir -p vis-${VERSION}
@cp -R ${ALL} vis-${VERSION}
@tar -cf vis-${VERSION}.tar vis-${VERSION}
@gzip vis-${VERSION}.tar
@rm -rf vis-${VERSION}
install: vis
@echo stripping executable
@strip -s vis
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f vis ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/vis
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
@sed "s/VERSION/${VERSION}/g" < vis.1 > ${DESTDIR}${MANPREFIX}/man1/vis.1
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/vis.1
uninstall:
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
@rm -f ${DESTDIR}${PREFIX}/bin/vis
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
@rm -f ${DESTDIR}${MANPREFIX}/man1/vis.1
.PHONY: all options clean dist install uninstall debug