-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
86 lines (65 loc) · 2.01 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
74
75
76
77
78
79
80
81
82
83
84
85
86
descend = \
+mkdir -p $(OUTPUT)$(1) && \
$(MAKE) $(COMMAND_O) subdir=$(if $(subdir),$(subdir)/$(1),$(1)) $(PRINT_DIR) -C $(1) $(2)
kernel_dir = /lib/modules/`uname -r`/build
module_dir = `pwd`/kernel-module/igb
all: igb daemons_all avb-user
clean: igb_clean daemons_all_clean avb-user_clean
help:
@echo 'Possible targets:'
@echo ''
@echo ' igb - igb kernel module'
@echo ''
@echo ' daemons_all - build all daemons (mrpd gptp maap shaper)'
@echo ' mrpd - mrpd daemon'
@echo ' gptp - gptp daemon for linux'
@echo ' maap - maap daemon'
@echo ' shaper - shaper daemon for linux'
@echo ''
@echo ' avb-user - avb userspace client'
@echo ''
@echo 'Cleaning targets:'
@echo ''
@echo ' all of the above with the "_clean" string appended cleans'
@echo ' the respective build directory.'
@echo ' clean: a summary clean target to clean _all_ folders'
@echo ''
igb: FORCE
cd $(module_dir)
make -C $(kernel_dir) M=$(module_dir)
igb_clean:
$(call descend,kernel-module/igb/,clean)
mrpd:
$(call descend,daemons/$@)
mrpd_clean:
$(call descend,daemons/mrpd/,clean)
gptp:
ARCH=I210
$(call descend,daemons/$@/linux/build/)
gptp_clean:
$(call descend,daemons/gptp/linux/build/,clean)
maap:
$(call descend,daemons/$@/linux/build/)
maap_clean:
$(call descend,daemons/maap/linux/build/,clean)
shaper:
$(call descend,daemons/$@)
shaper_clean:
$(call descend,daemons/shaper/,clean)
daemons_all: mrpd maap gptp shaper
daemons_all_clean: mrpd_clean gptp_clean maap_clean shaper_clean
avb-user:
$(call descend,tools/)
avb-user_clean:
$(call descend,tools/,clean)
install: all
mkdir -p $(HOME)/.avb
cp daemons/mrpd/mrpd $(HOME)/.avb
cp daemons/gptp/linux/build/obj/daemon_cl $(HOME)/.avb
cp daemons/maap/linux/build/maap_daemon $(HOME)/.avb
cp daemons/shaper/shaper_daemon $(HOME)/.avb
cp tools/avb-user $(HOME)/.avb
cp kernel-module/igb/igb_avb.ko $(HOME)/.avb
cp avb_up.sh /usr/local/bin
cp avb_down.sh /usr/local/bin
.PHONY: FORCE