rpm/Makefile.in

223 lines
7.4 KiB
Makefile

include Makefile.inc
srcdir= @srcdir@
VPATH = @srcdir@
top_srcdir= @top_srcdir@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
INSTALL= @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
#LIBEFENCE = -lefence
#DEBUG = -g
installprefix=$(ROOT)
#LIBEFENCE = -lefence
CVSTAG = r$(subst .,-,$(VERSION))
################################### Leave this stuff alone
### These are variables meant to be exported
BINDIR=$(prefix)/bin
RPMBINDIR=$(subst usr/bin,bin,$(BINDIR))
MANDIR=$(prefix)/man/man8
LIBDIR=$(libdir)
INCDIR=$(prefix)/include/rpm
ETCDIR=$(ROOT)/etc
# -----------------------------------------------------------------------
SUBDIRS = popt @MISCDIR@ lib build tools @PO@
ALLSUBDIRS = popt misc lib build tools po
INSTSUBDIRS = lib scripts @PO@
OTHERSUBDIRS = docs autodeps
OBJS = rpm.o query.o install.o verify.o checksig.o ftp.o url.o build.o \
@GETTEXTSTUB@
PROGS = @RPM@ rpm2cpio
LIBS = @LIBS@ @LIBINTL@ @LIBDL@ $(LIBEFENCE)
LOADLIBES = -lrpmbuild -lpopt -lrpm @LIBMISC@
LDFLAGS_STATIC = @LDFLAGS_STATIC@
SOURCES = $(subst .o,.c,$(OBJS))
ifeq (.depend-done,$(wildcard .depend-done))
TARGET=everything
else
TARGET=@TARGET@
endif
all: $(TARGET)
rpm: lib/librpm.a build/librpmbuild.a @MISCPATH@ $(OBJS)
$(CC) -o rpm $(LDFLAGS_STATIC) $(OBJS) $(LDFLAGS) $(LOADLIBES) $(LIBS)
rpm.shared: lib/librpm.a build/librpmbuild.a $(OBJS)
$(CC) -o rpm.shared $(LDFLAGS) $(OBJS) $(LOADLIBES) $(LIBS)
# we don't normally build this, so ./configure doesn't try very hard
# to make it work
rpmconvert: lib/librpm.a convertdb.o oldrpmdb.o
$(CC) -o rpmconvert $(LDFLAGS) convertdb.o oldrpmdb.o -lgdbm \
$(LOADLIBES) $(LIBS)
rpm2cpio: lib/librpm.a rpm2cpio.o
$(CC) -o rpm2cpio $(LDFLAGS) rpm2cpio.o $(LOADLIBES) $(LIBS)
rpm.o: rpm.c query.h install.h lib/rpmlib.h Makefile
$(CC) $(CFLAGS) -DRPMNLSPACKAGE=\"$(RPMNLSPACKAGE)\" \
-DRPMNLSDIR=\"$(RPMNLSDIR)\" \
-DVERSION=\"$(VERSION)\" \
-DLIBRPMALIAS_FILENAME="\"$(LIBRPMALIAS_FILENAME)"\" \
-DRPMCONFIGDIR="\"$(RPMCONFIGDIR)"\" \
-c $(srcdir)/rpm.c
# these rules should be in here, but they drive me batty
#Makefile: Makefile.in misc/Makefile.in lib/Makefile.in build/Makefile.in \
#tools/Makefile.in po/Makefile.in config.status
#sh ./config.status
#config.status: configure
#sh ./config.status --recheck
#configure: configure.in
#cd $(srcdir); autoconf
everything: make-subdirs $(PROGS)
make-subdirs:
for d in $(SUBDIRS); do \
(cd $$d; $(MAKE)) \
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac;\
done && test -z "$$fail"
newtree:
rm -f RCS
ln -s /usr/rhs/RCS/rpm-2.0 RCS
for d in $(SUBDIRS) $(OTHERSUBDIRS); do \
$(mkinstalldirs) $$d ;\
(cd $$d; rm -f RCS; ln -s /usr/rhs/RCS/rpm-2.0/$$d RCS) \
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac;\
done && test -z "$$fail"
$(PROGS): $(OBJS)
install: all
[ -d $(installprefix)/$(RPMBINDIR) ] || \
$(mkinstalldirs) $(installprefix)/$(RPMBINDIR)
[ -d $(installprefix)/$(RPMNLSDIR) ] || \
$(mkinstalldirs) $(installprefix)/$(RPMNLSDIR)
[ -d $(installprefix)/$(BINDIR) ] || \
$(mkinstalldirs) $(installprefix)/$(BINDIR)
[ -d $(installprefix)/$(MANDIR) ] || \
$(mkinstalldirs) $(installprefix)/$(MANDIR)
[ -d $(installprefix)/$(ETCDIR) ] || \
$(mkinstalldirs) $(installprefix)/$(ETCDIR)
[ -d $(installprefix)/$(LIBDIR) ] || \
$(mkinstalldirs) $(installprefix)/$(LIBDIR)
[ -d $(installprefix)/$(INCDIR) ] || \
$(mkinstalldirs) $(installprefix)/$(INCDIR)
[ -d $(installprefix)/$(RPMCONFIGDIR) ] || \
$(mkinstalldirs) $(installprefix)/$(RPMCONFIGDIR)
if [ -x ./rpm ]; then \
$(INSTALL_PROGRAM) -s -m 755 rpm $(installprefix)/$(RPMBINDIR); \
else \
$(INSTALL_PROGRAM) -s -m 755 rpm.shared $(installprefix)/$(RPMBINDIR)/rpm; \
fi
$(INSTALL_PROGRAM) -m 755 $(srcdir)/gendiff $(installprefix)/$(BINDIR)
$(INSTALL_PROGRAM) -m 755 $(topdir)/mkinstalldirs $(installprefix)/$(RPMCONFIGDIR)/mkinstalldirs
$(INSTALL_PROGRAM) -m 755 $(topdir)/find-provides.sh $(installprefix)/$(RPMCONFIGDIR)/find-provides
$(INSTALL_PROGRAM) -m 755 $(topdir)/find-requires.sh $(installprefix)/$(RPMCONFIGDIR)/find-requires
$(INSTALL_PROGRAM) -s -m 755 rpm2cpio $(installprefix)/$(BINDIR)
$(INSTALL_DATA) -m 644 $(srcdir)/rpm.8 $(installprefix)/$(MANDIR)
$(INSTALL_DATA) -m 644 $(srcdir)/rpm2cpio.8 $(installprefix)/$(MANDIR)
$(INSTALL_DATA) -m 644 $(topdir)/macros $(installprefix)/$(RPMCONFIGDIR)/macros
$(INSTALL_DATA) -m 644 $(topdir)/lib-rpmrc $(installprefix)/$(RPMCONFIGDIR)/rpmrc
$(INSTALL_DATA) -m 644 $(srcdir)/rpmpopt $(installprefix)/$(RPMCONFIGDIR)/rpmpopt
(cd $(installprefix)/$(LIBDIR); rm -f rpmrc; ln -s $(RPMCONFIGDIR)/rpmrc)
(cd $(installprefix)/$(LIBDIR); rm -f rpmpopt; ln -s $(RPMCONFIGDIR)/rpmpopt)
(cd lib; $(MAKE) LIBDIR=$(installprefix)/$(LIBDIR) INCDIR=$(installprefix)/$(INCDIR) install)
(cd build; $(MAKE) LIBDIR=$(installprefix)/$(LIBDIR) INCDIR=$(installprefix)/$(INCDIR) install)
for d in $(INSTSUBDIRS); do \
(cd $$d; $(MAKE) installprefix=$(installprefix) LIBDIR=$(installprefix)/$(LIBDIR) INCDIR=$(installprefix)/$(INCDIR) install) ;\
done
.PHONY: tar
tar:
rm -rf /tmp/rpm-$(VERSION)
make installprefix=/tmp/rpm-$(VERSION)$(ROOT) install
$(mkinstalldirs) /tmp/rpm-$(VERSION)@prefix@/src/redhat/SOURCES
$(mkinstalldirs) /tmp/rpm-$(VERSION)@prefix@/src/redhat/SPECS
$(mkinstalldirs) /tmp/rpm-$(VERSION)@prefix@/src/redhat/SRPMS
$(mkinstalldirs) /tmp/rpm-$(VERSION)@prefix@/src/redhat/RPMS
$(mkinstalldirs) /tmp/rpm-$(VERSION)@prefix@/src/redhat/BUILD
$(mkinstalldirs) /tmp/rpm-$(VERSION)@varprefix@/lib/rpm
$(mkinstalldirs) /tmp/rpm-$(VERSION)/var/tmp
# Couldn't figure de ARCH value
# $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/RPMS/i386
cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
.PHONY: clean
clean:
for d in $(ALLSUBDIRS); do \
(cd $$d; $(MAKE) $@) ;\
done
rm -f *.a *.o core *~ $(PROGS) rpm.shared
find . -name "*.orig" -exec rm {} \;
find . -name core -exec rm {} \;
.PHONY: distclean
distclean:
for d in $(ALLSUBDIRS); do \
(cd $$d; $(MAKE) $@) ;\
done
rm -f *.a *.o core *~ $(PROGS) rpm.shared librpmrc find-provides.sh find-requires.sh
rm -f .depend-done Makefile Makefile.inc config.h config.cache
rm -f config.status config.log lib-rpmrc
.PHONY: depend
depend:
topdir_path=`( cd $(top_srcdir) && pwd )` ; \
/bin/rm -f .depend ; \
$(CPP) -MM $(CFLAGS) $(srcdir)/$(SOURCES) | \
sed s+$$topdir_path+$(top_srcdir)+g > .depend ; \
for d in $(ALLSUBDIRS); do \
(cd $$d; $(MAKE) $@) ;\
done
/bin/rm -f .depend-done
echo > .depend-done
.PHONY: noconfig
noconfig:
find . -name "Makefile" -exec rm {} \;
rm -f *gz *rpm config.*
.PHONY: archive
archive:
@echo " "
@echo "I hope you checked everything out and made sure it builds"
@echo "maybe someday Erik will get around to making that automatic."
@echo
@echo "This is version $(VERSION)."
@sleep 5
@cvs -Q tag -F $(CVSTAG) .
@rm -rf /tmp/rpm-$(VERSION) /tmp/rpm
@cd /tmp; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) rpm || :
@mv /tmp/rpm /tmp/rpm-$(VERSION)
@rm /tmp/rpm-$(VERSION)/popt/popt.spec
@cd /tmp/rpm-$(VERSION); ./autogen.sh ; make depend; make distclean
@cd /tmp/rpm-$(VERSION); ./autogen.sh --noconfigure
@cd /tmp; tar czSpf rpm-$(VERSION).tar.gz rpm-$(VERSION)
@rm -rf /tmp/rpm-$(VERSION)
@cp /tmp/rpm-$(VERSION).tar.gz .
@rm -f /tmp/rpm-$(VERSION).tar.gz
@echo " "
@echo "The final archive is ./rpm-$(VERSION).tar.gz."
ifeq (.depend,$(wildcard .depend))
include .depend
endif