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
54 pkginclude_HEADERS += rpmdb/header.h
55 pkginclude_HEADERS += rpmdb/rpmdb.h
56 nodist_pkginclude_HEADERS += rpmdb/rpmints.h
58 pkginclude_HEADERS += lib/idtx.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
71 pkginclude_HEADERS += build/rpmbuild.h
72 pkginclude_HEADERS += build/rpmfc.h
73 pkginclude_HEADERS += build/rpmspec.h
76 rpmbindir = `echo $(bindir) | $(SED) -e s,usr/bin,bin,`
79 bin_PROGRAMS = rpm2cpio
81 rpmlibexec_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
82 rpmconfig_SCRIPTS = find-provides find-requires mkinstalldirs \
83 config.guess config.sub
84 DISTCLEANFILES = find-provides
85 DISTCLEANFILES += find-requires
87 rpm_SOURCES = rpmqv.c debug.h system.h
88 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
89 rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
90 rpm_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
92 rpmb_SOURCES = build.c rpmqv.c build.h debug.h system.h
93 rpmb_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMBT
94 rpmb_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
95 rpmb_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
97 rpmd_SOURCES = rpmqv.c debug.h system.h
98 rpmd_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB
99 rpmd_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
100 rpmd_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
102 rpmi_SOURCES = rpmqv.c debug.h system.h
103 rpmi_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMEIU
104 rpmi_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
105 rpmi_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
107 rpmk_SOURCES = rpmqv.c debug.h system.h
108 rpmk_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMK
109 rpmk_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
110 rpmk_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
112 rpmq_SOURCES = rpmqv.c debug.h system.h
113 rpmq_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMQV
114 rpmq_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
115 rpmq_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
117 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
118 rpm2cpio_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
119 rpm2cpio_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
124 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
126 rpmlibexec_PROGRAMS += debugedit
127 debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
128 debugedit_LDADD = rpmio/librpmio.la
129 debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
133 rpmlibexec_PROGRAMS += javadeps
134 javadeps_SOURCES = tools/javadeps.c
137 rpmlibexec_PROGRAMS += rpmcache
138 rpmcache_SOURCES = tools/rpmcache.c
139 rpmcache_LDADD = lib/librpm.la
141 rpmlibexec_PROGRAMS += rpmdeps
142 rpmdeps_SOURCES = tools/rpmdeps.c
143 rpmdeps_LDADD = build/librpmbuild.la
145 bin_PROGRAMS += rpmgraph
146 rpmgraph_SOURCES = tools/rpmgraph.c
147 rpmgraph_LDADD = lib/librpm.la
149 dist_bin_SCRIPTS = scripts/gendiff
151 check_PROGRAMS = dumpdb
152 dumpdb_SOURCES = tools/dumpdb.c
153 dumpdb_LDADD = lib/librpm.la
155 check_PROGRAMS += convertdb1
156 convertdb1_SOURCES = tools/convertdb1.c
157 convertdb1_LDADD = lib/librpm.la
159 check_PROGRAMS += rpminject
160 rpminject_SOURCES = tools/rpminject.c
161 rpminject_LDADD = build/librpmbuild.la
163 check_PROGRAMS += rpmsort
164 rpmsort_SOURCES = tools/rpmsort.c
165 rpmsort_LDADD = lib/librpm.la
167 rpmconfig_DATA = rpmrc
168 rpmrc: $(top_srcdir)/rpmrc.in
170 -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
171 < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
172 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
173 CLEANFILES += rpmrc.tmp rpmrc
174 EXTRA_DIST += rpmrc.in
176 rpmconfig_DATA += macros
177 macros: $(top_srcdir)/macros.in
179 -e "s,[@]varprefix[@],$(localstatedir),g" \
180 < $(top_srcdir)/macros.in > macros.tmp \
181 && ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.tmp )
182 CLEANFILES += macros.tmp macros
183 EXTRA_DIST += macros.in
185 noinst_DATA = platform
186 platform: $(top_srcdir)/platform.in
188 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
189 < $(top_srcdir)/platform.in > platform.tmp \
190 && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
191 CLEANFILES += platform.tmp platform
192 EXTRA_DIST += platform.in
194 pkgconfig_DATA = rpm.pc
195 rpm.pc: $(top_srcdir)/rpm.pc.in
197 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
198 < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
199 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
200 CLEANFILES += rpm.pc.tmp rpm.pc
201 EXTRA_DIST += rpm.pc.in
203 rpmconfig_DATA += rpmpopt-$(VERSION)
204 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
206 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
207 < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
208 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
209 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
210 EXTRA_DIST += rpmpopt.in
212 usrsrcdir = $(prefix)/src
214 pkgsrcdir = $(usrsrcdir)/packages
215 pkgsrc_RPMSdir = $(pkgsrcdir)/RPMS
217 pkgsrc_SRPMSdir = $(pkgsrcdir)/SRPMS
219 pkgsrc_SPECSdir = $(pkgsrcdir)/SPECS
221 pkgsrc_SOURCESdir = $(pkgsrcdir)/SOURCES
222 pkgsrc_SOURCES_DATA =
223 pkgsrc_BUILDdir = $(pkgsrcdir)/BUILD
226 rpmvardir = $(localstatedir)/lib/rpm
230 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
231 @@LN_S@ rpmb $(DESTDIR)$(rpmlibexecdir)/rpmt
232 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
233 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpme
234 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
235 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpmu
236 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
237 @@LN_S@ rpmq $(DESTDIR)$(rpmlibexecdir)/rpmv
238 rm -f $(DESTDIR)$(bindir)/rpmbuild
239 @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
240 rm -f $(DESTDIR)$(bindir)/rpmquery
241 @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
242 rm -f $(DESTDIR)$(bindir)/rpmverify
243 @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
244 rm -f $(DESTDIR)$(bindir)/rpmsign
245 @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
246 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
247 @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
248 for bf in e i u ; do \
249 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
250 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
254 @case "@host_cpu@" in \
255 *86) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\
256 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
257 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
258 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\
259 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;\
260 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/geode ;;\
261 alpha*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
262 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
263 arm*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\
264 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\
265 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4tl ;\
266 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;\
267 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tejl ;\
268 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv6l ;;\
269 sparc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
270 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\
271 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
272 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9v ;\
273 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;\
274 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64v ;;\
275 ia64*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
276 s390*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
277 mipsel*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\
278 mips*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\
279 powerpc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;\
280 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppciseries ;\
281 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppcpseries ;\
282 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64 ;\
283 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64iseries ;\
284 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64pseries ;;\
285 *) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
287 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
288 @case "@host_os@" in \
289 mint) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
290 solaris*|linux*|darwin*) \
291 DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
293 @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
295 # XXX to appease distcheck we need to remove "stuff" here...
297 @rm -rf $(DESTDIR)/$(rpmconfigdir)/*-*
298 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
299 rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
300 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
301 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
302 rm -f $(DESTDIR)$(bindir)/rpmquery
303 rm -f $(DESTDIR)$(bindir)/rpmbuild
304 rm -f $(DESTDIR)$(bindir)/rpmu
305 rm -f $(DESTDIR)$(bindir)/rpmsign
306 rm -f $(DESTDIR)$(bindir)/rpme
307 rm -f $(DESTDIR)$(bindir)/rpmverify
308 rm -f $(DESTDIR)$(bindir)/rpmdb
309 rm -f $(DESTDIR)$(bindir)/rpmi
311 MAINTAINERCLEANFILES = ChangeLog
315 @for f in $(rpmbin_PROGRAMS) ; do\
316 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmbindir)/$$f ;\
317 $(__CHMOD) g+s $(DESTDIR)$(rpmbindir)/$$f ;\
319 @for f in $(bin_PROGRAMS) ; do\
320 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(bindir)/$$f ;\
322 @for f in $(rpmlibexec_PROGRAMS) ; do\
323 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmlibexecdir)/$$f ;\
324 $(__CHMOD) g+s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
326 @for f in $(pkglib_SCRIPTS) ; do\
327 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
329 @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
330 @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmvardir)
331 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/[A-Z]*
332 -@$(__CHMOD) 0775 $(DESTDIR)$(rpmvardir)
333 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/__db.*
337 @for f in $(rpmbin_PROGRAMS) ; do\
338 $(__CHMOD) g-s $(DESTDIR)$(rpmbindir)/$$f ;\
340 @for f in $(rpmlibexec_PROGRAMS) ; do\
341 $(__CHMOD) g-s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
344 # Build hacking docs only on request
347 doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
349 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
350 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
351 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
352 -e "s,[@]VERSION[@],$(VERSION)," \
353 < $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
355 doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
356 @DOXYGEN@ doc/hacking.doxy
357 noinst_DATA += doc/hacking/html/index.html
360 EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
362 # Always build librpm docs
364 doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS)
365 files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
366 $(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
367 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
368 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
369 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
370 -e "s,[@]VERSION[@],$(VERSION)," \
371 < $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
373 doc/librpm/html/index.html: doc/librpm.doxy
374 @DOXYGEN@ doc/librpm.doxy
375 noinst_DATA += doc/librpm/html/index.html
377 EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
378 EXTRA_DIST += doc/librpm/html
381 db.h: $(top_builddir)/db3/db.h
382 $(LN_S) $(top_builddir)/db3/db.h $@
383 BUILT_SOURCES += db.h
385 DISTCLEANFILES += db.h
388 rm -rf doc/hacking/html
393 rm -f stamp-h.in db3/*.orig db3/db3lobjs
395 maintainer-clean-local:
396 rm -rf doc/librpm/html
398 $(top_srcdir)/preinstall.am: Makefile.am
399 rm -f $(top_srcdir)/preinstall.am
400 @for f in $(HEADERS); do \
402 echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
403 echo ' $$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
404 echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
405 echo 'CLEANFILES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
408 include/rpm/$(dirstamp):
409 @$(MKDIR_P) include/rpm
410 @: > include/rpm/$(dirstamp)
412 include $(top_srcdir)/preinstall.am