1 # Top level Makefile for rpm
3 AUTOMAKE_OPTIONS = 1.4 foreign
5 EXTRA_DIST = CHANGES CREDITS GROUPS README.amiga INSTALL \
6 RPM-GPG-KEY RPM-PGP-KEY \
7 autodeps/none autodeps/*.prov autodeps/*.req autogen.sh \
8 gendiff po/*.in po/*.po po/rpm.pot \
9 python/*.am python/*.in python/*.c python/*.h python/testit \
10 rpm.magic rpmpopt rpm.spec installplatform
12 EXTRA_PROGRAMS = rpmconvert
14 # XXX TODO: python perl
15 SUBDIRS = intl po popt build lib misc tools scripts tests doc .
17 INCLUDES = -I$(top_srcdir)/build -I$(top_srcdir)/lib -I$(top_srcdir)/popt \
20 myldflags= -L$(top_builddir)/build -L$(top_builddir)/lib -L$(top_builddir)/popt
22 # XXX libtool can/should generate dependent libs.
23 # XXX solaris2.6 cannot use *.la with --all-static (downrev binutils/egcs?)
25 $(top_builddir)/build/.libs/librpmbuild.a \
26 $(top_builddir)/lib/.libs/librpm.a \
27 $(top_builddir)/popt/.libs/libpopt.a \
30 LDFLAGS = @LDFLAGS_STATIC@ $(myldflags)
33 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
36 bin_PROGRAMS = rpm2cpio
39 noinst_PROGRAMS = @BUILD_RPMCONVERT@
41 pkglibdir = @RPMCONFIGDIR@
42 pkglib_DATA = rpmrc rpmpopt macros
43 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
44 config.guess config.sub
47 acconfig.h build.h system.h
49 rpm_SOURCES = build.c rpm.c
51 $(PROGRAMS): $(myldadd)
55 lclint ${DEFS} ${INCLUDES} ${rpm_SOURCES}
57 CVSTAG = r$(subst .,-,$(VERSION))
59 rpm2cpio_SOURCES = rpm2cpio.c
61 rpmconvert_SOURCES = convertdb.c oldrpmdb.c
62 ## Libmisc.a is required for rpmconvert.
63 rpmconvert_LDADD = $(myldadd) -lgdbm
66 @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
67 @rm -f $(DESTDIR)/$(libdir)/rpmrc
68 @ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc
69 @rm -f $(DESTDIR)/$(libdir)/rpmpopt
70 @ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
71 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
72 @case "@build_cpu@" in \
73 *86) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/i386 ;;\
74 alpha*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/alpha ;;\
75 sparc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc;\
76 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc64 ;;\
77 powerpc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/ppc ;;\
79 @case "@build_os@" in \
80 mint) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/m68kmint ;;\
81 linux*) DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ; \
82 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@ ;;\
83 *) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@ ;;\
85 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch
86 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES
87 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS
88 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS
89 @$(mkinstalldirs) $(DESTDIR)/var/tmp
93 rm -rf /tmp/rpm-$(VERSION)
94 $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install
95 cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
99 find . -name "Makefile" -exec rm {} \;
100 rm -f *gz *rpm config.*
104 @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
106 echo "==> Please resolve differences between the repository and" ; \
107 echo "==> your rpm check out before tagging." ; \
113 @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) .
116 @echo "The final archive is ./rpm-$(VERSION).tar.gz."
119 nextsrpm: all archive
120 @sudo ./rpm -ta rpm-$(VERSION).tar.gz