-# All headers are referenced by this top level Makefile.am and the
-# nobase_* rule is used to ensure all path information is preserved
-# when using the 'make install' target.
-nobase_include_HEADERS = *.h
-nobase_include_HEADERS += asm/*.h
-nobase_include_HEADERS += fs/*.h
-nobase_include_HEADERS += linux/*.h
-nobase_include_HEADERS += rpc/*.h
-nobase_include_HEADERS += sharefs/*.h
-nobase_include_HEADERS += sys/fm/*.h
-nobase_include_HEADERS += sys/fs/*.h
-nobase_include_HEADERS += sys/sysevent/*.h
-nobase_include_HEADERS += sys/*.h
-nobase_include_HEADERS += util/*.h
-nobase_include_HEADERS += vm/*.h
+SUBDIRS = fs linux rpc sharefs sys util vm
+
+COMMON_H =
+
+KERNEL_H = \
+ $(top_srcdir)/include/splat-ctl.h \
+ $(top_srcdir)/include/spl-ctl.h \
+ $(top_srcdir)/include/strings.h \
+ $(top_srcdir)/include/unistd.h
+
+USER_H =
+
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+
+if CONFIG_KERNEL
+kerneldir = @prefix@/src/spl-$(VERSION)/include
+kernel_HEADERS = $(KERNEL_H)
+endif