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 installplatform platform* \
9 po/*.in po/*.po po/rpm.pot \
10 python/*.am python/*.in python/*.c python/*.h python/testit \
11 rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.spec
13 # XXX TODO: python perl
14 SUBDIRS = intl po popt rpmio lib build misc tools scripts tests doc .
16 INCLUDES = -I$(top_srcdir)/build -I$(top_srcdir)/lib -I$(top_srcdir)/rpmio \
17 -I$(top_srcdir)/popt @INCPATH@
21 myLDFLAGS = # -L$(top_builddir)/build/.libs -L$(top_builddir)/lib/.libs \
22 -L$(top_builddir)/rpmio/.libs -L$(top_builddir)/popt/.libs
24 # XXX libtool can/should generate dependent libs.
25 # XXX solaris2.6 cannot use *.la with --all-static (downrev binutils/egcs?)
26 # XXX top_builddir ldpaths are wrong building in tree
27 myLDADD = $(top_builddir)/build/librpmbuild.la $(top_builddir)/lib/librpm.la \
28 $(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la \
31 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
34 bin_PROGRAMS = rpm2cpio
37 pkglibdir = @RPMCONFIGDIR@
38 pkglib_PROGRAMS = rpmb rpmdb rpmi rpmk rpmq
39 pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros
40 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
41 config.guess config.sub
43 rpmpopt-$(VERSION): rpmpopt
47 acconfig.h build.h system.h
50 rpm_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
51 rpm_LDADD = $(myLDADD) @LIBMISC@
53 rpmb_SOURCES = build.c
54 rpmb_LDFLAGS = $(myLDFLAGS)
55 rpmb_LDADD = rpmb.o $(myLDADD)
57 $(COMPILE) -DIAM_RPMBT -o $@ -c $<
60 rpmdb_LDFLAGS = $(myLDFLAGS)
61 rpmdb_LDADD = rpmdb.o $(myLDADD)
63 $(COMPILE) -DIAM_RPMDB -o $@ -c $<
66 rpmi_LDFLAGS = $(myLDFLAGS)
67 rpmi_LDADD = rpmi.o $(myLDADD)
69 $(COMPILE) -DIAM_RPMEIU -o $@ -c $<
72 rpmk_LDFLAGS = $(myLDFLAGS)
73 rpmk_LDADD = rpmk.o $(myLDADD)
75 $(COMPILE) -DIAM_RPMK -o $@ -c $<
78 rpmq_LDFLAGS = $(myLDFLAGS)
79 rpmq_LDADD = rpmq.o $(myLDADD)
81 $(COMPILE) -DIAM_RPMQV -o $@ -c $<
83 rpm2cpio_SOURCES = rpm2cpio.c
84 rpm2cpio_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
85 rpm2cpio_LDADD = $(myLDADD) @LIBMISC@
87 $(PROGRAMS): $(myLDADD)
91 lclint $(DEFS) $(INCLUDES) $(rpm_SOURCES) $(rpmb_SOURCES) rpmqv.c
93 CVSTAG = r$(subst .,-,$(VERSION))
96 @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
97 @rm -f $(DESTDIR)/$(libdir)/rpmrc
98 @@LN_S@ rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc
99 @rm -f $(DESTDIR)/$(libdir)/rpmpopt
100 @@LN_S@ rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
101 @rm -f $(DESTDIR)/$(libdir)/rpm/rpmt
102 @@LN_S@ rpmb $(DESTDIR)/$(libdir)/rpm/rpmt
103 @rm -f $(DESTDIR)/$(libdir)/rpm/rpme
104 @@LN_S@ rpmi $(DESTDIR)/$(libdir)/rpm/rpme
105 @rm -f $(DESTDIR)/$(libdir)/rpm/rpmu
106 @@LN_S@ rpmi $(DESTDIR)/$(libdir)/rpm/rpmu
107 @rm -f $(DESTDIR)/$(libdir)/rpm/rpmv
108 @@LN_S@ rpmq $(DESTDIR)/$(libdir)/rpm/rpmv
109 for bf in b db e i k q t u v ; do \
110 rm -f $(DESTDIR)/$(bindir)/rpm$$bf ; \
111 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)/$(bindir)/rpm$$bf ; \
113 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
114 @case "@build_cpu@" in \
115 *86) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/i386;\
116 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/i486;\
117 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/i586;\
118 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/i686;\
119 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/athlon ;;\
120 alpha*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/alpha ;;\
121 sparc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc;\
122 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparcv9;\
123 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc64 ;;\
124 powerpc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/ppc ;;\
126 @case "@build_os@" in \
127 mint) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/m68kmint ;;\
129 chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ; \
130 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@ ;;\
131 *) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@ ;;\
133 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch
134 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES
135 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS
136 @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS
137 @$(mkinstalldirs) $(DESTDIR)/var/tmp
141 rm -rf /tmp/rpm-$(VERSION)
142 $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install
143 cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
147 find . -name "Makefile" -exec rm {} \;
148 rm -f *gz *rpm config.*
152 @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
154 echo "==> Please resolve differences between the repository and" ; \
155 echo "==> your rpm check out before tagging." ; \
161 @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) .
164 @echo "The final archive is ./rpm-$(VERSION).tar.gz."
167 nextsrpm: all archive
168 @sudo ./rpm -ta rpm-$(VERSION).tar.gz