prefix=
INC=-I/usr/include/kudzu
# define BLACKLIST to avoid loading potentially dangerous modules
CFLAGS=-DBLACKLIST -Wall -fPIC
OPT=-O2
LDFLAGS=-s
LIBS=-lkudzu -lpci
CC=gcc

hwsetup: hwsetup.c
	$(CC) $(INC) $(CFLAGS) $(OPT) $(LDFLAGS) -o $@ $< $(LIBS)

install: hwsetup
	[ -d $(prefix)/sbin ] || mkdir -p $(prefix)/sbin
	install -m 755 hwsetup $(prefix)/sbin/hwsetup

clean:
	rm -f hwsetup *.o core

dist: clean
	cd .. ; \
	tar -cvf - hwsetup/{Makefile,*.[ch]} | \
	bzip2 -9 > $(HOME)/redhat/SOURCES/hwsetup.tar.bz2
