srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@

LIBOBJECTS = \
misc.o              parsePreamble.o     part.o \
package.o           parseDescription.o  parsePrep.o         read.o \
parseFiles.o        parseReqs.o         reqprov.o \
parseChangelog.o    parseSpec.o         spec.o \
parseScript.o       parseBuildInstallClean.o  build.o \
files.o myftw.o names.o pack.o macro.o

LIBBUILD = librpmbuild.a
LOADLIBES = -lrpm -lz ../popt/libpopt.a $(LIBEFENCE)

# -----------------------------------------------------------------------

include ../Makefile.inc

TARGET=everything

all: $(TARGET)

everything: $(LIBBUILD)

$(LIBBUILD): $(LIBOBJECTS) 
	$(AR) r $@ $(LIBOBJECTS)
	$(RANLIB) $@

$(PROGS): $(LIBOBJECTS)

# GNU make doesn't need the pack.c on here, but broken makes may
pack.o: pack.c
	$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -o $@ -c $<

clean:
	rm -f *.a *.o *~ $(PROGS)

distclean: clean
	rm -f Makefile

depend:
	topdir_path=`( cd $(top_srcdir) && pwd )` ; \
	$(CPP) $(CFLAGS) -MM $(srcdir)/*.c | \
	    sed s+$$topdir_path+$(top_srcdir)+g > .depend

ifeq (.depend,$(wildcard .depend))
include .depend
endif
