makefile

来自「VIA VT6655 x86下的Linux Source Code」· 代码 · 共 36 行

TXT
36
字号
KSP :=  /lib/modules/$(shell uname -r)/build \
        /usr/src/linux-$(shell uname -r) \
        /usr/src/linux-$(shell uname -r | sed 's/-.*//') \
        /usr/src/kernel-headers-$(shell uname -r) \
        /usr/src/kernel-source-$(shell uname -r) \
        /usr/src/linux-$(shell uname -r | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
        /usr/src/linux

test_dir = $(shell [ -e $(dir)/include/linux ] && echo $(dir))
KSP := $(foreach dir, $(KSP), $(test_dir))

KSRC := $(firstword $(KSP))

ifndef CFLAGS
CFLAGS = -O2 -Wall -Wstrict-prototypes -Winline -pipe -DLINUX 
endif

CPPFLAGS = -I../include -I$(KSRC)/include


SRCS = wetctl.c


wetctl: wetctl.o 
	cc -o wetctl wetctl.o

install: wetctl.o 
	cc -o wetctl wetctl.o
	cp -p wetctl /sbin
	
uninstall:
	rm -f /sbin/wetctl
		
clean: 
	rm -f wetctl core core.* *.o .*.o *.s *.a .depend tmp_make *~

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?