File:  [Public] / rpm2html / Makefile.in
Revision 1.75: download - view: text, annotated - select for diffs
Sat Oct 28 12:16:16 2000 UTC (23 years, 7 months ago) by veillard
Branches: MAIN
CVS tags: HEAD
Makefile cleanup, added generation of RDf channels, Daniel.

NAME	= rpm2html
VERSION	= 1.5

CC	= @CC@
#CC	= insure

SQL_FLAGS=@SQL_FLAGS@

CFLAGS	= @CFLAGS@ $(SQL_FLAGS) -Wall
#CFLAGS	= -Wall -g -DDEBUG
#CFLAGS	= -Wall -O6

LDFLAGS	= @LDFLAGS@
LIBXML_FLAGS=@XML_CFLAGS@
LIBXML_LIBS=@XML_LIBS@
RPM_FLAGS=@RPM_CFLAGS@
RPM_LIBS=@RPM_LIBS@

INCL	= -I. $(LIBXML_FLAGS) $(RPM_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 @SQL_OBJ@

LIBS= $(RPM_LIBS) @LIBS@

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 sql.c sql.h rpm2html-sql.spec \
       $(MAKE_FILES) $(CONFIG) $(RDF_FILES) $(FIND_FILES)

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

all : dir.gif.h new.gif.h rpm2html @SQL_PROGS@

clean :
	$(RM) rpm2html compressor $(OBJS) rpm2html.o compressor.o \
	      core errors.vim .depends test/*

distclean : clean
	$(RM) Makefile config.h config.log config.cache \
	      config.status .depends Makefile

sql: sql.c sql.h rpm2html.h Makefile
	$(CC) $(LDFLAGS) $(CFLAGS) $(INCL) -DSTANDALONE -o $@ sql.c -L. $(LIBXML_LIBS) $(LIBS) -lmysqlclient -lpopt
	
rpm2html : rpm2html.o $(OBJS) 
	$(CC) $(LDFLAGS) $(CFLAGS) -o $@ rpm2html.o $(OBJS) -L. $(LIBXML_LIBS) $(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 config.h html.h memory.h rdf.h rpm2html.h  stringbuf.h dir.gif.h language.h new.gif.h rdf_api.h rpmdata.h
	@($(CC) $(CFLAGS) $(INCL) -MM *.c > .depends 2>/dev/null ; exit 0)

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

install : rpm2html
	@INSTALL@ -d $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1/ \
		$(DESTDIR)$(datadir)/$(NAME) $(DESTDIR)$(sysconfdir)
	@INSTALL@ rpm2html $(DESTDIR)$(bindir)
	@INSTALL@ -m 644 rpm2html.1 $(DESTDIR)$(mandir)/man1/
	@INSTALL@ -d $(DESTDIR)$(datadir)/$(NAME)
	@INSTALL@ -m 644 msg.* $(DESTDIR)$(datadir)/$(NAME)
	@INSTALL@ -m 644 rpm2html.config $(DESTDIR)$(sysconfdir)/rpm2html.config
	@echo "Don't forget to edit $(sysconfdir)/rpm2html.config"

uninstall :
	$(RM) $(DESTDIR)$(bindir)/rpm2html
	$(RM) $(DESTDIR)$(mandir)/man1/rpm2html.1
	$(RM) $(DESTDIR)$(sysconfdir)/rpm2html.config
	$(RM) $(DESTDIR)$(datadir)/$(NAME)/msg.*
	$(RM) $(DESTDIR)$(datadir)

include .depends

rdf_api : rdf_api.c 
	$(CC) $(CFLAGS) $(INCL) -DDEBUG_RDF -o rdf_api rdf_api.c $(LIBXML_LIBS) $(LIBS)

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

distrib : clean
	@$(LN) . $(NAME)-$(VERSION)
	@($(TAR) cvf - `for i in $(FILES); \
	  do echo $(NAME)-$(VERSION)/$$i ; \
	  done` | $(GZIP) > $(NAME)-$(VERSION).tar.gz)
	@$(RM) $(NAME)-$(VERSION)

rpm : distrib
	cp $(NAME)-$(VERSION).tar.gz /usr/src/redhat/SOURCES/
	cp $(NAME).spec /usr/src/redhat/SPECS/
	cp $(NAME)-sql.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
	(cd /usr/src/redhat/SPECS/ ; rpm -ba $(NAME)-sql.spec)
	ls -l /usr/src/redhat/SOURCES/$(NAME)-sql-$(VERSION).tar.gz
	ls -l /usr/src/redhat/SRPMS/$(NAME)-sql-$(VERSION)-*.src.rpm
	ls -l /usr/src/redhat/RPMS/i386/$(NAME)-sql-$(VERSION)-*.i386.rpm


Webmaster