[style] apply freebsd .clang-format
[sfm.git] / Makefile
blobfea8691d34a9831d4c168143c1ee24c7dadec761
1 # sfm - simple file manager
2 # See LICENSE file for copyright and license details.
4 include config.mk
6 SRC = sfm.c util.c termbox.c utf8.c
7 OBJ = ${SRC:.c=.o}
9 all: options sfm
11 options:
12 @echo sfm build options:
13 @echo "CFLAGS = ${CFLAGS}"
14 @echo "CC = ${CC}"
16 .c.o:
17 ${CC} -c ${CFLAGS} $<
19 ${OBJ}: config.h config.mk
21 config.h:
22 cp config.def.h $@
24 sfm: ${OBJ}
25 ${CC} -o $@ ${OBJ}
27 clean:
28 rm -f sfm ${OBJ} sfm-${VERSION}.tar.gz
30 dist: clean
31 mkdir -p sfm-${VERSION}
32 cp -R LICENSE Makefile README.md config.def.h config.mk\
33 sfm.1 sfm.png termbox.h util.h ${SRC} sfm-${VERSION}
34 tar -cf sfm-${VERSION}.tar sfm-${VERSION}
35 gzip sfm-${VERSION}.tar
36 rm -rf sfm-${VERSION}
38 install: sfm
39 mkdir -p ${DESTDIR}${PREFIX}/bin
40 cp -f sfm ${DESTDIR}${PREFIX}/bin
41 chmod 755 ${DESTDIR}${PREFIX}/bin/sfm
42 mkdir -p ${DESTDIR}${MANPREFIX}/man1
43 sed "s/VERSION/${VERSION}/g" < sfm.1 > ${DESTDIR}${MANPREFIX}/man1/sfm.1
44 chmod 644 ${DESTDIR}${MANPREFIX}/man1/sfm.1
46 uninstall:
47 rm -f ${DESTDIR}${PREFIX}/bin/sfm\
48 ${DESTDIR}${MANPREFIX}/man1/sfm.1
50 .PHONY: all options clean dist install uninstall