-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (32 loc) · 1.06 KB
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#PWD:= $(shell pwd)
#IOT_HOME = /opt/clanton-tiny/1.4.4/sysroots
#KDIR:=$(IOT_HOME)/i586-poky-linux-uclibc/usr/src/kernel
#PATH := $(PATH):$(IOT_HOME)/x86_64-pokysdk-linux/usr/bin/i586-poky-linux
#CROSS_COMPILE = i586-poky-linux
#SROOT=$(IOT_HOME)/i586-poky-linux/
#CC = i586-poky-linux-gcc
IOT_HOME = /opt/iot-devkit/1.7.2/sysroots
KDIR:=$(IOT_HOME)/i586-poky-linux/usr/src/kernel
PATH := $(PATH):$(IOT_HOME)/x86_64-pokysdk-linux/usr/bin/i586-poky-linux
CROSS_COMPILE = i586-poky-linux-
SROOT=$(IOT_HOME)/i586-poky-linux/
CC = i586-poky-linux-gcc
CFLAGS+ = -g -Wall
ARCH = x86
APP = main
obj-m:= HCSR_drv.o
all:
make EXTRA_FLAGS=$(CFLAGS) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KDIR) M=$(PWD) modules
$(CC) -o $(APP) main.c -pthread -Wall -g --sysroot=$(SROOT)
clean:
rm -f *.ko
rm -f *.o
rm -f Module.symvers
rm -f modules.order
rm -f *.mod.c
rm -rf .tmp_versions
rm -f *.mod.c
rm -f *.mod.o
rm -f \.*.cmd
rm -f Module.markers
rm -f $(APP)