1 # Top level Makefile for rpm
3 ACLOCAL_AMFLAGS = -I m4
5 DISTCHECK_CONFIGURE_FLAGS = --with-external-db
7 include $(top_srcdir)/rpm.am
10 EXTRA_DIST = CHANGES ChangeLog CREDITS GROUPS INSTALL \
12 db3/configure installplatform platform.in
22 SUBDIRS += rpmio lib build python scripts doc . tests
24 DIST_SUBDIRS = po misc luaext rpmio lib build python scripts doc tests
26 pkgconfigdir = $(libdir)/pkgconfig
28 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
29 AM_CPPFLAGS += -I$(top_srcdir)/build
30 AM_CPPFLAGS += -I$(top_srcdir)/lib
31 AM_CPPFLAGS += -I$(top_srcdir)/rpmio
32 AM_CPPFLAGS += @WITH_NSS_INCLUDE@
33 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
34 AM_CPPFLAGS += -I$(top_srcdir)/misc
35 AM_CPPFLAGS += @WITH_LIBELF_INCLUDE@
36 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
37 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"rpmpopt-${VERSION}\""
40 nodist_pkginclude_HEADERS =
42 pkginclude_HEADERS += rpmio/argv.h
43 pkginclude_HEADERS += rpmio/rpmio.h
44 pkginclude_HEADERS += rpmio/rpmurl.h
45 pkginclude_HEADERS += rpmio/rpmmacro.h
46 pkginclude_HEADERS += rpmio/rpmlog.h
47 pkginclude_HEADERS += rpmio/rpmpgp.h
48 pkginclude_HEADERS += rpmio/rpmsq.h
49 pkginclude_HEADERS += rpmio/rpmstring.h
50 pkginclude_HEADERS += rpmio/rpmsw.h
51 pkginclude_HEADERS += rpmio/rpmfileutil.h
52 pkginclude_HEADERS += rpmio/rpmutil.h
53 pkginclude_HEADERS += rpmio/rpmkeyring.h
55 pkginclude_HEADERS += lib/header.h
56 pkginclude_HEADERS += lib/rpmdb.h
57 pkginclude_HEADERS += lib/rpmcallback.h
58 pkginclude_HEADERS += lib/rpmcli.h
59 pkginclude_HEADERS += lib/rpmlib.h
60 pkginclude_HEADERS += lib/rpmds.h
61 pkginclude_HEADERS += lib/rpmfi.h
62 pkginclude_HEADERS += lib/rpmgi.h
63 pkginclude_HEADERS += lib/rpmlegacy.h
64 pkginclude_HEADERS += lib/rpmps.h
65 pkginclude_HEADERS += lib/rpmtag.h
66 pkginclude_HEADERS += lib/rpmtd.h
67 pkginclude_HEADERS += lib/rpmte.h
68 pkginclude_HEADERS += lib/rpmts.h
69 pkginclude_HEADERS += lib/rpmtypes.h
70 pkginclude_HEADERS += lib/rpmvf.h
72 pkginclude_HEADERS += build/rpmbuild.h
73 pkginclude_HEADERS += build/rpmfc.h
74 pkginclude_HEADERS += build/rpmspec.h
77 rpmbindir = `echo $(bindir) | $(SED) -e s,usr/bin,bin,`
80 bin_PROGRAMS = rpm2cpio rpmbuild
83 rpmconfig_SCRIPTS = find-provides find-requires mkinstalldirs \
84 config.guess config.sub
85 DISTCLEANFILES = find-provides
86 DISTCLEANFILES += find-requires
88 rpm_SOURCES = rpmqv.c debug.h system.h
89 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
90 rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
91 rpm_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
93 rpmbuild_SOURCES = build.c rpmqv.c build.h debug.h system.h
94 rpmbuild_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMBT
95 rpmbuild_LDADD = build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
96 rpmbuild_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
98 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
99 rpm2cpio_LDADD = lib/librpm.la rpmio/librpmio.la
100 rpm2cpio_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
105 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
107 rpmlibexec_PROGRAMS += debugedit
108 debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
109 debugedit_LDADD = rpmio/librpmio.la
110 debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
114 rpmlibexec_PROGRAMS += javadeps
115 javadeps_SOURCES = tools/javadeps.c
118 rpmlibexec_PROGRAMS += rpmdeps
119 rpmdeps_SOURCES = tools/rpmdeps.c
120 rpmdeps_LDADD = build/librpmbuild.la
122 bin_PROGRAMS += rpmgraph
123 rpmgraph_SOURCES = tools/rpmgraph.c
124 rpmgraph_LDADD = lib/librpm.la
126 dist_bin_SCRIPTS = scripts/gendiff
128 check_PROGRAMS = dumpdb
129 dumpdb_SOURCES = tools/dumpdb.c
130 dumpdb_LDADD = lib/librpm.la
132 check_PROGRAMS += rpminject
133 rpminject_SOURCES = tools/rpminject.c
134 rpminject_LDADD = build/librpmbuild.la
136 check_PROGRAMS += rpmsort
137 rpmsort_SOURCES = tools/rpmsort.c
138 rpmsort_LDADD = lib/librpm.la
140 rpmconfig_DATA = rpmrc
141 rpmrc: $(top_srcdir)/rpmrc.in
143 -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
144 < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
145 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
146 CLEANFILES += rpmrc.tmp rpmrc
147 EXTRA_DIST += rpmrc.in
149 rpmconfig_DATA += macros
150 macros: $(top_srcdir)/macros.in
151 ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.in )
153 EXTRA_DIST += macros.in
155 noinst_DATA = platform
156 platform: $(top_srcdir)/platform.in
158 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
159 < $(top_srcdir)/platform.in > platform.tmp \
160 && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
161 CLEANFILES += platform.tmp platform
162 EXTRA_DIST += platform.in
164 pkgconfig_DATA = rpm.pc
165 rpm.pc: $(top_srcdir)/rpm.pc.in
167 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
168 < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
169 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
170 CLEANFILES += rpm.pc.tmp rpm.pc
171 EXTRA_DIST += rpm.pc.in
173 rpmconfig_DATA += rpmpopt-$(VERSION)
174 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
176 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
177 < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
178 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
179 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
180 EXTRA_DIST += rpmpopt.in
182 usrsrcdir = $(prefix)/src
184 rpmvardir = $(localstatedir)/lib/rpm
188 rm -f $(DESTDIR)$(bindir)/rpmquery
189 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmquery
190 rm -f $(DESTDIR)$(bindir)/rpmverify
191 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmverify
192 rm -f $(DESTDIR)$(bindir)/rpmsign
193 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmsign
194 rm -f $(DESTDIR)$(bindir)/rpmdb
195 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmdb
198 @case "@host_os@" in \
199 solaris*|linux*|darwin*) \
200 DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
202 @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
204 # XXX to appease distcheck we need to remove "stuff" here...
206 @rm -f $(DESTDIR)$(bindir)/rpmquery
207 @rm -f $(DESTDIR)$(bindir)/rpmsign
208 @rm -f $(DESTDIR)$(bindir)/rpmverify
209 @rm -f $(DESTDIR)$(bindir)/rpmdb
210 @rm -rf $(DESTDIR)$(rpmconfigdir)/platform/
212 MAINTAINERCLEANFILES = ChangeLog
214 # Build hacking docs only on request
217 doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
219 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
220 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
221 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
222 -e "s,[@]VERSION[@],$(VERSION)," \
223 < $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
225 doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
226 @DOXYGEN@ doc/hacking.doxy
227 noinst_DATA += doc/hacking/html/index.html
230 EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
232 # Always build librpm docs
234 doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS)
235 files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
236 $(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
237 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
238 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
239 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
240 -e "s,[@]VERSION[@],$(VERSION)," \
241 < $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
243 doc/librpm/html/index.html: doc/librpm.doxy
244 @DOXYGEN@ doc/librpm.doxy
245 noinst_DATA += doc/librpm/html/index.html
247 EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
248 EXTRA_DIST += doc/librpm/html
251 db.h: $(top_builddir)/db3/db.h
252 $(LN_S) $(top_builddir)/db3/db.h $@
253 BUILT_SOURCES += db.h
255 DISTCLEANFILES += db.h
258 rm -rf doc/hacking/html
263 rm -f stamp-h.in db3/*.orig db3/db3lobjs
265 maintainer-clean-local:
266 rm -rf doc/librpm/html
268 $(top_srcdir)/preinstall.am: Makefile.am
269 rm -f $(top_srcdir)/preinstall.am
270 @for f in $(HEADERS); do \
272 echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
273 echo ' $$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
274 echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
275 echo 'CLEANFILES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
278 include/rpm/$(dirstamp):
279 @$(MKDIR_P) include/rpm
280 @: > include/rpm/$(dirstamp)
282 include $(top_srcdir)/preinstall.am