Eliminate generated files.
[platform/upstream/rpm.git] / Makefile.am
1 # Top level Makefile for rpm
2
3 AUTOMAKE_OPTIONS = 1.4 foreign
4
5 EXTRA_DIST = CHANGES CREDITS README.amiga RPM-PGP-KEY \
6         autodeps/none autodeps/*.prov autodeps/*.req autogen.sh \
7         docs/[a-z]* gendiff groups $(man_MANS) po/*.in po/*.po po/rpm.pot \
8         rpm.magic rpmpopt rpm.spec rpm.8ru rpm2cpio.8ru
9
10 SUBDIRS = popt build lib po intl misc tools scripts tests .
11
12 INCLUDES = -I$(top_srcdir)/build -I$(top_srcdir)/lib -I$(top_srcdir)/intl @INCPATH@
13
14 mylibs= $(top_builddir)/build/librpmbuild.la \
15         $(top_builddir)/lib/librpm.la \
16         $(top_builddir)/popt/libpopt.la
17
18 LDFLAGS = @LDFLAGS_STATIC@
19
20 rpmbindir = $(subst usr/bin,bin,$(bindir))
21 rpmbin_PROGRAMS = rpm
22
23 bin_PROGRAMS =          rpm2cpio
24 bin_SCRIPTS =           gendiff
25 noinst_PROGRAMS =       rpmconvert
26
27 man_MANS = rpm.8 rpm2cpio.8     # rpm.8ru rpm2cpio.8ru
28
29 configdir = @RPMCONFIGDIR@
30 config_DATA = rpmrc rpmpopt macros
31 config_SCRIPTS = find-provides find-requires mkinstalldirs
32
33 noinst_HEADERS = \
34         acconfig.h      build.h         checksig.h      ftp.h   \
35         install.h       system.h        url.h   \
36         verify.h
37
38 rpm_SOURCES =           build.c checksig.c ftp.c install.c rpm.c url.c \
39                         verify.c
40 rpm_LDADD =             $(mylibs) @LIBMISC@
41
42 $(PROGRAMS):            $(mylibs) @LIBMISC@
43
44 .PHONY: lclint
45 lclint:
46         lclint ${DEFS} ${INCLUDES} ${rpm_SOURCES}
47
48 CVSTAG = r$(subst .,-,$(VERSION))
49
50 rpm2cpio_SOURCES =      rpm2cpio.c
51 rpm2cpio_LDADD =        $(mylibs)
52
53 rpmconvert_SOURCES =    convertdb.c oldrpmdb.c
54 rpmconvert_LDADD =      $(mylibs) -lgdbm
55
56 install-data-local:
57         @$(mkinstalldirs) $(DESTDIR)/var/lib/rpm
58         @rm -f $(DESTDIR)/$(libdir)/rpmrc
59         @ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc
60         @rm -f $(DESTDIR)/$(libdir)/rpmpopt
61         @ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
62         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
63         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch
64         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@
65         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES
66         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS
67         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS
68         @$(mkinstalldirs) $(DESTDIR)/var/lib/rpm
69         @$(mkinstalldirs) $(DESTDIR)/var/tmp
70
71 # FIXME: these should be generated in configure.in
72 find-requires: find-requires.sh
73         cp $< $@
74 find-provides: find-provides.sh
75         cp $< $@
76 rpmrc: lib-rpmrc
77         cp $< $@
78
79 # FIXME: these should be checked
80 .PHONY:                tar
81 tar:
82         rm -rf /tmp/rpm-$(VERSION)
83         make installprefix=/tmp/rpm-$(VERSION)$(ROOT) install
84         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SOURCES
85         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SPECS
86         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SRPMS
87         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/RPMS
88         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/BUILD
89         $(mkinstalldirs) /tmp/rpm-$(VERSION)/var/local/lib/rpm
90         $(mkinstalldirs) /tmp/rpm-$(VERSION)/var/tmp
91 #       Couldn't figure de ARCH value   
92 #       $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/RPMS/i386
93         cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
94
95 .PHONY: noconfig
96 noconfig:
97         find . -name "Makefile" -exec rm {} \; 
98         rm -f *gz *rpm config.*
99
100 .PHONY: archive
101 archive: 
102         @echo " "
103         @echo "I hope you checked everything out and made sure it builds"
104         @echo "maybe someday Erik will get around to making that automatic."
105         @echo
106         @echo "This is version $(VERSION)."
107         @sleep 5
108         @cvs -Q tag -F $(CVSTAG) .
109         @rm -rf /tmp/rpm-$(VERSION) /tmp/rpm
110         @cd /tmp; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) rpm || :
111         @mv /tmp/rpm /tmp/rpm-$(VERSION)
112         @rm /tmp/rpm-$(VERSION)/popt/popt.spec
113         @cd /tmp/rpm-$(VERSION); ./autogen.sh
114         @make -C /tmp/rpm-$(VERSION) distclean
115         @cd /tmp/rpm-$(VERSION); ./autogen.sh --noconfigure
116         @cd /tmp; tar czSpf rpm-$(VERSION).tar.gz rpm-$(VERSION)
117         @rm -rf /tmp/rpm-$(VERSION)
118         @cp /tmp/rpm-$(VERSION).tar.gz .
119         @rm -f /tmp/rpm-$(VERSION).tar.gz 
120         @echo " "
121         @echo "The final archive is ./rpm-$(VERSION).tar.gz."