]> granicus.if.org Git - zfs/blob - Makefile.am
37182fe7f510d819230627a81fa60a5c75925db5
[zfs] / Makefile.am
1 SUBDIRS = lib cmd module include scripts
2
3 AUTOMAKE_OPTIONS = foreign dist-zip
4 EXTRA_DIST = autogen.sh spl.spec.in META DISCLAIMER
5 noinst_HEADERS = spl_config.h
6
7 distclean-local::
8         -$(RM) -R autom4te*.cache
9         -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
10                 -o -name .pc -o -name .hg -o -name .git \) -prune -o \
11                 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
12                 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
13                 -o -name '.*.rej' -o -name 'aclocal.m4' -o -size 0 \
14                 -o -name '*%' -o -name '.*.cmd' -o -name 'core' \
15                 -o -name 'Makefile' -o -name 'Module.symvers' \) \
16                 -type f -print | xargs $(RM)
17
18 install-data-local:
19         $(INSTALL) -D spl_config.h $(DESTDIR)/$(LINUX)/include/spl/spl_config.h
20
21 ctags:
22         $(RM) $(top_srcdir)/tags
23         find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
24
25 etags:
26         $(RM) $(top_srcdir)/TAGS
27         find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
28
29 tags: ctags etags
30
31 rpm-local:
32         mkdir -p $(rpmbuild)/TMP && \
33         mkdir -p $(rpmbuild)/BUILD && \
34         mkdir -p $(rpmbuild)/RPMS && \
35         mkdir -p $(rpmbuild)/SRPMS && \
36         mkdir -p $(rpmbuild)/SPECS && cp $(PACKAGE).spec $(rpmbuild)/SPECS && \
37         mkdir -p $(rpmbuild)/SOURCES && cp $(distdir).tar.gz $(rpmbuild)/SOURCES
38
39 srpm: dist
40         rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
41         $(MAKE) $(AM_MAKEFLAGS) rpmbuild="$$rpmbuild" rpm-local || exit 1; \
42         /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; \
43         cp $$rpmbuild/SRPMS/$(distdir)-$(SPL_META_RELEASE).src.rpm . || exit 1;\
44         $(RM) -R $$rpmbuild
45
46 # Use 'make rpm LINUX_VERSION=2.x.y-z' to rebuild the source RPM
47 # against any installed kernel-devel-2.x.y-z package.  This will
48 # override the LINUX_VERSION detected at configure time.
49 rpm: srpm
50         rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
51         $(MAKE) $(AM_MAKEFLAGS) rpmbuild="$$rpmbuild" rpm-local || exit 1; \
52         /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; \
53         cp $$rpmbuild/RPMS/*/* . || exit 1; \
54         $(RM) -R $$rpmbuild