#<-- for Make One Linux
#prefix=
prefix=/usr
libexecdir=libexec
#-->
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

#<-- for Make One Linux
#hwsetup: hwsetup.c
#	$(CC) $(INC) $(CFLAGS) $(OPT) $(LDFLAGS) -o $@ $< $(LIBS)
hwsetup-mol: 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
install: hwsetup-mol
	[ -d $(DESTDIR)$(prefix)/$(libexecdir) ] || mkdir -p $(DESTDIR)$(prefix)/$(libexecdir)
	install -m 755 $< $(DESTDIR)$(prefix)/$(libexecdir)/$<

uninstall:
	rm -f $(DESTDIR)$(prefix)/$(libexecdir)/hwsetup-mol

#clean:
#	rm -f hwsetup *.o core
clean:
	rm -f hwsetup-mol *.o core

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