Remove solvedb API and other related stuff
[platform/upstream/rpm.git] / Makefile.am
1 # Top level Makefile for rpm
2
3 ACLOCAL_AMFLAGS = -I m4
4
5 DISTCHECK_CONFIGURE_FLAGS = --with-external-db
6
7 include $(top_srcdir)/rpm.am
8
9 CLEANFILES =
10 EXTRA_DIST = CHANGES ChangeLog CREDITS GROUPS INSTALL \
11         autodeps autogen.sh \
12         db3/configure installplatform platform.in
13 BUILT_SOURCES =
14
15 SUBDIRS = po misc
16 if WITH_INTERNAL_DB
17 SUBDIRS += db3
18 endif
19 if WITH_LUAEXT
20 SUBDIRS += luaext
21 endif
22 SUBDIRS += rpmio lib build python scripts doc . tests
23
24 DIST_SUBDIRS = po misc luaext rpmio lib build python scripts doc tests
25
26 pkgconfigdir = $(libdir)/pkgconfig
27
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}\""
39
40 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
41
42 pkginclude_HEADERS =
43 nodist_pkginclude_HEADERS =
44
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
57
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
75
76 pkginclude_HEADERS += build/rpmbuild.h
77 pkginclude_HEADERS += build/rpmfc.h
78 pkginclude_HEADERS += build/rpmspec.h
79
80
81 rpmbindir = `echo $(bindir) | $(SED) -e s,usr/bin,bin,`
82 rpmbin_PROGRAMS = rpm
83
84 bin_PROGRAMS =          rpm2cpio rpmbuild
85
86 rpmlibexec_PROGRAMS =
87 rpmconfig_SCRIPTS =     find-provides find-requires mkinstalldirs \
88                         config.guess config.sub
89 DISTCLEANFILES = find-provides
90 DISTCLEANFILES += find-requires
91
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@
96
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@
101
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@
105
106
107 if LIBELF
108 if LIBDWARF
109 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
110
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@
115 endif
116 endif
117
118 rpmlibexec_PROGRAMS +=  javadeps
119 javadeps_SOURCES =      tools/javadeps.c
120 javadeps_LDADD =
121
122 rpmlibexec_PROGRAMS +=  rpmdeps
123 rpmdeps_SOURCES =       tools/rpmdeps.c
124 rpmdeps_LDADD =         build/librpmbuild.la
125
126 bin_PROGRAMS +=         rpmgraph
127 rpmgraph_SOURCES =      tools/rpmgraph.c
128 rpmgraph_LDADD =        lib/librpm.la
129
130 dist_bin_SCRIPTS =      scripts/gendiff
131
132 check_PROGRAMS =        dumpdb
133 dumpdb_SOURCES =        tools/dumpdb.c
134 dumpdb_LDADD =          lib/librpm.la
135
136 check_PROGRAMS +=       convertdb1
137 convertdb1_SOURCES =    tools/convertdb1.c
138 convertdb1_LDADD =      lib/librpm.la
139
140 check_PROGRAMS +=       rpminject
141 rpminject_SOURCES =     tools/rpminject.c
142 rpminject_LDADD =       build/librpmbuild.la
143
144 check_PROGRAMS +=       rpmsort
145 rpmsort_SOURCES =       tools/rpmsort.c
146 rpmsort_LDADD =         lib/librpm.la
147
148 rpmconfig_DATA = rpmrc
149 rpmrc: $(top_srcdir)/rpmrc.in
150         @$(SED) \
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
156
157 rpmconfig_DATA += macros
158 macros: $(top_srcdir)/macros.in
159         @$(SED) \
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
165
166 noinst_DATA = platform
167 platform: $(top_srcdir)/platform.in
168         @$(SED) \
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
174
175 pkgconfig_DATA = rpm.pc
176 rpm.pc: $(top_srcdir)/rpm.pc.in
177         @$(SED) \
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
183
184 rpmconfig_DATA += rpmpopt-$(VERSION)
185 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
186         @$(SED) \
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
192
193 usrsrcdir = $(prefix)/src
194
195 rpmvardir = $(localstatedir)/lib/rpm
196 rpmvar_DATA =
197
198 install-exec-hook:
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
207
208 install-data-local:
209         @case "@host_os@" in \
210         solaris*|linux*|darwin*) \
211            DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
212         esac
213         @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
214
215 # XXX to appease distcheck we need to remove "stuff" here...
216 uninstall-local:
217         @rm -f $(DESTDIR)$(bindir)/rpmquery
218         @rm -f $(DESTDIR)$(bindir)/rpmsign
219         @rm -f $(DESTDIR)$(bindir)/rpmverify
220         @rm -f $(DESTDIR)$(bindir)/rpmdb
221
222 MAINTAINERCLEANFILES = ChangeLog
223
224 # Build hacking docs only on request
225 if HACKINGDOCS
226 if DOXYGEN
227 doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
228         $(SED) \
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
234
235 doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
236         @DOXYGEN@ doc/hacking.doxy
237 noinst_DATA += doc/hacking/html/index.html
238 endif
239 endif
240 EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
241
242 # Always build librpm docs
243 if DOXYGEN
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
252
253 doc/librpm/html/index.html: doc/librpm.doxy
254         @DOXYGEN@ doc/librpm.doxy
255 noinst_DATA += doc/librpm/html/index.html
256 endif
257 EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
258 EXTRA_DIST += doc/librpm/html
259
260 if WITH_INTERNAL_DB
261 db.h:   $(top_builddir)/db3/db.h
262         $(LN_S) $(top_builddir)/db3/db.h $@
263 BUILT_SOURCES += db.h
264 endif
265 DISTCLEANFILES += db.h
266
267 clean-local:
268         rm -rf doc/hacking/html
269         rm -rf include
270
271 distclean-local:
272         rm -rf Doxytags
273         rm -f stamp-h.in db3/*.orig db3/db3lobjs
274
275 maintainer-clean-local:
276         rm -rf doc/librpm/html
277
278 $(top_srcdir)/preinstall.am: Makefile.am
279         rm -f $(top_srcdir)/preinstall.am
280         @for f in $(HEADERS); do \
281           b=`basename $$f`; \
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; \
286          done
287
288 include/rpm/$(dirstamp):
289         @$(MKDIR_P) include/rpm
290         @: > include/rpm/$(dirstamp)
291
292 include $(top_srcdir)/preinstall.am