-LIBS = -lgdbm #-lefence
+LIBS = -lgdbm -ldb
LIBOBJECTS = header.o oldrpmdb.o misc.o messages.o rpmerr.o falloc.o \
- convertdb.o oldrpmfile.o var.o md5.o md5sum.o
+ convertdb.o oldrpmfile.o var.o md5.o md5sum.o dbindex.o \
+ rpmdb.o
LIBRPM = librpm.a
WARNINGS = -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes
DEBUG = -g
OPTS = -O2
-all: test dump dumpdb
-
# -----------------------------------------------------------------------
AR = ar r
CFLAGS = $(WARNINGS) $(DEBUG) $(OPTS)
LDFLAGS = $(DEBUG) $(LIBS)
+ifeq (.depend,$(wildcard .depend))
+TARGET=allprogs
+else
+TARGET=depend allprogs
+endif
+
+all: $(TARGET)
+
+allprogs: test dump dumpdb
+
test: test.c librpm.a
$(CC) $(DEBUG) -o $@ test.c librpm.a $(LIBS)
clean:
rm -f *.a *.o *~ $(ALL) test.out
+
+squeaky: clean
+ rm -f depend
+
+depend:
+ gcc -M *.c > .depend
+
+ifeq (.depend,$(wildcard .depend))
+include .depend
+endif