Remove superfluous ";" breaking directory creation.
[platform/upstream/rpm.git] / Makefile.am
1 # Top level Makefile for rpm
2
3 include $(top_srcdir)/rpm.am
4
5 CLEANFILES =
6 EXTRA_DIST = CHANGES ChangeLog CREDITS Doxyheader GROUPS INSTALL \
7         autodeps autogen.sh \
8         db db3/configure installplatform platform* 
9
10 SUBDIRS = po misc @WITH_DB_SUBDIR@ lua rpmio rpmdb lib build python tools scripts doc . tests
11
12 pkgconfigdir = $(libdir)/pkgconfig
13 pkgconfig_DATA = rpm.pc
14
15 AM_CPPFLAGS = \
16         -I$(top_srcdir)/build \
17         -I$(top_srcdir)/lib \
18         -I$(top_srcdir)/rpmdb \
19         -I$(top_srcdir)/rpmio \
20         @WITH_BEECRYPT_INCLUDE@ \
21         @WITH_POPT_INCLUDE@ \
22         -I$(top_srcdir)/misc \
23         @WITH_LIBELF_INCLUDE@
24 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
25 AM_CPPFLAGS += -DRPMCONFIGDIR="\"@RPMCONFIGDIR@\""
26 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"@RPMCONFIGDIR@/rpmpopt-${VERSION}\""
27
28 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
29
30 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
31 rpmbin_PROGRAMS = rpm
32
33 bin_PROGRAMS =          rpm2cpio
34
35 rpmlibexec_PROGRAMS =   rpmb rpmd rpmi rpmk rpmq
36 rpmconfig_DATA =        rpmrc rpmpopt-$(VERSION) macros
37 rpmconfig_SCRIPTS =     find-provides find-requires mkinstalldirs \
38                         config.guess config.sub
39
40 rpm_SOURCES =           rpmqv.c debug.h system.h
41 rpm_CPPFLAGS =          $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
42 rpm_LDFLAGS =           @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
43 rpm_LDADD =             build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
44
45 rpmb_SOURCES =          build.c rpmqv.c build.h debug.h system.h
46 rpmb_CPPFLAGS =         $(AM_CPPFLAGS) -DIAM_RPMBT
47 rpmb_LDFLAGS =          @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
48 rpmb_LDADD =            build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
49
50 rpmd_SOURCES =          rpmqv.c debug.h system.h
51 rpmd_CPPFLAGS =         $(AM_CPPFLAGS) -DIAM_RPMDB
52 rpmd_LDFLAGS =          @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
53 rpmd_LDADD =            lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
54
55 rpmi_SOURCES =          rpmqv.c debug.h system.h
56 rpmi_CPPFLAGS =         $(AM_CPPFLAGS) -DIAM_RPMEIU
57 #rpmi_LDFLAGS =         @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ $(staticLDFLAGS)
58 rpmi_LDFLAGS =          @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
59 rpmi_LDADD =            lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
60
61 rpmk_SOURCES =          rpmqv.c debug.h system.h
62 rpmk_CPPFLAGS =         $(AM_CPPFLAGS) -DIAM_RPMK
63 rpmk_LDFLAGS =          @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
64 rpmk_LDADD =            lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
65
66 rpmq_SOURCES =          rpmqv.c debug.h system.h
67 rpmq_CPPFLAGS =         $(AM_CPPFLAGS) -DIAM_RPMQV
68 rpmq_LDFLAGS =          @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
69 rpmq_LDADD =            build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
70
71 rpm2cpio_SOURCES =      rpm2cpio.c debug.h system.h
72 rpm2cpio_LDFLAGS =      @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
73 rpm2cpio_LDADD =        lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
74
75 rpmrc: $(top_srcdir)/rpmrc.in
76         @sed \
77           -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
78           < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
79           && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
80 CLEANFILES += rpmrc.tmp rpmrc
81 EXTRA_DIST += rpmrc.in
82
83 macros: $(top_srcdir)/macros.in
84         @sed \
85           -e "s,[@]varprefix[@],$(localstatedir),g" \
86           < $(top_srcdir)/macros.in > macros.tmp \
87           && ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.tmp )
88 CLEANFILES += macros.tmp macros
89 EXTRA_DIST += macros.in
90
91 pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR)
92
93 rpmvardir = $(localstatedir)/lib/rpm
94 rpmvar_DATA =
95
96 install-data-local:
97         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
98         @@LN_S@ rpmb $(DESTDIR)$(rpmlibexecdir)/rpmt
99         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
100         @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpme
101         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
102         @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpmu
103         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
104         @@LN_S@ rpmq $(DESTDIR)$(rpmlibexecdir)/rpmv
105         rm -f $(DESTDIR)$(bindir)/rpmbuild
106         @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
107         rm -f $(DESTDIR)$(bindir)/rpmquery
108         @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
109         rm -f $(DESTDIR)$(bindir)/rpmverify
110         @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
111         rm -f $(DESTDIR)$(bindir)/rpmsign
112         @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
113         rm -f $(DESTDIR)$(bindir)/rpmdb ; \
114         @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
115         for bf in e i u ; do \
116             rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
117             @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
118         done
119         @for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\
120             $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/$$dir;\
121         done
122         @case "@host_cpu@" in \
123         *86)    $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\
124                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
125                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
126                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\
127                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
128         alpha*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
129                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
130         arm*)   $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\
131                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\
132                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4tl ;\
133                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;\
134                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tejl ;\
135                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv6l ;;\
136         sparc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
137                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\
138                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
139                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9v ;\
140                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;\
141                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64v ;;\
142         ia64*)  $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
143         s390*)  $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
144         mipsel*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\
145         mips*)  $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\
146         powerpc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;\
147                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppciseries ;\
148                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppcpseries ;\
149                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64 ;\
150                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64iseries ;\
151                 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64pseries ;;\
152         *)      $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
153         esac
154         $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
155         @case "@host_os@" in \
156         mint) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
157         solaris*|linux*|darwin*) \
158            DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
159         esac
160         @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
161
162 # XXX to appease distcheck we need to remove "stuff" here...
163 uninstall-local:
164         @rm -rf $(DESTDIR)/$(pkglibdir)/*-*
165         
166 distclean-local:
167         @rm -rf Doxytags apidocs 
168         @rm -f stamp-h.in db3/*.orig db3/db3lobjs
169         @rm -f ChangeLog
170
171 .PHONY: setperms
172 setperms:
173         @for f in $(rpmbin_PROGRAMS) ; do\
174             $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmbindir)/$$f ;\
175             $(__CHMOD) g+s $(DESTDIR)$(rpmbindir)/$$f ;\
176         done
177         @for f in $(bin_PROGRAMS) ; do\
178             $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(bindir)/$$f ;\
179         done
180         @for f in $(rpmlibexec_PROGRAMS) ; do\
181             $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmlibexecdir)/$$f ;\
182             $(__CHMOD) g+s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
183         done
184         @for f in $(pkglib_SCRIPTS) ; do\
185             $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
186         done
187         @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
188         @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmvardir)
189         -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/[A-Z]*
190         -@$(__CHMOD) 0775 $(DESTDIR)$(rpmvardir)
191         -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/__db.*
192
193 .PHONY: unsetgid
194 unsetgid:
195         @for f in $(rpmbin_PROGRAMS) ; do\
196             $(__CHMOD) g-s $(DESTDIR)$(rpmbindir)/$$f ;\
197         done
198         @for f in $(rpmlibexec_PROGRAMS) ; do\
199             $(__CHMOD) g-s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
200         done
201
202 .PHONY: doxygen
203 doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@
204         rm -rf $@
205         $(MKDIR_P) $@
206         - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
207
208 .PHONY: ChangeLog
209 ChangeLog:
210         hg log --no-merge -v > ChangeLog
211
212 ACLOCAL_AMFLAGS = -I m4