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
19 SUBDIRS += lua rpmio rpmdb lib build python scripts doc . tests
21 DIST_SUBDIRS = po misc lua rpmio rpmdb lib build python scripts doc tests
23 pkgconfigdir = $(libdir)/pkgconfig
25 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
26 AM_CPPFLAGS += -I$(top_srcdir)/build
27 AM_CPPFLAGS += -I$(top_srcdir)/lib
28 AM_CPPFLAGS += -I$(top_builddir)/rpmdb -I$(top_srcdir)/rpmdb
29 AM_CPPFLAGS += -I$(top_srcdir)/rpmio
30 AM_CPPFLAGS += @WITH_NSS_INCLUDE@
31 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
32 AM_CPPFLAGS += -I$(top_srcdir)/misc
33 AM_CPPFLAGS += @WITH_LIBELF_INCLUDE@
34 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
35 AM_CPPFLAGS += -DRPMCONFIGDIR="\"@RPMCONFIGDIR@\""
36 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"@RPMCONFIGDIR@/rpmpopt-${VERSION}\""
38 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
41 nodist_pkginclude_HEADERS =
43 pkginclude_HEADERS += rpmio/argv.h
44 pkginclude_HEADERS += rpmio/rpmio.h
45 pkginclude_HEADERS += rpmio/rpmurl.h
46 pkginclude_HEADERS += rpmio/rpmmacro.h
47 pkginclude_HEADERS += rpmio/rpmlog.h
48 pkginclude_HEADERS += rpmio/rpmpgp.h
49 pkginclude_HEADERS += rpmio/rpmsq.h
50 pkginclude_HEADERS += rpmio/rpmstring.h
51 pkginclude_HEADERS += rpmio/rpmsw.h
52 pkginclude_HEADERS += rpmio/rpmfileutil.h
53 pkginclude_HEADERS += rpmio/rpmutil.h
55 pkginclude_HEADERS += rpmdb/header.h
56 pkginclude_HEADERS += rpmdb/rpmdb.h
57 nodist_pkginclude_HEADERS += rpmdb/rpmints.h
59 pkginclude_HEADERS += lib/rpmcallback.h
60 pkginclude_HEADERS += lib/rpmcli.h
61 pkginclude_HEADERS += lib/rpmlib.h
62 pkginclude_HEADERS += lib/rpmal.h
63 pkginclude_HEADERS += lib/rpmds.h
64 pkginclude_HEADERS += lib/rpmfi.h
65 pkginclude_HEADERS += lib/rpmgi.h
66 pkginclude_HEADERS += lib/rpmps.h
67 pkginclude_HEADERS += lib/rpmtag.h
68 pkginclude_HEADERS += lib/rpmte.h
69 pkginclude_HEADERS += lib/rpmts.h
70 pkginclude_HEADERS += lib/rpmtypes.h
71 pkginclude_HEADERS += lib/rpmvf.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
83 rpmlibexec_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
84 rpmconfig_SCRIPTS = find-provides find-requires mkinstalldirs \
85 config.guess config.sub
86 DISTCLEANFILES = find-provides
87 DISTCLEANFILES += find-requires
89 rpm_SOURCES = rpmqv.c debug.h system.h
90 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
91 rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
92 rpm_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
94 rpmb_SOURCES = build.c rpmqv.c build.h debug.h system.h
95 rpmb_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMBT
96 rpmb_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
97 rpmb_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
99 rpmd_SOURCES = rpmqv.c debug.h system.h
100 rpmd_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB
101 rpmd_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
102 rpmd_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
104 rpmi_SOURCES = rpmqv.c debug.h system.h
105 rpmi_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMEIU
106 rpmi_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
107 rpmi_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
109 rpmk_SOURCES = rpmqv.c debug.h system.h
110 rpmk_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMK
111 rpmk_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
112 rpmk_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
114 rpmq_SOURCES = rpmqv.c debug.h system.h
115 rpmq_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMQV
116 rpmq_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
117 rpmq_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
119 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
120 rpm2cpio_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
121 rpm2cpio_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
126 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
128 rpmlibexec_PROGRAMS += debugedit
129 debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
130 debugedit_LDADD = rpmio/librpmio.la
131 debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
135 rpmlibexec_PROGRAMS += javadeps
136 javadeps_SOURCES = tools/javadeps.c
139 rpmlibexec_PROGRAMS += rpmcache
140 rpmcache_SOURCES = tools/rpmcache.c
141 rpmcache_LDADD = lib/librpm.la
143 rpmlibexec_PROGRAMS += rpmdeps
144 rpmdeps_SOURCES = tools/rpmdeps.c
145 rpmdeps_LDADD = build/librpmbuild.la
147 bin_PROGRAMS += rpmgraph
148 rpmgraph_SOURCES = tools/rpmgraph.c
149 rpmgraph_LDADD = lib/librpm.la
151 dist_bin_SCRIPTS = scripts/gendiff
153 check_PROGRAMS = dumpdb
154 dumpdb_SOURCES = tools/dumpdb.c
155 dumpdb_LDADD = lib/librpm.la
157 check_PROGRAMS += convertdb1
158 convertdb1_SOURCES = tools/convertdb1.c
159 convertdb1_LDADD = lib/librpm.la
161 check_PROGRAMS += rpminject
162 rpminject_SOURCES = tools/rpminject.c
163 rpminject_LDADD = build/librpmbuild.la
165 check_PROGRAMS += rpmsort
166 rpmsort_SOURCES = tools/rpmsort.c
167 rpmsort_LDADD = lib/librpm.la
169 rpmconfig_DATA = rpmrc
170 rpmrc: $(top_srcdir)/rpmrc.in
172 -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
173 < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
174 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
175 CLEANFILES += rpmrc.tmp rpmrc
176 EXTRA_DIST += rpmrc.in
178 rpmconfig_DATA += macros
179 macros: $(top_srcdir)/macros.in
181 -e "s,[@]varprefix[@],$(localstatedir),g" \
182 < $(top_srcdir)/macros.in > macros.tmp \
183 && ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.tmp )
184 CLEANFILES += macros.tmp macros
185 EXTRA_DIST += macros.in
187 noinst_DATA = platform
188 platform: $(top_srcdir)/platform.in
190 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
191 < $(top_srcdir)/platform.in > platform.tmp \
192 && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
193 CLEANFILES += platform.tmp platform
194 EXTRA_DIST += platform.in
196 pkgconfig_DATA = rpm.pc
197 rpm.pc: $(top_srcdir)/rpm.pc.in
199 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
200 < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
201 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
202 CLEANFILES += rpm.pc.tmp rpm.pc
203 EXTRA_DIST += rpm.pc.in
205 rpmconfig_DATA += rpmpopt-$(VERSION)
206 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
208 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
209 < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
210 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
211 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
212 EXTRA_DIST += rpmpopt.in
214 usrsrcdir = $(prefix)/src
216 rpmvardir = $(localstatedir)/lib/rpm
220 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
221 @@LN_S@ rpmb $(DESTDIR)$(rpmlibexecdir)/rpmt
222 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
223 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpme
224 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
225 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpmu
226 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
227 @@LN_S@ rpmq $(DESTDIR)$(rpmlibexecdir)/rpmv
228 rm -f $(DESTDIR)$(bindir)/rpmbuild
229 @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
230 rm -f $(DESTDIR)$(bindir)/rpmquery
231 @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
232 rm -f $(DESTDIR)$(bindir)/rpmverify
233 @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
234 rm -f $(DESTDIR)$(bindir)/rpmsign
235 @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
236 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
237 @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
238 for bf in e i u ; do \
239 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
240 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
244 @case "@host_os@" in \
245 solaris*|linux*|darwin*) \
246 DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
248 @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
250 # XXX to appease distcheck we need to remove "stuff" here...
252 @rm -rf $(DESTDIR)/$(rpmconfigdir)/platform
253 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
254 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
255 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
256 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
257 @rm -f $(DESTDIR)$(bindir)/rpmquery
258 @rm -f $(DESTDIR)$(bindir)/rpmbuild
259 @rm -f $(DESTDIR)$(bindir)/rpmu
260 @rm -f $(DESTDIR)$(bindir)/rpmsign
261 @rm -f $(DESTDIR)$(bindir)/rpme
262 @rm -f $(DESTDIR)$(bindir)/rpmverify
263 @rm -f $(DESTDIR)$(bindir)/rpmdb
264 @rm -f $(DESTDIR)$(bindir)/rpmi
266 MAINTAINERCLEANFILES = ChangeLog
268 # Build hacking docs only on request
271 doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
273 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
274 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
275 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
276 -e "s,[@]VERSION[@],$(VERSION)," \
277 < $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
279 doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
280 @DOXYGEN@ doc/hacking.doxy
281 noinst_DATA += doc/hacking/html/index.html
284 EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
286 # Always build librpm docs
288 doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS)
289 files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
290 $(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
291 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
292 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
293 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
294 -e "s,[@]VERSION[@],$(VERSION)," \
295 < $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
297 doc/librpm/html/index.html: doc/librpm.doxy
298 @DOXYGEN@ doc/librpm.doxy
299 noinst_DATA += doc/librpm/html/index.html
301 EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
302 EXTRA_DIST += doc/librpm/html
305 db.h: $(top_builddir)/db3/db.h
306 $(LN_S) $(top_builddir)/db3/db.h $@
307 BUILT_SOURCES += db.h
309 DISTCLEANFILES += db.h
312 rm -rf doc/hacking/html
317 rm -f stamp-h.in db3/*.orig db3/db3lobjs
319 maintainer-clean-local:
320 rm -rf doc/librpm/html
322 $(top_srcdir)/preinstall.am: Makefile.am
323 rm -f $(top_srcdir)/preinstall.am
324 @for f in $(HEADERS); do \
326 echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
327 echo ' $$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
328 echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
329 echo 'CLEANFILES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
332 include/rpm/$(dirstamp):
333 @$(MKDIR_P) include/rpm
334 @: > include/rpm/$(dirstamp)
336 include $(top_srcdir)/preinstall.am