link libbz2.a statically to avoid rpm->bzip2 dependence for now.
[platform/upstream/rpm.git] / Makefile.am
1 # Top level Makefile for rpm
2
3 AUTOMAKE_OPTIONS = 1.4 foreign
4
5 EXTRA_DIST = CHANGES CREDITS GROUPS README.amiga INSTALL RPM-PGP-KEY \
6         autodeps/none autodeps/*.prov autodeps/*.req autogen.sh \
7         gendiff po/*.in po/*.po po/rpm.pot \
8         python/*.am python/*.in python/*.c python/*.h python/testit \
9         rpm.magic rpmpopt rpm.spec
10
11 EXTRA_PROGRAMS = rpmconvert
12
13 # XXX TODO: python perl
14 SUBDIRS = popt build lib po intl misc tools scripts tests doc .
15
16 INCLUDES = \
17         -I$(top_srcdir)/build \
18         -I$(top_srcdir)/lib \
19         -I$(top_srcdir)/popt \
20         @INCPATH@
21
22 mylibs= $(top_builddir)/build/librpmbuild.la \
23         $(top_builddir)/lib/librpm.la \
24         $(top_builddir)/popt/libpopt.la
25
26 LDFLAGS = @LDFLAGS_STATIC@
27
28 rpmbindir = $(subst usr/bin,bin,$(bindir))
29 rpmbin_PROGRAMS = rpm
30
31 bin_PROGRAMS =          rpm2cpio
32 bin_SCRIPTS =           gendiff
33
34 noinst_PROGRAMS =       @BUILD_RPMCONVERT@
35
36 pkglibdir = @RPMCONFIGDIR@
37 pkglib_DATA = rpmrc rpmpopt macros
38 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
39         config.guess config.sub
40
41 noinst_HEADERS = \
42         acconfig.h      build.h         system.h
43
44 rpm_SOURCES =           build.c rpm.c
45 rpm_LDADD =             $(mylibs) @LIBMISC@
46
47 $(PROGRAMS):            $(mylibs) @LIBMISC@
48
49 .PHONY: lclint
50 lclint:
51         lclint ${DEFS} ${INCLUDES} ${rpm_SOURCES}
52
53 CVSTAG = r$(subst .,-,$(VERSION))
54
55 rpm2cpio_SOURCES =      rpm2cpio.c
56 rpm2cpio_LDADD =        $(mylibs)
57
58 rpmconvert_SOURCES =    convertdb.c oldrpmdb.c
59 ## Libmisc.a is required for rpmconvert.
60 rpmconvert_LDADD =      $(mylibs) @LIBMISC@ -lgdbm
61
62 install-data-local:
63         @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
64         @rm -f $(DESTDIR)/$(libdir)/rpmrc
65         @ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc
66         @rm -f $(DESTDIR)/$(libdir)/rpmpopt
67         @ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
68         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
69         @case "@build_cpu@" in \
70         *86) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/i386 ;;\
71         alpha*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/alpha ;;\
72         sparc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc;\
73                 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc64 ;;\
74         powerpc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/ppc ;;\
75         esac
76         @case "@build_os@" in \
77         mint) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/m68kmint ;;\
78         *) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@ ;;\
79         esac
80         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch
81         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES
82         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS
83         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS
84         @$(mkinstalldirs) $(DESTDIR)/var/tmp
85
86 .PHONY:                tar
87 tar:
88         rm -rf /tmp/rpm-$(VERSION)
89         $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install
90         cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
91
92 .PHONY: noconfig
93 noconfig:
94         find . -name "Makefile" -exec rm {} \; 
95         rm -f *gz *rpm config.*
96
97 .PHONY: archive
98 archive: 
99         @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
100             echo " " ; \
101             echo "==> Please resolve differences between the repository and" ; \
102             echo "==> your rpm check out before tagging." ; \
103             echo " " ; \
104             cvs -n up ; \
105             echo " " ; \
106             exit 1 ; \
107         }
108         @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) .
109         @make dist
110         @echo " "
111         @echo "The final archive is ./rpm-$(VERSION).tar.gz."
112
113 .PHONY: nextsrpm
114 nextsrpm: all archive
115         @sudo ./rpm -ta rpm-$(VERSION).tar.gz