1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
all: thinkpad.o smapi.o superio.o rtcmosram.o thinkpadpm.o
DIR_MODULES=/lib/modules
DIR_MODULES_VER=$(DIR_MODULES)/$(shell uname -r)
ifndef KSRC
KSRC=$(DIR_MODULES_VER)/build
endif
CFLAGS := -I$(KSRC)/include -I../include -Wall -Wcast-align -Wstrict-prototypes -DLINUX -O2
thinkpad.o: thinkpad.c ../include/thinkpad_common.h ../include/thinkpad_driver.h ../include/thinkpad.h
$(CC) $(CFLAGS) -o $@ -c thinkpad.c
smapi.o: smapi_core.o smapi_call.o
ld -r $^ -o $@
smapi_core.o: smapi_core.c ../include/thinkpad_common.h ../include/thinkpad_driver.h ../include/smapi.h ../include/smapi_call.h
$(CC) $(CFLAGS) -o $@ -c smapi_core.c
smapi_call.o: smapi_call.s
$(CC) $(CFLAGS) -o $@ -c smapi_call.s
superio.o: superio.c ../include/thinkpad_common.h ../include/thinkpad_driver.h ../include/superio.h
$(CC) $(CFLAGS) -o $@ -c superio.c
rtcmosram.o: rtcmosram.c ../include/thinkpad_common.h ../include/thinkpad_driver.h ../include/rtcmosram.h
$(CC) $(CFLAGS) -o $@ -c rtcmosram.c
thinkpadpm.o: thinkpadpm.c ../include/thinkpad_common.h ../include/thinkpad_driver.h ../include/thinkpadpm.h
$(CC) $(CFLAGS) -o $@ -c thinkpadpm.c
clean:
rm -vf *.o
|