]> git.proxmox.com Git - mirror_spl.git/blobdiff - Makefile.am
Add copy-builtin to EXTRA_DIST
[mirror_spl.git] / Makefile.am
index 63d6ba7e4091eb50e336baa548b09eab21510ccf..6000a7d14731e035a739dfd2ef6c14aa977c56b6 100644 (file)
@@ -1,8 +1,21 @@
-SUBDIRS = lib cmd module include scripts
-
-AUTOMAKE_OPTIONS = foreign dist-zip
-EXTRA_DIST = autogen.sh spl.spec.in META DISCLAIMER
-noinst_HEADERS = spl_config.h spl_unconfig.h
+include $(top_srcdir)/config/rpm.am
+include $(top_srcdir)/config/deb.am
+include $(top_srcdir)/config/tgz.am
+include $(top_srcdir)/config/arch.am
+
+if CONFIG_USER
+USER_DIR = lib cmd scripts
+endif
+if CONFIG_KERNEL
+KERNEL_DIR = module include
+endif
+SUBDIRS = $(USER_DIR) $(KERNEL_DIR)
+
+AUTOMAKE_OPTIONS = foreign
+EXTRA_DIST  = autogen.sh spl.spec.in spl-modules.spec.in META DISCLAIMER
+EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
+EXTRA_DIST += dkms.postinst copy-builtin
+noinst_HEADERS = spl_config.h spl.release
 
 distclean-local::
        -$(RM) -R autom4te*.cache
@@ -12,12 +25,18 @@ distclean-local::
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
                -o -name '.*.rej' -o -name 'aclocal.m4' -o -size 0 \
                -o -name '*%' -o -name '.*.cmd' -o -name 'core' \
-               -o -name 'Makefile' -o -name 'Module.symvers' \) \
+               -o -name 'Makefile' -o -name '$(LINUX_SYMBOLS)' \
+               -o -name '*.order' -o -name '*.markers' \) \
                -type f -print | xargs $(RM)
 
+if CONFIG_KERNEL
 install-data-local:
-       $(INSTALL) -D spl_config.h $(DESTDIR)/$(LINUX)/include/spl/spl_config.h
-       $(INSTALL) -D spl_unconfig.h $(DESTDIR)/$(LINUX)/include/spl/spl_unconfig.h
+       release=$(SPL_META_VERSION)-$(SPL_META_RELEASE); \
+       instdest=$(DESTDIR)/usr/src/spl-$$release/$(LINUX_VERSION); \
+       for instfile in $(noinst_HEADERS) module/$(LINUX_SYMBOLS); do \
+               $(INSTALL) -D $$instfile $$instdest/$$instfile; \
+       done
+endif
 
 ctags:
        $(RM) $(top_srcdir)/tags
@@ -29,27 +48,6 @@ etags:
 
 tags: ctags etags
 
-rpm-local:
-       mkdir -p $(rpmbuild)/TMP && \
-       mkdir -p $(rpmbuild)/BUILD && \
-       mkdir -p $(rpmbuild)/RPMS && \
-       mkdir -p $(rpmbuild)/SRPMS && \
-       mkdir -p $(rpmbuild)/SPECS && cp $(PACKAGE).spec $(rpmbuild)/SPECS && \
-       mkdir -p $(rpmbuild)/SOURCES && cp $(distdir).tar.gz $(rpmbuild)/SOURCES
-
-srpm: dist
-       rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
-       $(MAKE) $(AM_MAKEFLAGS) rpmbuild="$$rpmbuild" rpm-local || exit 1; \
-       /usr/bin/rpmbuild --define "_tmppath $$rpmbuild/TMP" --define "_topdir $$rpmbuild" --define "build_src_rpm 1" --define "dist %{nil}" --nodeps -bs $$rpmbuild/SPECS/$(PACKAGE).spec || exit 1; \
-       cp $$rpmbuild/SRPMS/$(distdir)-$(SPL_META_RELEASE).src.rpm . || exit 1;\
-       $(RM) -R $$rpmbuild
-
-# Use 'make rpm LINUX_VERSION=2.x.y-z' to rebuild the source RPM
-# against any installed kernel-devel-2.x.y-z package.  This will
-# override the LINUX_VERSION detected at configure time.
-rpm: srpm
-       rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
-       $(MAKE) $(AM_MAKEFLAGS) rpmbuild="$$rpmbuild" rpm-local || exit 1; \
-       /usr/bin/rpmbuild --define "_tmppath $$rpmbuild/TMP" --define "_topdir $$rpmbuild" --define "dist %{nil}" --define "require_kver $(LINUX_VERSION)" --nodeps --rebuild $(distdir)-$(SPL_META_RELEASE).src.rpm || exit 1; \
-       cp $$rpmbuild/RPMS/*/* . || exit 1; \
-       $(RM) -R $$rpmbuild
+pkg: @DEFAULT_PACKAGE@
+pkg-modules: @DEFAULT_PACKAGE@-modules
+pkg-utils: @DEFAULT_PACKAGE@-utils