PACKAGE = athcool VERSION = 0.3.12 DESTDIR = prefix = $(DESTDIR)/usr sysconfdir = $(DESTDIR)/etc initdir = $(sysconfdir)/init.d sbindir = $(prefix)/sbin libdir = $(prefix)/lib includedir = $(prefix)/include datadir = $(prefix)/share mandir = $(datadir)/man SRCS = athcool.c scanpci.c OBJS = $(SRCS:.c=.o) CC = gcc RM = rm -f CFLAGS = -O2 -Wall DEFS = -I. -I$(includedir) -DPACKAGE=\"$(PACKAGE)\" -DVERSION=\"$(VERSION)\" #DEFS += -DENABLE_FORCEID=1 #DEFS += -DDISABLE_WRITE_REG=1 LIBS = $(shell pkg-config --libs libpci) ### rules ### .SUFFIXES: .SUFFIXES:.o .c all: $(PACKAGE) $(PACKAGE): $(OBJS) $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $@ install: install-program install-man # install-script install-program: [ -d $(sbindir) ] || install -m 755 -d $(sbindir) install -s $(PACKAGE) $(sbindir) install-man: [ -d $(mandir)/man8 ] || install -m 755 -d $(mandir)/man8 install -m 644 $(PACKAGE).8 $(mandir)/man8 install-script: [ -d $(initdir) ] || install -m 755 -d $(initdir) install -m 755 athcool.init $(initdir)/athcool .c.o: $(CC) $(CFLAGS) $(DEFS) -c $< -o $@ clean: -$(RM) $(PACKAGE) *.o core *~ a.out test test: scanpci.o test.o $(CC) $(CFLAGS) scanpci.o test.o $(LIBS) -o $@ athcool.o: athcool.c chips.h athcool.h scanpci.o: scanpci.c athcool.h