# DEBUGFLAGS = -g
CFLAGS     = -Wall -Os
LDFLAGS    = $(LIBPATH)

AR      = ar
RANLIB  = ranlib

LIBPCIPROBE = libpciprobe.a

OBJECTS = pciprobe.o
SOURCES = pciprobe.c
HEADERS = pci-ids.h pciprobe.h

all: $(LIBPCIPROBE)

test-pciprobe: test-pciprobe.o $(LIBPCIPROBE)

test-pciprobe.o: test-pciprobe.c

$(LIBPCIPROBE) : $(OBJECTS)
	$(AR) cr $(LIBPCIPROBE) $(OBJECTS)
	$(RANLIB) $(LIBPCIPROBE)

$(OBJECTS): $(SOURCES) $(HEADERS)

pci-ids.h: ../../perl-install/pci_probing/pcitable
	make -C ../../perl-install/pci_probing
	perl update-pci-ids.pl > $@

clean:
	rm -f *.o *.a *~ core test-pciprobe test-pciprobe.o
