Set version to 0.2
[ciopfs.git] / Makefile
blobae066d390971b8200f793659922f753e2698c2c3
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 ascii: clean
28 @make CFLAGS_UNICODE='' LDFLAGS_UNICODE=''
30 unicode-glib: clean
31 @make CFLAGS_UNICODE='${CFLAGS_GLIB}' LDFLAGS_UNICODE='${LDFLAGS_GLIB}'
33 unicode-icu: clean
34 @make CFLAGS_UNICODE='${CFLAGS_ICU}' LDFLAGS_UNICODE='${LDFLAGS_ICU}'
36 clean:
37 @echo cleaning
38 @rm -f ciopfs ${OBJ} ciopfs-${VERSION}.tar.gz
40 dist: clean
41 @echo creating dist tarball
42 @mkdir -p ciopfs-${VERSION}
43 @cp -R Makefile config.mk ciopfs.c ascii.c unicode-icu.c unicode-glib.c ciopfs-${VERSION}
44 @tar -cf ciopfs-${VERSION}.tar ciopfs-${VERSION}
45 @gzip ciopfs-${VERSION}.tar
46 @rm -rf ciopfs-${VERSION}
48 install: ciopfs
49 @echo stripping executable
50 @strip -s ciopfs
51 @echo installing executable file to ${DESTDIR}${PREFIX}/bin
52 @mkdir -p ${DESTDIR}${PREFIX}/bin
53 @cp -f ciopfs ${DESTDIR}${PREFIX}/bin
54 @chmod 755 ${DESTDIR}${PREFIX}/bin/ciopfs
55 @echo creating symlink ${DESTDIR}${PREFIX}/bin/mount.ciopfs
56 @ln -sf ${DESTDIR}${PREFIX}/bin/ciopfs /sbin/mount.ciopfs
57 # @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
58 # @mkdir -p ${DESTDIR}${MANPREFIX}/man1
59 # @sed "s/VERSION/${VERSION}/g" < ciopfs.1 > ${DESTDIR}${MANPREFIX}/man1/ciopfs.1
60 # @chmod 644 ${DESTDIR}${MANPREFIX}/man1/ciopfs.1
62 uninstall:
63 @echo removing executable file from ${DESTDIR}${PREFIX}/bin
64 @rm -f ${DESTDIR}${PREFIX}/bin/ciopfs
65 @echo removing symlink from /sbin/mount.ciopfs
66 @rm -f /sbin/mount.ciopfs
67 # @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
68 # @rm -f ${DESTDIR}${MANPREFIX}/man1/ciopfs.1
70 .PHONY: all options clean dist install uninstall debug ascii unicode-glib unicode-icu