summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Andrianov2017-07-26 12:03:29 -0500
committerVitaly Andrianov2017-08-30 07:30:19 -0500
commit4688eeb3f9693ce82fad07f923e789180d47c810 (patch)
tree79640f043d2c10651a7c95b34c622f9cf4a108b0
parent504873f6b4a88d7e4ccb6ebda7648d93aaf13ce3 (diff)
downloadjailhouse-inmate-4688eeb3f9693ce82fad07f923e789180d47c810.tar.gz
jailhouse-inmate-4688eeb3f9693ce82fad07f923e789180d47c810.tar.xz
jailhouse-inmate-4688eeb3f9693ce82fad07f923e789180d47c810.zip
makefile: add cscope target
Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
-rw-r--r--rtos/Rules.mk28
-rw-r--r--rtos/ethercat_slave_demo/Makefile2
-rw-r--r--rtos/icss_emac/Makefile1
3 files changed, 31 insertions, 0 deletions
diff --git a/rtos/Rules.mk b/rtos/Rules.mk
new file mode 100644
index 0000000..dc059a1
--- /dev/null
+++ b/rtos/Rules.mk
@@ -0,0 +1,28 @@
1# cscope.rules
2
3FULL_CSRCS = $(foreach f,$(CSRCS),$(firstword $(wildcard $(VPATH:%=%/$f)) not-found:$f))
4
5.PHONY: cscope build_deps
6cscope: build_deps
7 @rm -f cscope.*
8 @for F in $(FULL_CSRCS); do echo $$F >> cscope.files; done
9 @cat .headers.1.dep >> cscope.files
10 @sort -u cscope.files > .headers.dep
11 @mv .headers.dep cscope.files
12 @rm -f .headers.dep .headers.1.dep
13 @cscope -b -k
14 @echo "cscope.out has been built"
15
16DEPS = $(patsubst %.c,%.d,$(CSRCS))
17
18build_deps:
19 @rm -f *.dep
20 @for F in $(DEPS); do \
21 $(MAKE) $$F; \
22 done
23 @grep -v "\.o:" .headers.dep | sort -u | cut -f2 -d' ' > .headers.1.dep
24
25%.d: %.c
26 $(CC) $(CFLAGS) -MM $< -MF $(notdir $@)
27 @cat $(notdir $@) >> .headers.dep
28 @rm -f $(notdir $@)
diff --git a/rtos/ethercat_slave_demo/Makefile b/rtos/ethercat_slave_demo/Makefile
index 40816a1..e5d91e0 100644
--- a/rtos/ethercat_slave_demo/Makefile
+++ b/rtos/ethercat_slave_demo/Makefile
@@ -114,3 +114,5 @@ clean:
114install: $(EXE).bin 114install: $(EXE).bin
115 cp $(EXE).bin $(INSTALL_DIR) 115 cp $(EXE).bin $(INSTALL_DIR)
116 116
117-include ../Rules.mk
118
diff --git a/rtos/icss_emac/Makefile b/rtos/icss_emac/Makefile
index a522c95..83ecb07 100644
--- a/rtos/icss_emac/Makefile
+++ b/rtos/icss_emac/Makefile
@@ -71,3 +71,4 @@ clean:
71install: $(EXE).bin 71install: $(EXE).bin
72 cp $(EXE).bin $(INSTALL_DIR) 72 cp $(EXE).bin $(INSTALL_DIR)
73 73
74-include ../Rules.mk