-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
55 lines (41 loc) · 1.13 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
# Makefile for Synerex
GOCMD=go
GIT=git
MAKE=make
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
RM=rm
SUBTARGETS=nodeserv server provider/map provider/fleet
DOIT=$(shell if [ 30 -gt `git submodule status --recursive | wc -l` ];then echo "do"; fi)
# Main target
.PHONY: all
all: submodule build
.PHONY: build
build: $(SUBTARGETS)
.PHONY: $(SUBTARGETS)
$(SUBTARGETS):
$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: runserver
runserver:
cd nodeserv; ./nodeserv &
cd server; ./synerex-server &
.PHONY: clean
clean: $(SUBTARGETS)
.PHONY: submodule
submodule:
@if [ x$(DOIT) = "xdo" ] ; then $(GIT) submodule update --init --recursive; fi
@if [ x$(DOIT) = "xdo" ] ; then $(GIT) submodule -q foreach --recursive git checkout -q master; fi
.PHONY: pushall
pushall:
$(GIT) push --recurse-submodules=on-demand
.PHONY: supdate
supdate:
$(GIT) submodule update --remote --merge --recursive
.PHONY: scommit
scommit:
$(GIT) submodule -q foreach --recursive 'if [ `git status -s|wc -l` -gt 0 ]; then pwd; git commit -m "update"; fi'
.PHONY: sstatus
sstatus:
$(GIT) submodule -q foreach --recursive git status -s