168 lines
5.1 KiB
Makefile
168 lines
5.1 KiB
Makefile
# This stuff should be reasonably changeable
|
|
|
|
CC = @CC@
|
|
CPP = @CPP@
|
|
OPTS = @DEFS@
|
|
prefix= @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
srcdir= @srcdir@
|
|
libdir= $(prefix)/lib
|
|
INSTALL= @INSTALL@
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
INSTALL_DATA = @INSTALL_DATA@
|
|
LIBRPMRC_FILENAME=$(libdir)/rpmrc
|
|
#LIBEFENCE = -lefence
|
|
|
|
#DEBUG = -g
|
|
installprefix=$(ROOT)
|
|
|
|
#LIBEFENCE = -lefence
|
|
|
|
################################### Leave this stuff alone
|
|
|
|
### These are variables meant to be exported
|
|
|
|
VPATH = $(srcdir)
|
|
WARNINGS = -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes
|
|
CFLAGS = @CFLAGS@ $(WARNINGS) $(OPTS) -I$(srcdir) -I$(srcdir)/lib \
|
|
-I$(srcdir)/build -I$(srcdir)/misc -I$(srcdir)/.. -I$(srcdir)/../lib \
|
|
-I$(srcdir)/../build -I$(srcdir)/../misc -I/usr/include \
|
|
-DLIBRPMRC_FILENAME="\"$(LIBRPMRC_FILENAME)"\" -DVERSION=\"$(VERSION)\"
|
|
LDFLAGS = @LDFLAGS@ -Llib -Lbuild -Lmisc -L../lib -L../build -L../misc
|
|
AR = ar r
|
|
RANLIB = ranlib
|
|
VERSION = 2.2.5
|
|
|
|
BINDIR=$(prefix)/bin
|
|
RPMBINDIR=$(subst usr/bin,bin,$(BINDIR))
|
|
MANDIR=$(prefix)/man/man8
|
|
LIBDIR=$(libdir)
|
|
INCDIR=$(prefix)/include/rpm
|
|
ETCDIR=$(ROOT)/etc
|
|
NLSDIR=$(prefix)/lib/locale
|
|
NLSPACKAGE=rpm
|
|
|
|
MDEFINES = CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' CC='$(CC)'
|
|
|
|
# -----------------------------------------------------------------------
|
|
|
|
SUBDIRS = lib build tools po misc
|
|
OBJS = rpm.o query.o install.o verify.o checksig.o ftp.o
|
|
PROGS = rpm rpm2cpio
|
|
LOADLIBES = -lbuild -lrpm @LIBMISC@ @LIBS@ @ZLIB@ @LIBINTL@
|
|
|
|
ifeq (.depend,$(wildcard .depend))
|
|
TARGET=everything
|
|
else
|
|
TARGET=depend everything
|
|
endif
|
|
|
|
all: $(TARGET)
|
|
|
|
rpm: lib/librpm.a build/libbuild.a gettextstub.o $(OBJS)
|
|
$(CC) -o rpm -static $(LDFLAGS) $(OBJS) $(LOADLIBES) $(LIBEFENCE)
|
|
$(CC) -o rpm.shared $(LDFLAGS) $(OBJS) gettextstub.o $(LOADLIBES) $(LIBEFENCE)
|
|
|
|
rpm2cpio: lib/librpm.a rpm2cpio.o
|
|
$(CC) -o rpm2cpio $(LDFLAGS) rpm2cpio.o $(LOADLIBES)
|
|
|
|
rpm.o: rpm.c query.h install.h lib/rpmlib.h Makefile
|
|
$(CC) $(CFLAGS) -DNLSPACKAGE=\"$(NLSPACKAGE)\" -DNLSDIR=\"$(NLSDIR)\" -c 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) $(MDEFINES)) \
|
|
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac;\
|
|
done && test -z "$$fail"
|
|
|
|
newtree:
|
|
rm -f RCS
|
|
ln -sf /usr/rhs/RCS/rpm-2.0 RCS
|
|
for d in $(SUBDIRS) docs; do \
|
|
mkdir -p $$d ;\
|
|
(cd $$d; rm -f RCS; ln -sf /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
|
|
$(INSTALL) -m 755 -o 0 -g 0 -d $(installprefix)/$(RPMBINDIR)
|
|
$(INSTALL) -m 755 -o 0 -g 0 -d $(installprefix)/$(BINDIR)
|
|
$(INSTALL) -m 755 -o 0 -g 0 -d $(installprefix)/$(MANDIR)
|
|
$(INSTALL) -m 755 -o 0 -g 0 -d $(installprefix)/$(ETCDIR)
|
|
$(INSTALL) -m 755 -o 0 -g 0 -d $(installprefix)/$(LIBDIR)
|
|
$(INSTALL) -s -m 755 -o 0 -g 0 rpm $(installprefix)/$(RPMBINDIR)
|
|
$(INSTALL) -m 755 -o 0 -g 0 $(srcdir)/gendiff $(installprefix)/$(BINDIR)
|
|
$(INSTALL) -m 755 -o 0 -g 0 $(srcdir)/find-provides $(installprefix)/$(BINDIR)
|
|
$(INSTALL) -s -m 755 -o 0 -g 0 rpm2cpio $(installprefix)/$(BINDIR)
|
|
$(INSTALL) -m 644 -o 0 -g 0 $(srcdir)/rpm.8 $(installprefix)/$(MANDIR)
|
|
$(INSTALL) -m 644 -o 0 -g 0 $(srcdir)/rpm2cpio.8 $(installprefix)/$(MANDIR)
|
|
if [ ! -f $(installprefix)/$(ETCDIR)/rpmrc ]; then \
|
|
$(INSTALL) -m 644 -o 0 -g 0 $(srcdir)/rpmrc $(installprefix)/$(ETCDIR)/rpmrc; \
|
|
fi
|
|
$(INSTALL) -m 644 -o 0 -g 0 $(srcdir)/lib-rpmrc $(installprefix)/$(LIBDIR)/rpmrc
|
|
(cd lib; make LIBDIR=$(installprefix)/$(LIBDIR) INCDIR=$(installprefix)/$(INCDIR) install)
|
|
(cd po; make NLSDIR=$(installprefix)/$(NLSDIR) LIBDIR=$(installprefix)/$(LIBDIR) INCDIR=$(installprefix)/$(INCDIR) install)
|
|
|
|
clean:
|
|
for d in $(SUBDIRS); do \
|
|
(cd $$d; $(MAKE) $@) ;\
|
|
done
|
|
rm -f *.a *.o core *~ $(PROGS) rpm.shared
|
|
find . -name core -exec rm {} \;
|
|
|
|
depend:
|
|
$(CPP) $(CFLAGS) -M *.c > .depend
|
|
for d in $(SUBDIRS); do \
|
|
(cd $$d; $(MAKE) $@) ;\
|
|
done
|
|
|
|
co:
|
|
co RCS/*,v
|
|
for d in $(SUBDIRS) docs; do \
|
|
(cd $$d; co RCS/*,v) ;\
|
|
done
|
|
|
|
noconfig:
|
|
find . -name "Makefile" -exec rm {} \;
|
|
rm -f *gz *rpm config.*
|
|
|
|
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."
|
|
@sleep 5
|
|
@rm -rf /tmp/rpm-$(VERSION)
|
|
@mkdir /tmp/rpm-$(VERSION)
|
|
@tar cSpf - * | (cd /tmp/rpm-$(VERSION); tar xSpf -)
|
|
@cd /tmp/rpm-$(VERSION); \
|
|
make clean; \
|
|
make noconfig; \
|
|
find . -name "RCS" -exec rm {} \; ; \
|
|
find . -name ".depend" -exec rm {} \;
|
|
@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. You should run"
|
|
@echo "rcs -n$(VERSION): RCS/*,v on all of the directories btw."
|
|
|
|
ifeq (.depend,$(wildcard .depend))
|
|
include .depend
|
|
endif
|