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 += -DRPMCONFIGDIR="\"@RPMCONFIGDIR@\""
38 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"@RPMCONFIGDIR@/rpmpopt-${VERSION}\""
40 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
43 nodist_pkginclude_HEADERS =
45 pkginclude_HEADERS += rpmio/argv.h
46 pkginclude_HEADERS += rpmio/rpmio.h
47 pkginclude_HEADERS += rpmio/rpmurl.h
48 pkginclude_HEADERS += rpmio/rpmmacro.h
49 pkginclude_HEADERS += rpmio/rpmlog.h
50 pkginclude_HEADERS += rpmio/rpmpgp.h
51 pkginclude_HEADERS += rpmio/rpmsq.h
52 pkginclude_HEADERS += rpmio/rpmstring.h
53 pkginclude_HEADERS += rpmio/rpmsw.h
54 pkginclude_HEADERS += rpmio/rpmfileutil.h
55 pkginclude_HEADERS += rpmio/rpmutil.h
56 pkginclude_HEADERS += rpmio/rpmkeyring.h
58 pkginclude_HEADERS += lib/header.h
59 pkginclude_HEADERS += lib/rpmdb.h
60 pkginclude_HEADERS += lib/rpmcallback.h
61 pkginclude_HEADERS += lib/rpmcli.h
62 pkginclude_HEADERS += lib/rpmlib.h
63 pkginclude_HEADERS += lib/rpmal.h
64 pkginclude_HEADERS += lib/rpmds.h
65 pkginclude_HEADERS += lib/rpmfi.h
66 pkginclude_HEADERS += lib/rpmgi.h
67 pkginclude_HEADERS += lib/rpmps.h
68 pkginclude_HEADERS += lib/rpmtag.h
69 pkginclude_HEADERS += lib/rpmtd.h
70 pkginclude_HEADERS += lib/rpmte.h
71 pkginclude_HEADERS += lib/rpmts.h
72 pkginclude_HEADERS += lib/rpmtypes.h
73 pkginclude_HEADERS += lib/rpmvf.h
74 nodist_pkginclude_HEADERS += lib/rpmints.h
76 pkginclude_HEADERS += build/rpmbuild.h
77 pkginclude_HEADERS += build/rpmfc.h
78 pkginclude_HEADERS += build/rpmspec.h
81 rpmbindir = `echo $(bindir) | $(SED) -e s,usr/bin,bin,`
84 bin_PROGRAMS = rpm2cpio rpmbuild
87 rpmconfig_SCRIPTS = find-provides find-requires mkinstalldirs \
88 config.guess config.sub
89 DISTCLEANFILES = find-provides
90 DISTCLEANFILES += find-requires
92 rpm_SOURCES = rpmqv.c debug.h system.h
93 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
94 rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
95 rpm_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
97 rpmbuild_SOURCES = build.c rpmqv.c build.h debug.h system.h
98 rpmbuild_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMBT
99 rpmbuild_LDADD = build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
100 rpmbuild_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
102 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
103 rpm2cpio_LDADD = lib/librpm.la rpmio/librpmio.la
104 rpm2cpio_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
109 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
111 rpmlibexec_PROGRAMS += debugedit
112 debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
113 debugedit_LDADD = rpmio/librpmio.la
114 debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
118 rpmlibexec_PROGRAMS += javadeps
119 javadeps_SOURCES = tools/javadeps.c
122 rpmlibexec_PROGRAMS += rpmdeps
123 rpmdeps_SOURCES = tools/rpmdeps.c
124 rpmdeps_LDADD = build/librpmbuild.la
126 bin_PROGRAMS += rpmgraph
127 rpmgraph_SOURCES = tools/rpmgraph.c
128 rpmgraph_LDADD = lib/librpm.la
130 dist_bin_SCRIPTS = scripts/gendiff
132 check_PROGRAMS = dumpdb
133 dumpdb_SOURCES = tools/dumpdb.c
134 dumpdb_LDADD = lib/librpm.la
136 check_PROGRAMS += convertdb1
137 convertdb1_SOURCES = tools/convertdb1.c
138 convertdb1_LDADD = lib/librpm.la
140 check_PROGRAMS += rpminject
141 rpminject_SOURCES = tools/rpminject.c
142 rpminject_LDADD = build/librpmbuild.la
144 check_PROGRAMS += rpmsort
145 rpmsort_SOURCES = tools/rpmsort.c
146 rpmsort_LDADD = lib/librpm.la
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
160 -e "s,[@]varprefix[@],$(localstatedir),g" \
161 < $(top_srcdir)/macros.in > macros.tmp \
162 && ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.tmp )
163 CLEANFILES += macros.tmp macros
164 EXTRA_DIST += macros.in
166 noinst_DATA = platform
167 platform: $(top_srcdir)/platform.in
169 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
170 < $(top_srcdir)/platform.in > platform.tmp \
171 && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
172 CLEANFILES += platform.tmp platform
173 EXTRA_DIST += platform.in
175 pkgconfig_DATA = rpm.pc
176 rpm.pc: $(top_srcdir)/rpm.pc.in
178 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
179 < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
180 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
181 CLEANFILES += rpm.pc.tmp rpm.pc
182 EXTRA_DIST += rpm.pc.in
184 rpmconfig_DATA += rpmpopt-$(VERSION)
185 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
187 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
188 < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
189 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
190 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
191 EXTRA_DIST += rpmpopt.in
193 usrsrcdir = $(prefix)/src
195 rpmvardir = $(localstatedir)/lib/rpm
199 rm -f $(DESTDIR)$(bindir)/rpmquery
200 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmquery
201 rm -f $(DESTDIR)$(bindir)/rpmverify
202 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmverify
203 rm -f $(DESTDIR)$(bindir)/rpmsign
204 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmsign
205 rm -f $(DESTDIR)$(bindir)/rpmdb
206 @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmdb
209 @case "@host_os@" in \
210 solaris*|linux*|darwin*) \
211 DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
213 @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
215 # XXX to appease distcheck we need to remove "stuff" here...
217 @rm -f $(DESTDIR)$(bindir)/rpmquery
218 @rm -f $(DESTDIR)$(bindir)/rpmsign
219 @rm -f $(DESTDIR)$(bindir)/rpmverify
220 @rm -f $(DESTDIR)$(bindir)/rpmdb
222 MAINTAINERCLEANFILES = ChangeLog
224 # Build hacking docs only on request
227 doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
229 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
230 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
231 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
232 -e "s,[@]VERSION[@],$(VERSION)," \
233 < $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
235 doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
236 @DOXYGEN@ doc/hacking.doxy
237 noinst_DATA += doc/hacking/html/index.html
240 EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
242 # Always build librpm docs
244 doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS)
245 files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
246 $(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
247 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
248 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
249 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
250 -e "s,[@]VERSION[@],$(VERSION)," \
251 < $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
253 doc/librpm/html/index.html: doc/librpm.doxy
254 @DOXYGEN@ doc/librpm.doxy
255 noinst_DATA += doc/librpm/html/index.html
257 EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
258 EXTRA_DIST += doc/librpm/html
261 db.h: $(top_builddir)/db3/db.h
262 $(LN_S) $(top_builddir)/db3/db.h $@
263 BUILT_SOURCES += db.h
265 DISTCLEANFILES += db.h
268 rm -rf doc/hacking/html
273 rm -f stamp-h.in db3/*.orig db3/db3lobjs
275 maintainer-clean-local:
276 rm -rf doc/librpm/html
278 $(top_srcdir)/preinstall.am: Makefile.am
279 rm -f $(top_srcdir)/preinstall.am
280 @for f in $(HEADERS); do \
282 echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
283 echo ' $$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
284 echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
285 echo 'CLEANFILES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
288 include/rpm/$(dirstamp):
289 @$(MKDIR_P) include/rpm
290 @: > include/rpm/$(dirstamp)
292 include $(top_srcdir)/preinstall.am