1 # Top level Makefile for rpm
3 AUTOMAKE_OPTIONS = 1.4 foreign
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
11 EXTRA_PROGRAMS = rpmconvert
13 # XXX TODO: python perl
14 SUBDIRS = popt build lib po intl misc tools scripts tests doc .
17 -I$(top_srcdir)/build \
19 -I$(top_srcdir)/popt \
23 mylibs= $(top_builddir)/build/librpmbuild.la \
24 $(top_builddir)/lib/librpm.la \
25 $(top_builddir)/popt/libpopt.la \
28 LDFLAGS = @LDFLAGS_STATIC@
30 rpmbindir = $(subst usr/bin,bin,$(bindir))
33 bin_PROGRAMS = rpm2cpio
36 noinst_PROGRAMS = @BUILD_RPMCONVERT@
38 pkglibdir = @RPMCONFIGDIR@
39 pkglib_DATA = rpmrc rpmpopt macros
40 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
41 config.guess config.sub
44 acconfig.h build.h system.h
46 rpm_SOURCES = build.c rpm.c
49 $(PROGRAMS): $(mylibs)
53 lclint ${DEFS} ${INCLUDES} ${rpm_SOURCES}
55 CVSTAG = r$(subst .,-,$(VERSION))
57 rpm2cpio_SOURCES = rpm2cpio.c
58 rpm2cpio_LDADD = $(mylibs)
60 rpmconvert_SOURCES = convertdb.c oldrpmdb.c
61 ## Libmisc.a is required for rpmconvert.
62 rpmconvert_LDADD = $(mylibs) -lgdbm
65 @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
66 @rm -f $(DESTDIR)/$(libdir)/rpmrc
67 @ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc
68 @rm -f $(DESTDIR)/$(libdir)/rpmpopt
69 @ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
70 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
71 @case "@build_cpu@" in \
72 *86) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/i386 ;;\
73 alpha*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/alpha ;;\
74 sparc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc;\
75 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc64 ;;\
76 powerpc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/ppc ;;\
78 @case "@build_os@" in \
79 mint) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/m68kmint ;;\
80 *) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@ ;;\
82 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch
83 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES
84 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS
85 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS
86 @$(mkinstalldirs) $(DESTDIR)/var/tmp
90 rm -rf /tmp/rpm-$(VERSION)
91 $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install
92 cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
96 find . -name "Makefile" -exec rm {} \;
97 rm -f *gz *rpm config.*
101 @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
103 echo "==> Please resolve differences between the repository and" ; \
104 echo "==> your rpm check out before tagging." ; \
110 @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) .
113 @echo "The final archive is ./rpm-$(VERSION).tar.gz."
116 nextsrpm: all archive
117 @sudo ./rpm -ta rpm-$(VERSION).tar.gz