-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
64 lines (50 loc) · 1.41 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
# Include standard NCS build definitions and rules
include $(NCS_DIR)/src/ncs/build/include.ncs.mk
# Include setup makefile (autogenerated) for handling packages and netsims
include ./setup.mk
.PHONY: all start stop clean db-clean
all: packages netsim
if [ ! -d ncs-cdb ]; then mkdir ncs-cdb; fi
if [ ! -d init_data ]; then mkdir init_data; fi
cp init_data/* ncs-cdb/. > /dev/null 2>&1 || true
start: stop netsim-start
ncs
if [ -d first_start ]; then ncs_load -l -m resource_pools_init.xml; rm -rf first_start; fi
stop: netsim-stop
ncs --stop || true
clean: packages-clean netsim-clean db-clean
rm -rf logs/* lux_logs
rm -rf .bundle
if [ ! -d first_start ]; then mkdir first_start; fi
db-clean:
rm -rf state/* ncs-cdb/*
# Handy CLI targets
.PHONY: cli cli-c cli-j
cli: cli-c
cli-c:
ncs_cli -u admin -C
cli-j:
ncs_cli -u admin
###
### HERE FOLLOWS SOME HANDY GIT TARGETS WHEN WORKING WITH REMOTE REPOS
###
.PHONY: gstat glog
gstat:
@for i in `grep GIT_PACKAGES .build-meta 2> /dev/null | cut -d= -f2`; \
do \
echo ""; \
echo "--- $$i ---"; \
(cd "packages/$$i"; \
git status -uno --ignore-submodules;); \
done
# Set N=<n> on the command line for more log output.
N = 1
glog:
@for i in `grep GIT_PACKAGES .build-meta 2> /dev/null | cut -d= -f2`; \
do \
echo ""; \
echo "--- $$i ---"; \
(cd "packages/$$i"; \
git --no-pager log -n "$(N)";); \
echo ""; \
done