aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-12 16:30:53 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-12 16:30:53 +0100
commit6807982106c0e3ec1837421c0e69e8531a8c3b28 (patch)
tree70eb3c082e43f8491dd7634271766b99ef383241
parent4c5ef5b3e1bb7775386a6c6c2e9b00b3456c59d8 (diff)
Makefile: clone dependencies into 'deps' folder
We used to rely on out-of-tree git clones to be prepared by the user. This commit changes the system to make sure we clone all git repos we depend upon into the 'deps' folder, and then setup the symlinks to that folder. As a result, we should be able to support self-contained builds using the makefiles in this repo.
-rw-r--r--Makefile6
-rwxr-xr-xbsc-nat/gen_links.sh2
-rwxr-xr-xbsc/gen_links.sh2
-rw-r--r--deps/Makefile67
-rwxr-xr-xggsn_tests/gen_links.sh2
-rwxr-xr-xgprs_gb/gen_links.sh2
-rwxr-xr-xlapdm/gen_links.sh2
-rwxr-xr-xmgw/gen_links.sh2
-rwxr-xr-xmsc_tests/gen_links.sh2
-rwxr-xr-xselftest/gen_links.sh2
-rwxr-xr-xsysinfo/gen_links.sh2
11 files changed, 81 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index e0171292..6a470a0d 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,11 @@ PARALLEL_MAKE:=-j4
# make bsc/all
# make bsc (equivalent to bsc/all)
-default: all
+default: deps all
+
+.PHONY: deps
+deps:
+ $(MAKE) -C deps
compile: $(foreach dir,$(SUBDIRS),$(dir)/compile)
clean: $(foreach dir,$(SUBDIRS),$(dir)/clean)
diff --git a/bsc-nat/gen_links.sh b/bsc-nat/gen_links.sh
index eea1ce6d..9846d9a3 100755
--- a/bsc-nat/gen_links.sh
+++ b/bsc-nat/gen_links.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-BASEDIR=~/projects/git
+BASEDIR=../deps
gen_links() {
DIR=$1
diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh
index e6c1b442..e46bee1a 100755
--- a/bsc/gen_links.sh
+++ b/bsc/gen_links.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-BASEDIR=~/projects/git
+BASEDIR=../deps
gen_links() {
DIR=$1
diff --git a/deps/Makefile b/deps/Makefile
new file mode 100644
index 00000000..ac664930
--- /dev/null
+++ b/deps/Makefile
@@ -0,0 +1,67 @@
+
+ECLIPSEGIT:=https://github.com/eclipse
+ECLIPSEGIT2:=git://git.eclipse.org/gitroot/titan
+
+ECLIPSEGIT_REPOS= titan.Libraries.TCCUsefulFunctions \
+ titan.ProtocolModules.ICMP \
+ titan.ProtocolModules.ICMPv6 \
+ titan.ProtocolModules.IP \
+ titan.ProtocolModules.L2TP \
+ titan.ProtocolModules.M3UA \
+ titan.ProtocolModules.SMPP \
+ titan.ProtocolModules.TCP \
+ titan.ProtocolModules.UDP \
+ titan.ProtocolModules.RTP \
+ titan.TestPorts.Common_Components.Socket-API \
+ titan.TestPorts.IPL4asp \
+ titan.TestPorts.LANL2asp \
+ titan.TestPorts.PCAPasp \
+ titan.TestPorts.SCTPasp \
+ titan.TestPorts.SIPmsg \
+ titan.TestPorts.TCPasp \
+ titan.TestPorts.TELNETasp \
+ titan.TestPorts.UDPasp \
+ titan.TestPorts.UNIX_DOMAIN_SOCKETasp
+
+ECLIPSEGIT2_REPOS= titan.ProtocolModules.GRE \
+ titan.ProtocolModules.M2PA \
+ titan.ProtocolModules.SCTP \
+ titan.ProtocolModules.SUA \
+ titan.ProtocolModules.SDP \
+ titan.TestPorts.GPIO \
+ titan.ProtocolModules.BSSAPP_v7.3.0 \
+ titan.ProtocolModules.BSSGP_v13.0.0 \
+ titan.ProtocolModules.BSSMAP_v11.2.0 \
+ titan.ProtocolModules.GTP_v13.5.0 \
+ titan.ProtocolModules.GTPv2_v13.7.0 \
+ titan.ProtocolModules.ISUP_Q.762 \
+ titan.ProtocolModules.LLC_v7.1.0 \
+ titan.ProtocolModules.MobileL3_v13.4.0 \
+ titan.ProtocolModules.NS_v7.3.0 \
+ titan.ProtocolModules.SNDCP_v7.0.0
+
+ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS)
+
+all: $(ALL_REPOS)
+
+update: $(foreach dir,$(ALL_REPOS),$(dir)/update)
+clean: $(foreach dir,$(ALL_REPOS),$(dir)/clean)
+
+define GIT_template
+$(1):
+ git clone $(2)/$(1)
+
+.PHONY:$(1)/update
+$(1)/update: $(1)
+ (cd $(1) && git fetch && git checkout -f -B master)
+
+.PHONY: $(1)/clean
+$(1)/clean:
+ @rm -rf $(1)
+endef
+
+$(foreach dir,$(ECLIPSEGIT_REPOS), \
+ $(eval $(call GIT_template,$(dir),$(ECLIPSEGIT))))
+
+$(foreach dir,$(ECLIPSEGIT2_REPOS), \
+ $(eval $(call GIT_template,$(dir),$(ECLIPSEGIT2))))
diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh
index 6dd2d621..8098f9ba 100755
--- a/ggsn_tests/gen_links.sh
+++ b/ggsn_tests/gen_links.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-BASEDIR=~/projects/git
+BASEDIR=../deps
gen_links() {
DIR=$1
diff --git a/gprs_gb/gen_links.sh b/gprs_gb/gen_links.sh
index f2433d59..8a85745b 100755
--- a/gprs_gb/gen_links.sh
+++ b/gprs_gb/gen_links.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-BASEDIR=~/projects/git
+BASEDIR=../deps
gen_links() {
DIR=$1
diff --git a/lapdm/gen_links.sh b/lapdm/gen_links.sh
index ab4eec3a..93655f04 100755
--- a/lapdm/gen_links.sh
+++ b/lapdm/gen_links.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-BASEDIR=~/projects/git
+BASEDIR=../deps
gen_links() {
DIR=$1
diff --git a/mgw/gen_links.sh b/mgw/gen_links.sh
index bbfcc1d7..0b8195e0 100755
--- a/mgw/gen_links.sh
+++ b/mgw/gen_links.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-BASEDIR=~/projects/git
+BASEDIR=../deps
gen_links() {
DIR=$1
diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh
index 33b564da..62d84532 100755
--- a/msc_tests/gen_links.sh
+++ b/msc_tests/gen_links.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-BASEDIR=~/projects/git
+BASEDIR=../deps
gen_links() {
DIR=$1
diff --git a/selftest/gen_links.sh b/selftest/gen_links.sh
index b1e9ca12..167bb41d 100755
--- a/selftest/gen_links.sh
+++ b/selftest/gen_links.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-BASEDIR=~/projects/git
+BASEDIR=../deps
gen_links() {
DIR=$1
diff --git a/sysinfo/gen_links.sh b/sysinfo/gen_links.sh
index 1930acdc..0880b4b0 100755
--- a/sysinfo/gen_links.sh
+++ b/sysinfo/gen_links.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-BASEDIR=~/projects/git
+BASEDIR=../deps
gen_links() {
DIR=$1