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 config.site db db3/configure gendiff installplatform platform* \
9 Perl-RPM po/*.in po/*.po po/rpm.pot \
10 rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.c
12 SUBDIRS = intl po @WITH_DB_SUBDIR@ popt rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc .
15 -I$(top_srcdir)/build \
17 -I$(top_srcdir)/rpmdb \
18 -I$(top_srcdir)/rpmio \
19 -I$(top_srcdir)/popt \
24 myLDFLAGS = # @LDFLAGS_STATIC@
26 # XXX libtool can/should generate dependent libs.
27 # XXX solaris2.6 cannot use *.la with --all-static (downrev binutils/egcs?)
28 # XXX top_builddir ldpaths are wrong building in tree
30 $(top_builddir)/build/librpmbuild.la \
31 $(top_builddir)/lib/librpm.la \
32 $(top_builddir)/rpmdb/librpmdb.la \
33 $(top_builddir)/rpmio/librpmio.la \
34 $(top_builddir)/popt/libpopt.la \
37 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
40 bin_PROGRAMS = rpm2cpio
43 pkglibdir = @RPMCONFIGDIR@
44 pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
45 pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros
46 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
47 config.guess config.sub config.site
49 rpmpopt-$(VERSION): rpmpopt
53 acconfig.h build.h debug.h system.h
56 rpm_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
57 rpm_LDADD = rpm.o $(myLDADD)
59 $(COMPILE) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c rpmqv.c
62 #rpm_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
63 #rpm_LDADD = $(myLDADD)
65 rpmb_SOURCES = build.c
66 rpmb_LDFLAGS = $(myLDFLAGS)
67 rpmb_LDADD = rpmb.o $(myLDADD)
69 $(COMPILE) -DIAM_RPMBT -o $@ -c rpmqv.c
72 rpmd_LDFLAGS = $(myLDFLAGS)
73 rpmd_LDADD = rpmd.o $(myLDADD)
75 $(COMPILE) -DIAM_RPMDB -o $@ -c rpmqv.c
78 rpmi_LDFLAGS = $(myLDFLAGS)
79 rpmi_LDADD = rpmi.o $(myLDADD)
81 $(COMPILE) -DIAM_RPMEIU -o $@ -c rpmqv.c
84 rpmk_LDFLAGS = $(myLDFLAGS)
85 rpmk_LDADD = rpmk.o $(myLDADD)
87 $(COMPILE) -DIAM_RPMK -o $@ -c rpmqv.c
90 rpmq_LDFLAGS = $(myLDFLAGS)
91 rpmq_LDADD = rpmq.o $(myLDADD)
93 $(COMPILE) -DIAM_RPMQV -o $@ -c rpmqv.c
95 rpm2cpio_SOURCES = rpm2cpio.c
96 rpm2cpio_LDFLAGS = $(myLDFLAGS)
97 rpm2cpio_LDADD = $(myLDADD) @LIBMISC@
99 $(PROGRAMS): $(myLDADD) @WITH_APIDOCS_TARGET@
103 lclint $(DEFS) $(INCLUDES) rpmqv.c $(rpmb_SOURCES) \
104 `make -s sources -C build` \
105 `make -s sources -C lib` \
106 `make -s sources -C rpmdb` \
107 `make -s sources -C rpmio` \
108 `make -s sources -C popt`
110 CVSTAG = r$(subst .,-,$(VERSION))
112 pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR)
115 @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
116 @rm -f $(DESTDIR)$(libdir)/rpmrc
117 @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc
118 @rm -f $(DESTDIR)$(libdir)/rpmpopt
119 @@LN_S@ rpm/rpmpopt $(DESTDIR)$(libdir)/rpmpopt
120 @rm -f $(DESTDIR)$(libdir)/rpm/rpmt
121 @@LN_S@ rpmb $(DESTDIR)$(libdir)/rpm/rpmt
122 @rm -f $(DESTDIR)$(libdir)/rpm/rpme
123 @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpme
124 @rm -f $(DESTDIR)$(libdir)/rpm/rpmu
125 @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpmu
126 @rm -f $(DESTDIR)$(libdir)/rpm/rpmv
127 @@LN_S@ rpmq $(DESTDIR)$(libdir)/rpm/rpmv
128 rm -f $(DESTDIR)$(bindir)/rpmbuild
129 @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
130 rm -f $(DESTDIR)$(bindir)/rpmquery
131 @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
132 rm -f $(DESTDIR)$(bindir)/rpmverify
133 @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
134 rm -f $(DESTDIR)$(bindir)/rpmsign
135 @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
136 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
137 @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
138 for bf in e i u ; do \
139 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
140 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
142 @for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\
143 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/$$dir;\
145 @case "@host_cpu@" in \
146 *86) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\
147 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
148 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
149 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\
150 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
151 alpha*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
152 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
153 sparc*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
154 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
155 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;;\
156 ia64*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
157 s390*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
158 mipsel*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\
159 mips*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\
160 powerpc*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;;\
161 *) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
163 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
164 @case "@host_os@" in \
165 mint) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
167 chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ;; \
169 @$(mkinstalldirs) $(DESTDIR)/var/tmp
173 @for f in $(rpmbin_PROGRAMS) ; do\
174 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmbindir)/$$f ;\
175 $(__CHMOD) g+s $(DESTDIR)$(rpmbindir)/$$f ;\
177 @for f in $(bin_PROGRAMS) ; do\
178 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(bindir)/$$f ;\
180 @for f in $(pkglib_PROGRAMS) ; do\
181 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
182 $(__CHMOD) g+s $(DESTDIR)$(pkglibdir)/$$f ;\
184 @for f in $(pkglib_SCRIPTS) ; do\
185 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
187 @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
188 @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/rpm
189 -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/[A-Z]*
190 -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/rpm
191 -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/__db.*
195 @for f in $(rpmbin_PROGRAMS) ; do\
196 $(__CHMOD) g-s $(DESTDIR)$(rpmbindir)/$$f ;\
198 @for f in $(pkglib_PROGRAMS) ; do\
199 $(__CHMOD) g-s $(DESTDIR)$(pkglibdir)/$$f ;\
204 rm -rf /tmp/rpm-$(VERSION)
205 $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install
206 cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
210 find . -name "Makefile" -exec rm {} \;
211 rm -f *gz *rpm config.*
215 @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
217 echo "==> Please resolve differences between the repository and" ; \
218 echo "==> your rpm check out before tagging." ; \
224 @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) .
227 @echo "The final archive is ./rpm-$(VERSION).tar.gz."
230 nextsrpm: all archive
231 @sudo ./rpm -ta rpm-$(VERSION).tar.gz
234 doxygen @WITH_APIDOCS_TARGET@: Doxyfile
237 - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
240 find . -type f -name "*.[ch]*" | xargs @CTAGS@