Initial import
[ciopfs.git] / Makefile
blob04864f62439a155160f182d90ff3dfc6f6fe4651
1 include config.mk
3 SRC += ciopfs.c
4 OBJ = ${SRC:.c=.o}
6 all: clean options ciopfs
8 options:
9 @echo ciopfs build options:
10 @echo "CFLAGS = ${CFLAGS}"
11 @echo "LDFLAGS = ${LDFLAGS}"
12 @echo "CC = ${CC}"
14 .c.o:
15 @echo CC $<
16 @${CC} -c ${CFLAGS} $<
18 ${OBJ}: config.mk
20 ciopfs: ${OBJ}
21 @echo CC -o $@
22 @${CC} -o $@ ${OBJ} ${LDFLAGS}
24 debug: clean
25 @make CFLAGS='${DEBUG_CFLAGS}'
27 clean:
28 @echo cleaning
29 @rm -f ciopfs ${OBJ} ciopfs-${VERSION}.tar.gz
31 dist: clean
32 @echo creating dist tarball
33 @mkdir -p ciopfs-${VERSION}
34 @cp -R Makefile config.mk ciopfs.c ciopfs-${VERSION}
35 @tar -cf ciopfs-${VERSION}.tar ciopfs-${VERSION}
36 @gzip ciopfs-${VERSION}.tar
37 @rm -rf ciopfs-${VERSION}
39 install: ciopfs
40 @echo stripping executable
41 @strip -s ciopfs
42 @echo installing executable file to ${DESTDIR}${PREFIX}/bin
43 @mkdir -p ${DESTDIR}${PREFIX}/bin
44 @cp -f ciopfs ${DESTDIR}${PREFIX}/bin
45 @chmod 755 ${DESTDIR}${PREFIX}/bin/ciopfs
46 @echo creating symlink ${DESTDIR}${PREFIX}/bin/mount.ciopfs
47 @ln -s ${DESTDIR}${PREFIX}/bin/ciopfs /sbin/mount.ciopfs
48 # @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
49 # @mkdir -p ${DESTDIR}${MANPREFIX}/man1
50 # @sed "s/VERSION/${VERSION}/g" < ciopfs.1 > ${DESTDIR}${MANPREFIX}/man1/ciopfs.1
51 # @chmod 644 ${DESTDIR}${MANPREFIX}/man1/ciopfs.1
53 uninstall:
54 @echo removing executable file from ${DESTDIR}${PREFIX}/bin
55 @rm -f ${DESTDIR}${PREFIX}/bin/ciopfs
56 @echo removing symlink from /sbin/mount.ciopfs
57 @rm -f /sbin/mount.ciopfs
58 # @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
59 # @rm -f ${DESTDIR}${MANPREFIX}/man1/ciopfs.1
61 .PHONY: all options clean dist install uninstall debug