-modbindir=$(datadir)/lufs/modbin
-
-# FIXME: We need double make invocation to properly build files and resolve the wildcard during 'install'!
-modbin_DATA=$(wildcard lufs-*.o)
-CLEANFILES=$(modbin_DATA)
-
all-local: *.o
*.o:
$(wildcard /usr/src/kernel-headers-*) \
$(wildcard $(top_srcdir)/../kernel-source-*.rpm)
+# FIXME: We need double make invocation to properly build files and resolve the wildcard during 'install'!
+# Keep the basename as 'lufs.o'.
+# Do not use '$(INSTALL_PROGRAM)' as it would strip the modules.
+install-exec-hook: $(wildcard lufs-*.o)
+ for i in $^;do \
+ destdir="$(DESTDIR)$(datadir)/lufs/modbin/`basename $$i .o`"; \
+ $(mkinstalldirs) $$destdir; \
+ $(INSTALL_DATA) $$i $$destdir/lufs.o; \
+ done
+
+CLEANFILES=$(wildcard lufs-*.o)