File:  [Public] / rpm2html / Makefile.in
Revision 1.61: download - view: text, annotated - select for diffs
Thu Apr 8 10:08:52 1999 UTC (25 years, 1 month ago) by daniel
Branches: MAIN
CVS tags: HEAD
Patch for RPM-3.0, and updates for rpm2html-1.2, Daniel.

NAME	= rpm2html
VERSION	= 1.2

CC	= @CC@
#CC	= insure

CFLAGS	= @CFLAGS@ -Wall
#CFLAGS	= -Wall -g -DDEBUG
#CFLAGS	= -Wall -O6

LDFLAGS	= @LDFLAGS@
LIBXML_FLAGS= -I$(srcdir)/@LIBXML_DIR@
LIBXML_DIR= $(srcdir)/@LIBXML_DIR@

INCL	= -I. $(LIBXML_FLAGS)

CP	= @CP@
RM	= @RM@ -f
MV	= @MV@ 
LN	= @LN_S@
TAR	= @TAR@
GZIP	= @GZIP@ -9

prefix	= @prefix@
exec_prefix= @exec_prefix@
bindir	= @bindir@
libdir	= @libdir@
sysconfdir = @sysconfdir@
datadir	= @datadir@
mandir	= @mandir@
srcdir	= @srcdir@
VPATH   = @srcdir@

OBJS= rpmopen.o rpmdata.o html.o config.o language.o rdf.o rdf_api.o cleanup.o memory.o stringbuf.o

LIBS= @LIBS@

XML_FILES=XML/Makefile.in XML/configure.in XML/*.h XML/*.c 

RDF_FILES=rdf.c rdf.h rdf_api.c rdf_api.h
MAKE_FILES= configure configure.in config.h.in Makefile.in \
            install-sh config.guess config.sub

FILES= Copyright BUGS README TODO INSTALL CHANGES PRINCIPLES \
       help.html config.c html.c html.h cleanup.c memory.c memory.h \
       rpm2html.c rpm2html.config rpm2html.h rpmdata.c rpmdata.h \
       language.h language.c rdf.c rdf.h msg.fr msg.es msg.de msg.pl \
       msg.cz rpmopen.c rpm2html.spec rpm2html.1 compressor.c dir.gif \
       new.gif stringbuf.h stringbuf.c \
       $(MAKE_FILES) $(CONFIG) $(XML_FILES) $(RDF_FILES) $(FIND_FILES)

CONFIG= rpm2html-cdrom.config rpm2html-en.config rpm2html.config.mirrors \
        rpm2html-fr.config rpm2html.config.resources rpm2html-rdf.config

all : rpm2html

force:

XML/libxml.a: force
	@(MAINDIR=`pwd` ; cd XML; \
	 make CC="$(CC)" CFLAGS="$(CFLAGS)" MAINDIR="$$MAINDIR")

clean :
	@(if [ -d XML ] ; then cd XML; make clean; fi)
	$(RM) rpm2html compressor $(OBJS) rpm2html.o compressor.o \
	      core errors.vim test/*

distclean : clean
	@(if [ -d XML ] ; then cd XML; make distclean; fi)
	$(RM) Makefile config.h configure config.log config.cache \
	      config.status .depends Makefile

rpm2html : rpm2html.o $(OBJS) XML/libxml.a
	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ rpm2html.o $(OBJS) -L. -LXML -lxml $(LIBS)

compressor : compressor.o
	$(CC) $(CFLAGS) -o $@ compressor.o $(LIBS)

dir.gif.h : $(srcdir)/dir.gif compressor
	if [ ! -f dir.gif ] ; then $(CP) $(srcdir)/dir.gif . ; fi
	./compressor dir.gif

new.gif.h : $(srcdir)/new.gif compressor
	if [ ! -f new.gif ] ; then $(CP) $(srcdir)/new.gif . ; fi
	./compressor new.gif

depends .depends: dir.gif.h new.gif.h *.h
	@($(CC) $(INCL) $(CCFLAGS) -MM *.c > .depends 2>/dev/null ; exit 0)

.c.o:
	$(CC) $(CFLAGS) $(INCL) -c $<

install : rpm2html
	@(cd XML ; make install)
	@INSTALL@ rpm2html $(bindir)
	@INSTALL@ -m 644 rpm2html.1 $(mandir)/man1/
	if [ ! -d $(datadir)/$(NAME) ] ; then \
	   @INSTALL@ -d $(datadir)/$(NAME) ;\
	fi
	@INSTALL@ -m 644 msg.* $(datadir)/$(NAME)
	if [ "$(sysconfdir)" = "/usr/etc" ] ; then \
	     @INSTALL@ -m 644 rpm2html.config /etc/rpm2html.config ; \
        else \
	     @INSTALL@ -m 644 rpm2html.config $(sysconfdir)/rpm2html.config ; \
	fi
	@echo "Don't forget to edit $(sysconfdir)/rpm2html.config"

uninstall :
	@(cd XML ; make uninstall)
	$(RM) $(bindir)/rpm2html
	$(RM) $(mandir)/man1/rpm2html.1
	if [ "$(sysconfdir)" = "/usr/etc" ] ; then \
	     $(MV) /etc/rpm2html.config /etc/rpm2html.config.old ; \
        else \
	    $(MV) $(sysconfdir)/rpm2html.config $(sysconfdir)/rpm2html.config.old ; \
	fi
	$(RM) $(datadir)/$(NAME)/msg.*

include .depends

rdf_api : rdf_api.c XML/libxml.a
	$(CC) $(CFLAGS) $(INCL) -DDEBUG_RDF -o rdf_api rdf_api.c -LXML -lxml 

test tests : rpm2html
	rpm2html $(sysconfdir)/rpm2html.config

distrib : clean
	@$(LN) . $(NAME)-$(VERSION)
	@(if [ "$(LIBXML_DIR)" != "" ] ; then \
	  if [ "$(LIBXML_DIR)" != "XML" ] ; then \
	      $(RM) -rf XML ; \
	      $(LN) $(LIBXML_DIR) XML ; fi ; fi )
	@($(TAR) cvf - `for i in $(FILES); \
	  do echo $(NAME)-$(VERSION)/$$i ; \
	  done` | $(GZIP) > $(NAME)-$(VERSION).tar.gz)
	@$(RM) $(NAME)-$(VERSION)
	@(if [ "$(LIBXML_DIR)" != "" ] ; then \
	  if [ "$(LIBXML_DIR)" != "XML" ] ; then \
	      $(RM) XML ; fi ; fi )

rpm : distrib
	cp $(NAME)-$(VERSION).tar.gz /usr/src/redhat/SOURCES/
	cp $(NAME).spec /usr/src/redhat/SPECS/
	(cd /usr/src/redhat/SPECS/ ; rpm -ba $(NAME).spec)
	ls -l /usr/src/redhat/SOURCES/$(NAME)-$(VERSION).tar.gz
	ls -l /usr/src/redhat/SRPMS/$(NAME)-$(VERSION)-*.src.rpm
	ls -l /usr/src/redhat/RPMS/i386/$(NAME)-$(VERSION)-*.i386.rpm


Webmaster