aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile18
1 files changed, 10 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 01c92f1..0e4c2fc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,26 @@
all: hookfs file_hook.so
+libdir ?= lib
+
hookfs: src/hook_fusefs/hookfs.c
$(CC) -std=c99 -Wall `pkg-config fuse --cflags --libs` -lulockmgr \
- $(CFLAGS) $(LDFLAGS) src/hook_fusefs/hookfs.c -o hookfs
+ $(CFLAGS) $(LDFLAGS) src/hook_fusefs/hookfs.c -o hookfs
file_hook.so: file_hook.o
- ld -shared -o file_hook.so -ldl -lc file_hook.o
+ ld -ldl $(RAW_LDFLAGS) -shared -o file_hook.so -lc file_hook.o
file_hook.o: src/hook_lib/file_hook.c
- cc -Wall -fPIC -o file_hook.o -c src/hook_lib/file_hook.c
+ $(CC) -Wall -fPIC -o file_hook.o -c src/hook_lib/file_hook.c
install:
- mkdir -p "${DESTDIR}/usr/lib/"
- cp file_hook.so "${DESTDIR}/usr/lib/"
- cp -R src/autodep "${DESTDIR}/usr/lib/"
- cp -R portage_with_autodep "${DESTDIR}/usr/lib/"
+ mkdir -p "${DESTDIR}/usr/$(libdir)/"
+ cp file_hook.so "${DESTDIR}/usr/$(libdir)/"
+ cp -R src/autodep "${DESTDIR}/usr/$(libdir)/"
+ cp -R portage_with_autodep "${DESTDIR}/usr/$(libdir)/"
mkdir -p "${DESTDIR}/usr/bin/"
cp hookfs emerge_strict "${DESTDIR}/usr/bin/"
- ln -s "${DESTDIR}/usr/lib/autodep/autodep" "${DESTDIR}/usr/bin/"
+ ln -s "${DESTDIR}/usr/$(libdir)/autodep/autodep" "${DESTDIR}/usr/bin/"
clean:
rm -f hookfs file_hook.o file_hook.so