-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (37 loc) · 1.07 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
# mage - image viewer
# See LICENSE file for copyright and license details.
include config.mk
SRC = mage.c drw.c util.c
OBJ = ${SRC:.c=.o}
all: options mage
options:
@echo mage build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
config.h:
cp config.def.h config.h
.c.o:
${CC} -c ${CFLAGS} $<
${OBJ}: config.h config.mk
mage: ${OBJ}
${CC} -o $@ ${OBJ} ${LDFLAGS}
clean:
rm -f mage ${OBJ} mage-${VERSION}.tar.gz
dist: clean
mkdir -p mage-${VERSION}
cp -R LICENSE Makefile config.mk config.def.h ${SRC} mage-${VERSION}
tar -cf mage-${VERSION}.tar mage-${VERSION}
gzip mage-${VERSION}.tar
rm -rf mage-${VERSION}
install: all
mkdir -p ${DESTDIR}${PREFIX}/bin
cp -f mage ${DESTDIR}${PREFIX}/bin
chmod 755 ${DESTDIR}${PREFIX}/bin/mage
mkdir -p ${DESTDIR}${MANPREFIX}/man1
sed "s/VERSION/${VERSION}/g" < mage.1 > ${DESTDIR}${MANPREFIX}/man1/mage.1
chmod 644 ${DESTDIR}${MANPREFIX}/man1/mage.1
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/mage \
${DESTDIR}${MANPREFIX}/man1/mage.1
.PHONY: all options clean dist install uninstall