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 fileattrs doc . tests plugins
24 DIST_SUBDIRS = po misc luaext rpmio lib build python scripts fileattrs doc tests plugins
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 += -DLOCALEDIR="\"$(localedir)\""
36 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"rpmpopt-${VERSION}\""
39 nodist_pkginclude_HEADERS =
41 pkginclude_HEADERS += rpmio/argv.h
42 pkginclude_HEADERS += rpmio/rpmio.h
43 pkginclude_HEADERS += rpmio/rpmurl.h
44 pkginclude_HEADERS += rpmio/rpmmacro.h
45 pkginclude_HEADERS += rpmio/rpmlog.h
46 pkginclude_HEADERS += rpmio/rpmpgp.h
47 pkginclude_HEADERS += rpmio/rpmsq.h
48 pkginclude_HEADERS += rpmio/rpmstring.h
49 pkginclude_HEADERS += rpmio/rpmsw.h
50 pkginclude_HEADERS += rpmio/rpmfileutil.h
51 pkginclude_HEADERS += rpmio/rpmutil.h
52 pkginclude_HEADERS += rpmio/rpmkeyring.h
54 pkginclude_HEADERS += lib/header.h
55 pkginclude_HEADERS += lib/rpmdb.h
56 pkginclude_HEADERS += lib/rpmcallback.h
57 pkginclude_HEADERS += lib/rpmcli.h
58 pkginclude_HEADERS += lib/rpmlib.h
59 pkginclude_HEADERS += lib/rpmds.h
60 pkginclude_HEADERS += lib/rpmfi.h
61 pkginclude_HEADERS += lib/rpmlegacy.h
62 pkginclude_HEADERS += lib/rpmpol.h
63 pkginclude_HEADERS += lib/rpmps.h
64 pkginclude_HEADERS += lib/rpmprob.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
71 pkginclude_HEADERS += lib/rpmplugins.h
73 pkginclude_HEADERS += build/rpmbuild.h
74 pkginclude_HEADERS += build/rpmfc.h
75 pkginclude_HEADERS += build/rpmspec.h
78 rpmbindir = `echo $(bindir) | $(SED) -e s,usr/bin,bin,`
81 bin_PROGRAMS = rpm2cpio rpmbuild rpmsign
84 rpmconfig_SCRIPTS = find-provides find-requires mkinstalldirs \
85 config.guess config.sub
86 DISTCLEANFILES = find-provides
87 DISTCLEANFILES += find-requires
89 noinst_LTLIBRARIES = libcliutils.la
90 libcliutils_la_SOURCES = cliutils.h cliutils.c
91 libcliutils_la_CPPFLAGS = $(AM_CPPFLAGS)
92 libcliutils_la_LIBADD = lib/librpm.la rpmio/librpmio.la
93 libcliutils_la_LIBADD += @WITH_POPT_LIB@
95 rpm_SOURCES = rpmqv.c debug.h system.h
96 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
97 rpm_LDADD = libcliutils.la
98 rpm_LDADD += build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
99 rpm_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
101 rpmsign_SOURCES = rpmsign.c debug.h system.h
102 rpmsign_CPPFLAGS = $(AM_CPPFLAGS)
103 rpmsign_LDADD = libcliutils.la
104 rpmsign_LDADD += lib/librpm.la rpmio/librpmio.la
105 rpmsign_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
107 rpmbuild_SOURCES = rpmbuild.c debug.h system.h
108 rpmbuild_CPPFLAGS = $(AM_CPPFLAGS)
109 rpmbuild_LDADD = libcliutils.la
110 rpmbuild_LDADD += build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
111 rpmbuild_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
113 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
114 rpm2cpio_LDADD = lib/librpm.la rpmio/librpmio.la
115 rpm2cpio_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
120 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
122 rpmlibexec_PROGRAMS += debugedit
123 debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
124 debugedit_LDADD = rpmio/librpmio.la
125 debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
127 rpmlibexec_PROGRAMS += elfdeps
128 elfdeps_SOURCES = tools/elfdeps.c
129 elfdeps_LDADD = rpmio/librpmio.la
130 elfdeps_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
134 rpmlibexec_PROGRAMS += javadeps
135 javadeps_SOURCES = tools/javadeps.c
138 rpmlibexec_PROGRAMS += rpmdeps
139 rpmdeps_SOURCES = tools/rpmdeps.c
140 rpmdeps_LDADD = lib/librpm.la rpmio/librpmio.la build/librpmbuild.la @WITH_POPT_LIB@
142 bin_PROGRAMS += rpmgraph
143 rpmgraph_SOURCES = tools/rpmgraph.c
144 rpmgraph_LDADD = lib/librpm.la rpmio/librpmio.la @WITH_POPT_LIB@
146 dist_bin_SCRIPTS = scripts/gendiff
148 rpmconfig_DATA = rpmrc
149 rpmrc: $(top_srcdir)/rpmrc.in
151 -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
152 < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
153 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
154 CLEANFILES += rpmrc.tmp rpmrc
155 EXTRA_DIST += rpmrc.in
157 rpmconfig_DATA += macros
158 macros: $(top_srcdir)/macros.in
159 ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.in )
161 EXTRA_DIST += macros.in
163 noinst_DATA = platform
164 platform: $(top_srcdir)/platform.in
166 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
167 < $(top_srcdir)/platform.in > platform.tmp \
168 && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
169 CLEANFILES += platform.tmp platform
170 EXTRA_DIST += platform.in
172 pkgconfig_DATA = rpm.pc
173 rpm.pc: $(top_srcdir)/rpm.pc.in
175 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
176 < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
177 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
178 CLEANFILES += rpm.pc.tmp rpm.pc
179 EXTRA_DIST += rpm.pc.in
181 rpmconfig_DATA += rpmpopt-$(VERSION)
182 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
184 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
185 < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
186 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
187 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
188 EXTRA_DIST += rpmpopt.in
190 usrsrcdir = $(prefix)/src
192 rpmvardir = $(localstatedir)/lib/rpm
196 rm -f $(DESTDIR)$(bindir)/rpmquery
197 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmquery
198 rm -f $(DESTDIR)$(bindir)/rpmverify
199 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmverify
200 rm -f $(DESTDIR)$(bindir)/rpmdb
201 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmdb
204 @case "@host_os@" in \
205 solaris*|linux*|darwin*) \
206 DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
208 @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
210 # XXX to appease distcheck we need to remove "stuff" here...
212 @rm -f $(DESTDIR)$(bindir)/rpmquery
213 @rm -f $(DESTDIR)$(bindir)/rpmverify
214 @rm -f $(DESTDIR)$(bindir)/rpmdb
215 @rm -rf $(DESTDIR)$(rpmconfigdir)/platform/
217 MAINTAINERCLEANFILES = ChangeLog
219 # Build hacking docs only on request
222 doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
224 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
225 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
226 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
227 -e "s,[@]VERSION[@],$(VERSION)," \
228 < $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
230 doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
231 @DOXYGEN@ doc/hacking.doxy
232 noinst_DATA += doc/hacking/html/index.html
235 EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
237 # Always build librpm docs
239 doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS)
240 files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
241 $(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
242 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
243 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
244 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
245 -e "s,[@]VERSION[@],$(VERSION)," \
246 < $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
248 doc/librpm/html/index.html: doc/librpm.doxy
249 @DOXYGEN@ doc/librpm.doxy
250 noinst_DATA += doc/librpm/html/index.html
252 EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
253 EXTRA_DIST += doc/librpm/html
256 db.h: $(top_builddir)/db3/db.h
257 $(LN_S) $(top_builddir)/db3/db.h $@
258 BUILT_SOURCES += db.h
260 DISTCLEANFILES += db.h
263 rm -rf doc/hacking/html
268 rm -f stamp-h.in db3/*.orig db3/db3lobjs
270 maintainer-clean-local:
271 rm -rf doc/librpm/html
273 $(top_srcdir)/preinstall.am: Makefile.am
274 rm -f $(top_srcdir)/preinstall.am
275 @for f in $(HEADERS); do \
277 echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
278 echo ' $$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
279 echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
280 echo 'CLEANFILES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
283 include/rpm/$(dirstamp):
284 @$(MKDIR_P) include/rpm
285 @: > include/rpm/$(dirstamp)
287 include $(top_srcdir)/preinstall.am