summaryrefslogtreecommitdiffstats
path: root/Makefile.in
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-03-05 09:08:07 -0800
committerBrian Behlendorf <[email protected]>2009-03-09 15:56:55 -0700
commitc5f704607bbdc5e6a89b4ac088dff16a6c1eeb5e (patch)
tree182cb70d67bde33e9697623ca0b0533985407528 /Makefile.in
parent32f74c5280ca9a753991b97370e7c4c1a4e34ede (diff)
Build system and packaging (RPM support)
An update to the build system to properly support all commonly used Makefile targets these include: make all # Build everything make install # Install everything make clean # Clean up build products make distclean # Clean up everything make dist # Create package tarball make srpm # Create package source RPM make rpm # Create package binary RPMs make tags # Create ctags and etags for everything Extra care was taken to ensure that the source RPMs are fully rebuildable against Fedora/RHEL/Chaos kernels. To build binary RPMs from the source RPM for your system simply run: rpmbuild --rebuild spl-x.y.z-1.src.rpm This will produce two binary RPMs with correct 'requires' dependencies for your kernel. One will contain all spl modules and support utilities, the other is a devel package for compiling additional kernel modules which are dependant on the spl. spl-x.y.z-1_<kernel version>.x86_64.rpm spl-devel-x.y.2-1_<kernel version>.x86_64.rpm
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in135
1 files changed, 108 insertions, 27 deletions
diff --git a/Makefile.in b/Makefile.in
index 834d7f74b..1bdb7b7a9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -13,6 +13,7 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@@ -36,8 +37,9 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/spl_config.h.in \
+DIST_COMMON = $(am__configure_deps) $(include_HEADERS) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/spl.spec.in $(srcdir)/spl_config.h.in \
$(top_srcdir)/configure $(top_srcdir)/module/Makefile.in \
$(top_srcdir)/module/spl/Makefile.in \
$(top_srcdir)/module/splat/Makefile.in AUTHORS COPYING \
@@ -54,6 +56,8 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = spl_config.h
+CONFIG_CLEAN_FILES = module/Makefile module/spl/Makefile \
+ module/splat/Makefile spl.spec
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -62,6 +66,15 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(includedir)"
+includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(include_HEADERS)
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
@@ -118,6 +131,7 @@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LINUX = @LINUX@
LINUX_OBJ = @LINUX_OBJ@
+LINUX_VERSION = @LINUX_VERSION@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
@@ -178,7 +192,6 @@ host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
-kmoduledir = @kmoduledir@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
@@ -195,11 +208,10 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-AUTOMAKE_OPTIONS = foreign dist-zip
SUBDIRS = lib cmd module include scripts
-CONFIG_CLEAN_FILES = aclocal.m4 config.guess config.sub depcomp \
- install-sh missing mkinstalldirs
-EXTRA_DIST = autogen.sh
+AUTOMAKE_OPTIONS = foreign dist-zip
+EXTRA_DIST = autogen.sh spl.spec META DISCLAIMER
+include_HEADERS = spl_config.h
all: spl_config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -260,6 +272,8 @@ module/spl/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/spl/Make
cd $(top_builddir) && $(SHELL) ./config.status $@
module/splat/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/splat/Makefile.in
cd $(top_builddir) && $(SHELL) ./config.status $@
+spl.spec: $(top_builddir)/config.status $(srcdir)/spl.spec.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
mostlyclean-libtool:
-rm -f *.lo
@@ -270,6 +284,23 @@ clean-libtool:
distclean-libtool:
-rm -f libtool
uninstall-info-am:
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
+ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+ done
+
+uninstall-includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(includedir)/$$f"; \
+ done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -350,7 +381,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
-tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) spl_config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -380,7 +410,6 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) spl_config.h.in $(TAGS_DEPENDENCIES)
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
-ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) spl_config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
@@ -406,7 +435,7 @@ distclean-tags:
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
- $(mkdir_p) $(distdir)/config $(distdir)/module $(distdir)/module/spl $(distdir)/module/splat $(distdir)/scripts
+ $(mkdir_p) $(distdir)/. $(distdir)/config $(distdir)/module $(distdir)/module/spl $(distdir)/module/splat
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
@@ -548,9 +577,12 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-recursive
-all-am: Makefile spl_config.h
+all-am: Makefile $(HEADERS) spl_config.h
installdirs: installdirs-recursive
installdirs-am:
+ for dir in "$(DESTDIR)$(includedir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
@@ -583,7 +615,7 @@ distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
- distclean-libtool distclean-tags
+ distclean-libtool distclean-local distclean-tags
dvi: dvi-recursive
@@ -595,7 +627,7 @@ info: info-recursive
info-am:
-install-data-am:
+install-data-am: install-data-local install-includeHEADERS
install-exec-am:
@@ -623,7 +655,7 @@ ps: ps-recursive
ps-am:
-uninstall-am: uninstall-info-am
+uninstall-am: uninstall-includeHEADERS uninstall-info-am
uninstall-info: uninstall-info-recursive
@@ -632,19 +664,68 @@ uninstall-info: uninstall-info-recursive
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
- distclean-recursive distclean-tags distcleancheck distdir \
- distuninstallcheck dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- maintainer-clean-recursive mostlyclean mostlyclean-generic \
- mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
- tags tags-recursive uninstall uninstall-am uninstall-info-am
-
-
-rpms: dist Makefile
- rpmbuild -ta $(distdir).tar.gz
+ distclean-local distclean-recursive distclean-tags \
+ distcleancheck distdir distuninstallcheck dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-data-local install-exec \
+ install-exec-am install-includeHEADERS install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-includeHEADERS \
+ uninstall-info-am
+
+
+distclean-local::
+ -$(RM) -R autom4te*.cache
+ -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
+ -o -name .pc -o -name .hg -o -name .git \) -prune -o \
+ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+ -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' \) \
+ -type f -print | xargs $(RM)
+
+install-data-local:
+ $(INSTALL) module/Module.symvers $(DESTDIR)/$(includedir)
+
+ctags:
+ $(RM) $(top_srcdir)/tags
+ find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
+
+etags:
+ $(RM) $(top_srcdir)/TAGS
+ find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
+
+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
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: