1 # Top level Makefile for rpm
3 AUTOMAKE_OPTIONS = 1.4 foreign
5 EXTRA_DIST = CHANGES CREDITS Doxyheader GROUPS README.amiga INSTALL \
6 RPM-GPG-KEY RPM-PGP-KEY \
7 autodeps/none autodeps/*.prov autodeps/*.req autogen.sh \
8 db db3/configure gendiff installplatform platform* \
9 po/*.in po/*.po po/rpm.pot \
10 rpm.magic rpmpopt-$(VERSION) rpmqv.c
13 SUBDIRS = intl po @WITH_DB_SUBDIR@ popt rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc .
16 -I$(top_srcdir)/build \
18 -I$(top_srcdir)/rpmdb \
19 -I$(top_srcdir)/rpmio \
20 -I$(top_srcdir)/popt \
25 myLDFLAGS = # -L$(top_builddir)/build/.libs -L$(top_builddir)/lib/.libs \
26 -L$(top_builddir)/rpmio/.libs -L$(top_builddir)/popt/.libs
28 # XXX libtool can/should generate dependent libs.
29 # XXX solaris2.6 cannot use *.la with --all-static (downrev binutils/egcs?)
30 # XXX top_builddir ldpaths are wrong building in tree
32 $(top_builddir)/build/librpmbuild.la \
33 $(top_builddir)/lib/librpm.la \
34 $(top_builddir)/rpmdb/librpmdb.la \
35 $(top_builddir)/rpmio/librpmio.la \
36 $(top_builddir)/popt/libpopt.la \
39 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
42 bin_PROGRAMS = rpm2cpio
45 pkglibdir = @RPMCONFIGDIR@
46 pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
47 pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros
48 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
49 config.guess config.sub
51 rpmpopt-$(VERSION): rpmpopt
55 acconfig.h build.h debug.h system.h
58 rpm_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
59 rpm_LDADD = $(myLDADD)
61 rpmb_SOURCES = build.c
62 rpmb_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
63 rpmb_LDADD = rpmb.o $(myLDADD)
65 $(COMPILE) -DIAM_RPMBT -o $@ -c rpmqv.c
68 rpmd_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
69 rpmd_LDADD = rpmd.o $(myLDADD)
71 $(COMPILE) -DIAM_RPMDB -o $@ -c rpmqv.c
74 rpmi_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
75 rpmi_LDADD = rpmi.o $(myLDADD)
77 $(COMPILE) -DIAM_RPMEIU -o $@ -c rpmqv.c
80 rpmk_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
81 rpmk_LDADD = rpmk.o $(myLDADD)
83 $(COMPILE) -DIAM_RPMK -o $@ -c rpmqv.c
86 rpmq_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
87 rpmq_LDADD = rpmq.o $(myLDADD)
89 $(COMPILE) -DIAM_RPMQV -o $@ -c rpmqv.c
91 rpm2cpio_SOURCES = rpm2cpio.c
92 rpm2cpio_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
93 rpm2cpio_LDADD = $(myLDADD)
95 $(PROGRAMS): $(myLDADD) @WITH_APIDOCS_TARGET@
99 lclint $(DEFS) $(INCLUDES) rpmqv.c $(rpmb_SOURCES) \
100 `make -s sources -C build` \
101 `make -s sources -C lib` \
102 `make -s sources -C rpmdb` \
103 `make -s sources -C rpmio` \
104 `make -s sources -C popt`
106 CVSTAG = r$(subst .,-,$(VERSION))
108 pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR)
111 @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
112 @rm -f $(DESTDIR)$(libdir)/rpmrc
113 @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc
114 @rm -f $(DESTDIR)$(libdir)/rpmpopt
115 @@LN_S@ rpm/rpmpopt $(DESTDIR)$(libdir)/rpmpopt
116 @rm -f $(DESTDIR)$(libdir)/rpm/rpmt
117 @@LN_S@ rpmb $(DESTDIR)$(libdir)/rpm/rpmt
118 @rm -f $(DESTDIR)$(libdir)/rpm/rpme
119 @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpme
120 @rm -f $(DESTDIR)$(libdir)/rpm/rpmu
121 @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpmu
122 @rm -f $(DESTDIR)$(libdir)/rpm/rpmv
123 @@LN_S@ rpmq $(DESTDIR)$(libdir)/rpm/rpmv
124 rm -f $(DESTDIR)$(bindir)/rpmbuild
125 @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
126 rm -f $(DESTDIR)$(bindir)/rpmquery
127 @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
128 rm -f $(DESTDIR)$(bindir)/rpmverify
129 @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
130 rm -f $(DESTDIR)$(bindir)/rpmsign
131 @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
132 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
133 @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
134 for bf in e i u ; do \
135 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
136 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
138 @$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/BUILD
139 @case "@build_cpu@" in \
140 *86) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i386;\
141 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i486;\
142 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i586;\
143 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i686;\
144 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
145 alpha*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha;\
146 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
147 sparc*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc;\
148 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9;\
149 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;;\
150 ia64*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
151 s390*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
152 powerpc*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;;\
154 @case "@build_os@" in \
155 mint) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
157 chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ; \
158 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/@build_cpu@ ;;\
159 *) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/@build_cpu@ ;;\
161 @$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
162 @$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/SOURCES
163 @$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/SPECS
164 @$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/SRPMS
165 @$(mkinstalldirs) $(DESTDIR)/var/tmp
169 rm -rf /tmp/rpm-$(VERSION)
170 $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install
171 cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
175 find . -name "Makefile" -exec rm {} \;
176 rm -f *gz *rpm config.*
180 @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
182 echo "==> Please resolve differences between the repository and" ; \
183 echo "==> your rpm check out before tagging." ; \
189 @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) .
192 @echo "The final archive is ./rpm-$(VERSION).tar.gz."
195 nextsrpm: all archive
196 @sudo ./rpm -ta rpm-$(VERSION).tar.gz
199 doxygen @WITH_APIDOCS_TARGET@: Doxyfile
202 - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
205 find . -type f -name "*.[ch]*" | xargs @CTAGS@