
all: tpctl

CFLAGS:=-Wall -Wcast-align -Wstrict-prototypes -Wno-uninitialized -O2
#-DTP570_KLUDGE
#-DALLOW_POWEROFF
#-DDEBUG_REGS -DDEBUG_STRUCT_SIZES -DDEBUG_FILEOPS -DDEBUG_IOPARM

ALLCFLAGS:=$(CFLAGS) -L../lib -I../include -DLINUX

tpctl: tpctl.o ../lib/libsmapidev.so.2
	$(CC) $(ALLCFLAGS) -o $@ tpctl.o -lncurses -lsmapidev

tpctl.o: tpctl.c ../include/thinkpad_common.h ../include/thinkpad.h ../include/smapi.h ../include/superio.h ../include/rtcmosram.h ../include/smapidev.h
	$(CC) $(ALLCFLAGS) -o $@ -c tpctl.c

clean:
	rm -vf tpctl core *.o
